@@ -71,12 +71,13 @@ function gpg() {
7171}
7272
7373function init_gnupg() {
74- mkdir -p " $BUILDDIRECTORY /_gnupg"
74+ mkdir -p " $BUILDDIRECTORY /"
75+ mkdir -p --mode 700 " $BUILDDIRECTORY /_gnupg"
7576
7677 # ensure signing key is available
7778 # We try WKD first, then fallback to keyservers.
7879 # This works on debian./
79- gpg --keyserver=p80.pool.sks-keyservers.net --auto-key-locate wkd,keyserver --locate-keys pierre@archlinux.de
80+ gpg --keyserver=p80.pool.sks-keyservers.net --auto-key-locate wkd,keyserver --locate-keys pierre@archlinux.org
8081}
8182
8283# Desc: Sets the appropriate colors for output
@@ -312,7 +313,8 @@ function init_chroot(){
312313 if nlock 9 " $BUILDDIRECTORY " /root.lock; then
313314 msg " Updating container"
314315 printf ' Server = %s\n' " $HOSTMIRROR " > " $BUILDDIRECTORY " /root/etc/pacman.d/mirrorlist
315- exec_nspawn root pacman -Syu --noconfirm
316+ exec_nspawn root pacman -Sy --noconfirm archlinux-keyring
317+ exec_nspawn root pacman -Su --noconfirm
316318 lock_close 9
317319 else
318320 msg " Couldn't acquire container lock, didn't update."
@@ -332,9 +334,7 @@ function cmd_check(){
332334 done <<< " $( buildinfo -ff " ${pkg} " ) "
333335 packager= " ${buildinfo[packager]} "
334336 builddir= " ${buildinfo[builddir]} "
335- _pkgver= " ${buildinfo[pkgver]} "
336- pkgrel= ${_pkgver##* -}
337- pkgver= ${_pkgver% -* }
337+ pkgver= " ${buildinfo[pkgver]} "
338338 pkgbase= ${buildinfo[pkgbase]}
339339 options= ${buildinfo[options]}
340340 buildenv= ${buildinfo[buildenv]}
@@ -375,31 +375,28 @@ function cmd_check(){
375375
376376 # Father I have sinned
377377 if (( ! pkgbuild_file)) ; then
378- msg2 " Fetching PKGBUILD from ASP ..."
378+ msg2 " Fetching PKGBUILD from git ..."
379379
380380 # Lock the cachedir as we might have a race condition with pacman -S and the cachedir
381381 lock 9 " ${cachedir} .lock"
382382
383383 EPHEMERAL=1 exec_nspawn root --bind=" ${build_root_dir} /startdir:/startdir" --bind=" $( readlink -e ${cachedir} ) :/var/cache/pacman/pkg" \
384384 bash << -__END__
385385shopt -s globstar
386- pacman -S asp --noconfirm --needed
387- if ! asp checkout $pkgbase ; then
386+
387+ pacman -S devtools --noconfirm --needed
388+
389+ if ! pkgctl repo clone --protocol https --switch "$pkgver " "$pkgbase "; then
388390 echo "ERROR: Failed checkout $pkgbase " >&2
389391 exit 1
390392fi
391- pushd $pkgbase
392- for rev in \$ (git rev-list --all -- repos/); do
393- pkgbuild_checksum=\$ (git show \$ rev:trunk/PKGBUILD | sha256sum -b)
394- pkgbuild_checksum=\$ {pkgbuild_checksum%% *}
395- if [ \$ pkgbuild_checksum = $pkgbuild_sha256sum ]; then
396- git checkout \$ rev
397- mv ./trunk/* /startdir
398- exit 0
399- fi
400- done
401- echo "ERROR: Failed to find commit this was built with (PKGBUILD checksum didn't match any commit)" >&2
402- 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
403400__END__
404401 lock_close 9 " ${cachedir} .lock"
405402 elif [[ -r " PKGBUILD" ]]; then
@@ -488,6 +485,7 @@ rm --recursive /etc/pacman.d/gnupg/
488485cp --target-directory= /etc/pacman.d/ --recursive /gnupg
489486echo " faked-system-time ${SOURCE_DATE_EPOCH} " >> /etc/pacman.d/gnupg/gpg.conf
490487pacstrap -G -U /mnt --needed " \$ @"
488+
491489echo " Installing devtools from $DEVTOOLS_PKG "
492490# Ignore all dependencies since we only want the file
493491# Saves us a few seconds and doesn't download a bunch of things
@@ -497,7 +495,12 @@ if [[ "$DEVTOOLS_PKG" == https* ]]; then
497495else
498496 pacman --noconfirm --needed -Sddu " $DEVTOOLS_PKG "
499497fi
500- 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
501504__END__
502505 lock_close 9 " $KEYRINGCACHE /$keyring_package .lock"
503506
0 commit comments