summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-04-23 07:57:36 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-04-23 08:01:53 +0000
commit3b4c88ff4b799717d24fb55172ae94dfb7541dde (patch)
treeac986a082fd0c112a1a8840b277ed8d0a7ec009a
parentcf102231ea9d1ab29536c64401543253516e21c7 (diff)
downloadabuild-3b4c88ff4b799717d24fb55172ae94dfb7541dde.tar.gz
abuild-3b4c88ff4b799717d24fb55172ae94dfb7541dde.tar.bz2
abuild-3b4c88ff4b799717d24fb55172ae94dfb7541dde.tar.xz
abuild-3b4c88ff4b799717d24fb55172ae94dfb7541dde.zip
buildrepo: fix clean of old pkgs
- we need check arch for noarch - we need list packages generated from $linguas
-rwxr-xr-xbuildrepo.in37
1 files changed, 23 insertions, 14 deletions
diff --git a/buildrepo.in b/buildrepo.in
index 2370db7..7707049 100755
--- a/buildrepo.in
+++ b/buildrepo.in
@@ -31,9 +31,22 @@ usage() {
exit 1
}
+is_in() {
+ local needle="$1" arg=
+ shift
+ for arg; do
+ [ "$needle" = "$arg" ] && return 0
+ done
+ return 1
+}
+
+check_arch() {
+ [ "$1" = "all" ] || [ "$1" = "noarch" ] || is_in "$CARCH" $@
+}
listpackages() {
- local repo="$1" i= pkgname= pkgver= pkgrel= subpackage= arch= subpkg=
+ local repo="$1" i= pkgname= pkgver= pkgrel= subpackage= arch= subpkg= linguas=
+ local lang= suffix=
cd "$aportsdir/$repo"
for i in */APKBUILD; do
cd "$aportsdir/$repo"/${i%/*} || return 1
@@ -42,12 +55,18 @@ listpackages() {
pkgrel=
subpackages=
arch=
+ linguas=
. ./APKBUILD
- if ! is_in all $arch && ! is_in "$CARCH" $arch; then
+ suffix="$pkgver-r$pkgrel.apk"
+
+ if ! check_arch $arch; then
continue
fi
for subpkg in $pkgname $subpackages; do
- echo ${subpkg%:*}-$pkgver-r$pkgrel.apk
+ echo ${subpkg%:*}-$suffix
+ done
+ for lang in $linguas; do
+ echo $pkgname-lang-$lang-$suffix
done
done
}
@@ -60,16 +79,6 @@ all_exist() {
return 0
}
-is_in() {
- local needle="$1"
- shift
- while [ $# -gt 0 ]; do
- [ "$needle" = "$1" ] && return 0
- shift
- done
- return 1
-}
-
list_needbuild() {
local repo="$1" i=
@@ -89,7 +98,7 @@ list_needbuild() {
arch=
. ./APKBUILD
- if ! is_in all $arch && ! is_in $CARCH $arch; then
+ if ! check_arch $arch; then
continue
fi