abuild: restore working dir after updating index

This fixes issue with `abuild cleanpkg all`, which would fail to set
SOURCE_DATE_EPOC for reproducible builds.
This commit is contained in:
Natanael Copa 2020-10-29 14:42:12 +00:00
parent 614fbc507b
commit 32785f6360
1 changed files with 2 additions and 0 deletions

View File

@ -1727,6 +1727,7 @@ update_abuildrepo_index() {
DESCRIPTION="$repo $(cd $startdir && $git describe 2>/dev/null || true)"
fi
local oldpwd="$PWD"
for i in $allarch; do
cd "$REPODEST/$repo/$i"
local index=$i/APKINDEX.tar.gz
@ -1745,6 +1746,7 @@ update_abuildrepo_index() {
mv APKINDEX.tar.gz.$$ APKINDEX.tar.gz \
) || (rm -f APKINDEX.tar.gz.$$ ; die "Failed to create index")
done
cd "$oldpwd"
}
# predefined function check