Skip to content

Commit

Permalink
[nvidia-inst, eos-apps-helper] minor speed up changes
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-192 committed Nov 4, 2023
1 parent 305dce1 commit 765df65
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions eos-apps-info/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pkgname=eos-apps-info
pkgdesc="Documentation about apps in the EndeavourOS repository."
pkgver=23
pkgrel=3
pkgrel=4
arch=('any')
license=('GPL')
depends=(
Expand Down Expand Up @@ -33,11 +33,11 @@ source=(
)

sha512sums=('8854670651e2185da652163cef9500c99dad8ed0cc3e10621ef4e1b5692537493970ed3f30969b6ae80d7f12383de29d51ffb8c0fa2711eaea1ed49e540cc6c0'
'dbc9308955967856fe317e3a8bf5dbd7f75f7040b21fb92f49f66d747efda5bd776eb3285102c0e9c4d81a5be2f436a42d2c770229c357f3c111144afe766047'
'264b2ce9f3981728bb45e52ab9d2ec782a5e9a291ca2b9249a5558529f4717c868545524677185cb5cc2f370f373818dd2c690fa79f1a107c34c65b3d6ea53a0'
'48fab2cd10049ec673f79ed89a2865881c2c9882464824961978f7ee28ce33457ee611336b91c1f98ea2ac46b520aad5f63d2ce90156168f92241e1d3fe7b914'
'8a0692ff5e714a0690c7a90d04a928b2edf2e01515f8707b345d0da36ee95cab7f4f9badf3dca6cbd280438a08519957c5852be92e7936da9f0affef3d895b17'
'4b5eef3ce297cfa66d38b6ad92739eee905050228f72bd2c58d7f05700269b0ef434b0aa5c6ff8423a98af33918089f1255858bd2385ef3db2967d71e0d1d350'
'326c7996435d45abdc858c69f895346e87c38a2f2f3c67422e98c51e901818c526de467ae68b74720f0c830c6e8646ff9f55486f5a64feaac69faab96bf2c37c')
'6d0b0b7b05529a4e35492caa251ef164b59bfb379ef0a6e473cf68b3954b257b1e2d4dd09e7353c7d1c4e181188e3d907dfbb23d138fb17a41ee2a3632ac290d')

package() {
local xx
Expand Down
2 changes: 1 addition & 1 deletion eos-apps-info/eos-apps-info-helper
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ URL_from_package() {
for prog in /usr/bin/yay /usr/bin/pacman ; do
if [ -x $prog ] ; then
for opt in "-Qi" "-Si" ; do
url="$(LANG=C $prog $opt "$pkgname" 2>/dev/null | grep -w ^URL | head -n1 | awk '{print $NF}')"
url="$(LANG=C $prog $opt "$pkgname" 2>/dev/null | grep -m1 -w ^URL | awk '{print $NF}')"
if [ -n "$url" ] ; then
return
fi
Expand Down
Binary file modified eos-apps-info/eos-apps-info-pages.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions nvidia-inst/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

pkgname=nvidia-inst
pkgver=23
pkgrel=8
pkgrel=9
pkgdesc="Script to setup nvidia drivers (dkms version) in EndeavourOS"
url=https://github.com/endeavouros-team/PKGBUILDS/tree/master/$pkgname
_url=https://raw.githubusercontent.com/endeavouros-team/PKGBUILDS/master/$pkgname
Expand All @@ -26,7 +26,7 @@ source=(
$_url/$pkgname
$_url/$pkgname.bash-completion
)
sha512sums=('a6f9c31cea2565eb3713d46b0f659944db4486ed539a99e5a7107e8048c495714348cc39d00fd87ca92300a911cda605fa09927d89ae439f86819e6ebc6a1d64'
sha512sums=('56c80d2c481a2c693633abc2a66b0941d2fb410e93b2faacfea8f9c5754a2e7793e340fe12bbddee4364935a48cd8d055d17e94a41b3fefa8d67b6c0c1609be3'
'b8857ff98870ac8cff78e31c660bde3b7308752ee4e6547682340866ee59f5801f09ede41e490380a40926536f47259f5d347fd59e8e2ffa67a8cb57f07c44e6')

package() {
Expand Down
16 changes: 9 additions & 7 deletions nvidia-inst/nvidia-inst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ KeepsAndRemoves() {

# check if install contains any AUR stuff

local repopkgs="$(pacman -Ssq)"
local repopkgs="$(expac -S %n)"

for kp in "${install[@]}" ; do
if ! IsRepoPkg "$kp" ; then
Expand Down Expand Up @@ -323,7 +323,7 @@ Options() {
exit 0
;;
-v | --version)
[ -n "$PROGVERSION" ] || PROGVERSION=$(pacman -Q "$progname" 2>/dev/null | awk '{print $2}')
[ -n "$PROGVERSION" ] || PROGVERSION=$(expac -Q %v "$progname")
echo "$progname $PROGVERSION"
exit 0
;;
Expand Down Expand Up @@ -434,7 +434,7 @@ AllRemovables() {
xf86-video-nouveau

# nvidia packages from repos:
$(pacman -Ssq nvidia | grep -P '^nvidia|^lib32-nvidia' | grep -Pv 'nvidia-inst|-cg-|beta')
$(expac -Ss %n nvidia | grep -P '^nvidia|^lib32-nvidia' | grep -Pv 'nvidia-inst|-cg-|beta')
)

# Note: older Nvidia drivers must come from a configured repo, not from the AUR,
Expand Down Expand Up @@ -529,7 +529,7 @@ SanityChecks() {
}

GetSeriesFromPacman() {
local pacman_version=$(LANG=C pacman -Si nvidia-dkms | grep -w ^Version | head -n1 | awk '{print $NF}' | sed 's|-[0-9.]*$||') # only pkgver
local pacman_version=$(echo "$latest_arch_version_full" | sed 's|-[0-9.]*$||') # only pkgver
local pacman_version_series=${pacman_version%%.*}
echo "$pacman_version_series"
}
Expand Down Expand Up @@ -582,16 +582,18 @@ Main()
source /usr/share/endeavouros/scripts/eos-script-lib-yad || return 1

SanityChecks
local all_installed_packages="$(pacman -Qsq)"
local all_installed_packages="$(expac -Q %n)"

local latest_from_arch=$(LANG=C pacman -Si nvidia-dkms | grep -w ^Version | head -n1 | awk '{print $NF}' | cut -d '.' -f1)
local -r latest_arch_version_full=$(expac -S %v nvidia-dkms)

local -r latest_from_arch=$(echo "$latest_arch_version_full" | cut -d '.' -f1)
if [ "$latest_from_arch" != "$series_now" ] ; then
Warn "Series $series_now is no more the latest in Arch but $latest_from_arch is. Results may not be accurate."
fi

AllRemovables

[ -n "$PROGVERSION" ] || PROGVERSION=$(pacman -Q "$progname" 2>/dev/null | awk '{print $2}')
[ -n "$PROGVERSION" ] || PROGVERSION=$(expac -Q %v "$progname")
Info "Running: $progname v$PROGVERSION"
Info "Command line: $progname $*"
Info "Selected mode: $mode"
Expand Down

0 comments on commit 765df65

Please sign in to comment.