mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-03 13:12:15 +00:00
buildrepo: check if all files exist before try copy anything
seems like copy removes destination if source does not exist so we ended up with a buildrepo that removed all packages
This commit is contained in:
parent
494960f291
commit
896c436e14
17
buildrepo.in
17
buildrepo.in
@ -28,6 +28,14 @@ listpackages() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
all_exist() {
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
[ -e "$1" ] || return 1
|
||||||
|
shift 1
|
||||||
|
done
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
local repo="$1" i indexupdate needbuild
|
local repo="$1" i indexupdate needbuild
|
||||||
|
|
||||||
@ -47,15 +55,18 @@ build() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
indexupdate="$indexupdate $i"
|
||||||
|
|
||||||
# try link or copy the files if they are in the ports dir
|
# try link or copy the files if they are in the ports dir
|
||||||
pkgs=$(abuild listpkg)
|
pkgs=$(abuild listpkg)
|
||||||
if cp -p -l $pkgs "$repodir/$repo"/ 2>/dev/null \
|
if all_exist $pkgs; then
|
||||||
|| cp -p $pkgs "$repodir/$repo"/ 2>/dev/null; then
|
|
||||||
echo ">>> Copying " $pkgs
|
echo ">>> Copying " $pkgs
|
||||||
|
cp -p -l $pkgs "$repodir/$repo"/ 2>/dev/null \
|
||||||
|
|| cp -p $pkgs "$repodir/$repo"/ \
|
||||||
|
|| needbuild="$needbuild $i"
|
||||||
else
|
else
|
||||||
needbuild="$needbuild $i"
|
needbuild="$needbuild $i"
|
||||||
fi
|
fi
|
||||||
indexupdate="$indexupdate $i"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# build the postponed packages if any
|
# build the postponed packages if any
|
||||||
|
Loading…
Reference in New Issue
Block a user