diff options
author | XZS | 2015-08-06 14:44:08 +0200 |
---|---|---|
committer | XZS | 2015-08-06 14:44:08 +0200 |
commit | e1025e44c509faa306875319c794fa0efcfc603b (patch) | |
tree | c0d56230e3d2e6315f859d6ca4882d6dfaf3bbbe | |
parent | b8e2df794810203c5601065f3c972298ff1457e2 (diff) | |
download | aur-e1025e44c509faa306875319c794fa0efcfc603b.tar.gz |
sort package functions
Sorting the template inclusion by the order of their package functions
being called showed a bug swallowing dependencies. Misusing the indexed
array of dependencies placed the element assigned by a key in first
position always overwriting an already present element. Using a symbolic
number makes it work fine as long as it is ensured that this number is
greater than the number of dependencies, which should be fairly probable
with 125.
-rw-r--r-- | .SRCINFO | 3 | ||||
-rw-r--r-- | PKGBUILD | 32 |
2 files changed, 18 insertions, 17 deletions
@@ -7,8 +7,9 @@ pkgbase = gnome-shell-extension-maximus-two-git arch = any license = GPLv3 makedepends = git - depends = gnome-shell + depends = xorg-xprop depends = wmctrl + depends = gnome-shell provides = gnome-shell-extension-maximus-two conflicts = gnome-shell-extension-maximus-two source = gnome-shell-extension-maximus-two::git+https://github.com/wilfm/GnomeExtensionMaximusTwo @@ -23,22 +23,6 @@ pkgver() { [ ${PIPESTATUS[0]} -ne 0 ] && \ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } -depends[gnomeshell]=gnome-shell - -package_20_version() { - local compatibles=($(\ - find -path ./pkg -type d -prune -o \ - -name metadata.json -exec grep -Pzo '(?s)(?<="shell-version": \[)[^\[\]]*(?=\])' '{}' \; | \ - tr '\n," ' '\n' | sed 's/3\.//g;/^$/d' | sort -n -t. -k 1,1)) - depends+=("gnome-shell>=3.${compatibles[0]}") - local max="${compatibles[-1]}" - if [ "3.$max" != $( - gnome-shell --version | grep -Po '(?<=GNOME Shell 3\.)[[:digit:]]+' - ) ]; then - depends+=("gnome-shell<3.$((${max%%.*} + 1))") - fi - unset depends[gnomeshell] -} package() { for function in $(declare -F | grep -Po 'package_[[:digit:]]+[[:alpha:]_]*$') do @@ -56,3 +40,19 @@ package_02_install() { msg2 'Installing extension code...' find -maxdepth 1 \( -iname '*.js*' -or -iname '*.css' -or -iname '*.ui' \) -exec install -Dm644 -t "$destdir" '{}' + } +depends[125]=gnome-shell + +package_20_version() { + local compatibles=($(\ + find -path ./pkg -type d -prune -o \ + -name metadata.json -exec grep -Pzo '(?s)(?<="shell-version": \[)[^\[\]]*(?=\])' '{}' \; | \ + tr '\n," ' '\n' | sed 's/3\.//g;/^$/d' | sort -n -t. -k 1,1)) + depends+=("gnome-shell>=3.${compatibles[0]}") + local max="${compatibles[-1]}" + if [ "3.$max" != $( + gnome-shell --version | grep -Po '(?<=GNOME Shell 3\.)[[:digit:]]+' + ) ]; then + depends+=("gnome-shell<3.$((${max%%.*} + 1))") + fi + unset depends[125] +} |