Skip to content

Commit 63ce751

Browse files
authored
Merge pull request #124 from archlinux/git
Clone from gitlab instead of using asp
2 parents 5994f40 + 5523e23 commit 63ce751

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

repro.in

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,7 @@ function cmd_check(){
334334
done <<< "$(buildinfo -ff "${pkg}")"
335335
packager="${buildinfo[packager]}"
336336
builddir="${buildinfo[builddir]}"
337-
_pkgver="${buildinfo[pkgver]}"
338-
pkgrel=${_pkgver##*-}
339-
pkgver=${_pkgver%-*}
337+
pkgver="${buildinfo[pkgver]}"
340338
pkgbase=${buildinfo[pkgbase]}
341339
options=${buildinfo[options]}
342340
buildenv=${buildinfo[buildenv]}
@@ -377,31 +375,28 @@ function cmd_check(){
377375

378376
# Father I have sinned
379377
if ((!pkgbuild_file)); then
380-
msg2 "Fetching PKGBUILD from ASP..."
378+
msg2 "Fetching PKGBUILD from git..."
381379

382380
# Lock the cachedir as we might have a race condition with pacman -S and the cachedir
383381
lock 9 "${cachedir}.lock"
384382

385383
EPHEMERAL=1 exec_nspawn root --bind="${build_root_dir}/startdir:/startdir" --bind="$(readlink -e ${cachedir}):/var/cache/pacman/pkg" \
386384
bash <<-__END__
387385
shopt -s globstar
388-
pacman -S asp --noconfirm --needed
389-
if ! asp checkout $pkgbase; then
386+
387+
pacman -S devtools --noconfirm --needed
388+
389+
if ! pkgctl repo clone --protocol https --switch "$pkgver" "$pkgbase"; then
390390
echo "ERROR: Failed checkout $pkgbase" >&2
391391
exit 1
392392
fi
393-
pushd $pkgbase
394-
for rev in \$(git rev-list --all -- repos/); do
395-
pkgbuild_checksum=\$(git show \$rev:trunk/PKGBUILD | sha256sum -b)
396-
pkgbuild_checksum=\${pkgbuild_checksum%% *}
397-
if [ \$pkgbuild_checksum = $pkgbuild_sha256sum ]; then
398-
git checkout \$rev
399-
mv ./trunk/* /startdir
400-
exit 0
401-
fi
402-
done
403-
echo "ERROR: Failed to find commit this was built with (PKGBUILD checksum didn't match any commit)" >&2
404-
exit 1
393+
394+
if ! echo "$pkgbuild_sha256sum $pkgbase/PKGBUILD" | sha256sum -c; then
395+
echo "ERROR: Failed to find commit this was built with (PKGBUILD checksum didn't match)" >&2
396+
exit 1
397+
fi
398+
399+
mv ./$pkgbase/* /startdir
405400
__END__
406401
lock_close 9 "${cachedir}.lock"
407402
elif [[ -r "PKGBUILD" ]]; then
@@ -490,6 +485,7 @@ rm --recursive /etc/pacman.d/gnupg/
490485
cp --target-directory=/etc/pacman.d/ --recursive /gnupg
491486
echo "faked-system-time ${SOURCE_DATE_EPOCH}" >> /etc/pacman.d/gnupg/gpg.conf
492487
pacstrap -G -U /mnt --needed "\$@"
488+
493489
echo "Installing devtools from $DEVTOOLS_PKG"
494490
# Ignore all dependencies since we only want the file
495491
# Saves us a few seconds and doesn't download a bunch of things
@@ -499,7 +495,12 @@ if [[ "$DEVTOOLS_PKG" == https* ]]; then
499495
else
500496
pacman --noconfirm --needed -Sddu "$DEVTOOLS_PKG"
501497
fi
502-
cp -v /usr/share/devtools/makepkg-x86_64.conf /mnt/etc/makepkg.conf
498+
499+
for makepkg_path in /usr/share/devtools/{makepkg-x86_64.conf,makepkg.d/x86_64.conf}; do
500+
if [ -f "\$makepkg_path" ]; then
501+
cp -v "\$makepkg_path" /mnt/etc/makepkg.conf
502+
fi
503+
done
503504
__END__
504505
lock_close 9 "$KEYRINGCACHE/$keyring_package.lock"
505506

0 commit comments

Comments
 (0)