summaryrefslogtreecommitdiff
path: root/buildrepo.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-07-24 17:11:56 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-07-24 17:11:56 +0000
commitd7d7e55e91d9109fff8667f0d036c501aa14e1d9 (patch)
tree9f4987ad7bffdc19f395a23768940c7cc6b7126b /buildrepo.in
parent640b086ec8a9627f980ec3433dfe37c2f9b6be65 (diff)
downloadabuild-d7d7e55e91d9109fff8667f0d036c501aa14e1d9.tar.gz
abuild-d7d7e55e91d9109fff8667f0d036c501aa14e1d9.tar.bz2
abuild-d7d7e55e91d9109fff8667f0d036c501aa14e1d9.tar.xz
abuild-d7d7e55e91d9109fff8667f0d036c501aa14e1d9.zip
buildrepo: use new apk index and sign repo
Diffstat (limited to 'buildrepo.in')
-rwxr-xr-xbuildrepo.in43
1 files changed, 13 insertions, 30 deletions
diff --git a/buildrepo.in b/buildrepo.in
index 2be50e1..7c24b86 100755
--- a/buildrepo.in
+++ b/buildrepo.in
@@ -37,13 +37,9 @@ all_exist() {
}
build() {
- local repo="$1" i indexupdate needbuild
+ local repo="$1" i needbuild
cd "$aportsdir/$repo" || return 1
- mkdir -p "$repodir/$repo"
- if ! [ -f "$repodir/$repo"/APK_INDEX.gz ]; then
- indexupdate="APK_INDEX.gz"
- fi
# first we try copy everything possible and find out which we need
# to rebuild. By doing this we might save us for rebuilding
@@ -55,8 +51,6 @@ build() {
continue
fi
- indexupdate="$indexupdate $i"
-
# try link or copy the files if they are in the ports dir
pkgs=$(abuild listpkg)
if all_exist $pkgs; then
@@ -87,35 +81,24 @@ build() {
purge=$(ls *.apk 2>/dev/null | grep -v -w -f $tmp)
if [ -n "$purge" ]; then
rm -f $purge
- indexupdate="$indexupdate $purge"
fi
rm -f "$tmp"
fi
- # check if we have any .apk newer than our index
+ # generate the repository index
+ echo ">>> Generating Index for $repo..."
cd "$repodir/$repo"
- if [ -z "$indexupdate" ]; then
- for i in *.apk; do
- if [ $i -nt APK_INDEX.gz ]; then
- indexupdate=1
- break;
- fi
- done
- fi
-
- # generate the repository index if needed
- if [ -z "$indexupdate" ]; then
- echo ">>> Index for $repo is up-to-date"
- else
- echo ">>> Generating Index for $repo..."
- if which apk >/dev/null; then
- local deps
- for i in $deprepo; do
- deps="--repo $repodir/$i"
- done
- apk $deps index *.apk | gzip -9 > APK_INDEX.gz
- fi
+ local deps
+ for i in $deprepo; do
+ deps="--repo $repodir/$i"
+ done
+ oldindex=
+ if [ -f APKINDEX.tar.gz ]; then
+ oldindex="--index APKINDEX.tar.gz"
fi
+ tmpindex=$(mktemp).tar.gz
+ apk index $oldindex -o $tmpindex *.apk
+ abuild-sign $tmpindex && mv $tmpindex APKINDEX.tar.gz
}
while getopts "a:d:hl:pr:" opt; do