mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-11 17:29:52 +00:00
abuild: test for duplicates when doing checksum
fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10013
This commit is contained in:
parent
c9a4ddf3b4
commit
db1950c5ce
@ -2260,7 +2260,11 @@ checksum() {
|
||||
[ -z "$source" ] && return 0
|
||||
fetch
|
||||
for s in $source; do
|
||||
files="$files $(filename_from_uri $s)"
|
||||
local name="$(filename_from_uri $s)"
|
||||
case " $files " in
|
||||
*" $name "*) die "duplicate found in \$source: $name";;
|
||||
esac
|
||||
files="$files $name"
|
||||
done
|
||||
|
||||
msg "Updating the sha512sums in APKBUILD..."
|
||||
|
@ -97,3 +97,17 @@ teardown() {
|
||||
sha512sum -c sums
|
||||
}
|
||||
|
||||
@test "abuild: test duplicates in checksum generation" {
|
||||
mkdir -p "$tmpdir"/foo "$tmpdir"/foo/dir1 "$tmpdir"/foo/dir2
|
||||
cat >> "$tmpdir"/foo/APKBUILD <<-EOF
|
||||
pkgname="foo"
|
||||
pkgver="1.0"
|
||||
source="dir1/testfile dir2/testfile"
|
||||
EOF
|
||||
echo "first" > "$tmpdir"/foo/dir1/testfile
|
||||
echo "second" > "$tmpdir"/foo/dir2/testfile
|
||||
cd "$tmpdir"/foo
|
||||
run $ABUILD checksum
|
||||
[ $status -ne 0 ]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user