Skip to content

Commit d0a4971

Browse files
committed
Merge remote-tracking branch 'origin/pull/125'
* origin/pull/125: Match how github generates tarballs when signing Clone from gitlab instead of using asp Update archlinux-keyring before upgrading Update gpg trusted key Create `$BUILDDIRECTORY/_gnupg` with mode 700 Rename binary name from repro to archlinux-repro Stop early on first archive extension that exists
2 parents 3be134d + de83e94 commit d0a4971

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ repro: repro.in
2222

2323
.PHONY: install
2424
install: repro man
25-
install -Dm755 repro -t $(DESTDIR)$(BINDIR)
25+
install -Dm755 repro $(DESTDIR)$(BINDIR)/$(PROGNM)
26+
ln -s $(PROGNM) $(DESTDIR)$(BINDIR)/repro
2627
install -Dm755 buildinfo -t $(DESTDIR)$(BINDIR)
2728
install -Dm644 examples/* -t $(DESTDIR)$(DOCDIR)/$(PROGNM)
2829
for manfile in $(MANS); do \
@@ -52,6 +53,6 @@ tag:
5253
.PHONY: release
5354
release:
5455
mkdir -p releases
55-
git archive --prefix=${PROGNM}-${TAG}/ -o releases/${PROGNM}-${TAG}.tar.gz ${TAG};
56+
git -c tar.tar.gz.command='gzip -cn' archive --prefix=${PROGNM}-${TAG}/ -o releases/${PROGNM}-${TAG}.tar.gz ${TAG}
5657
gpg --detach-sign -o releases/${PROGNM}-${TAG}.tar.gz.sig releases/${PROGNM}-${TAG}.tar.gz
5758
hub release create -m "Release: ${TAG}" -a releases/${PROGNM}-${TAG}.tar.gz.sig -a releases/${PROGNM}-${TAG}.tar.gz ${TAG}

buildinfo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ function download_archive_package () {
118118
echo "check ${workdir}" >&2
119119
exit 1
120120
fi
121+
break
121122
fi
122123
done
123124
cd "${pwd}" || exit 1

repro.in

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@ function gpg() {
7171
}
7272

7373
function 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__
385385
shopt -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
390392
fi
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/
488485
cp --target-directory=/etc/pacman.d/ --recursive /gnupg
489486
echo "faked-system-time ${SOURCE_DATE_EPOCH}" >> /etc/pacman.d/gnupg/gpg.conf
490487
pacstrap -G -U /mnt --needed "\$@"
488+
491489
echo "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
497495
else
498496
pacman --noconfirm --needed -Sddu "$DEVTOOLS_PKG"
499497
fi
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

Comments
 (0)