From 1489f754197a7a013e17328f9cb2fb3d2e5bdfe9 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Fri, 3 May 2013 04:52:32 +0200 Subject: arch-nspawn: setarch to CARCH Allows calling makechrootpkg without worrying about the architecture --- arch-nspawn.in | 8 +++++++- archbuild.in | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch-nspawn.in b/arch-nspawn.in index fdff31e..b3dfbfb 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -96,4 +96,10 @@ fi build_mount_args copy_hostconf -exec systemd-nspawn -D "$working_dir" --machine "${working_dir//\//-}" "${mount_args[@]}" "$@" +eval $(grep '^CARCH=' "$working_dir/etc/makepkg.conf") + +exec ${CARCH:+setarch "$CARCH"} systemd-nspawn \ + -D "$working_dir" \ + --machine "${working_dir//\//-}" \ + "${mount_args[@]}" \ + "$@" diff --git a/archbuild.in b/archbuild.in index 9f1b98a..097cc37 100644 --- a/archbuild.in +++ b/archbuild.in @@ -69,7 +69,7 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then "${base_packages[@]}" || abort else lock 9 "${chroots}/${repo}-${arch}/root.lock" "Locking clean chroot" - setarch ${arch} arch-nspawn \ + arch-nspawn \ -C "@pkgdatadir@/pacman-${repo}.conf" \ -M "@pkgdatadir@/makepkg-${arch}.conf" \ "${chroots}/${repo}-${arch}/root" \ @@ -77,4 +77,4 @@ else fi msg "Building in chroot for [${repo}] (${arch})..." -exec setarch "${arch}" makechrootpkg "${makechrootpkg_args[@]}" -r "${chroots}/${repo}-${arch}" +exec makechrootpkg "${makechrootpkg_args[@]}" -r "${chroots}/${repo}-${arch}" -- cgit v1.2.3-70-g09d2 From 4dcdbcaf1eff0962522a04710817156ce4d44b9e Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Fri, 3 May 2013 14:23:04 +0200 Subject: makechrootpkg: Ensure we have a writable PKGBUILD For pkgver updates. --- makechrootpkg.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/makechrootpkg.in b/makechrootpkg.in index 0d93c2e..862e6bc 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -247,6 +247,11 @@ shopt -s nullglob ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* +# Keep PKGBUILD writable for pkgver() +rm /startdir/PKGBUILD* +cp /startdir_host/PKGBUILD* /startdir +chown nobody /startdir/PKGBUILD* + cd /startdir sudo -u nobody makepkg $makepkg_args || exit 1 -- cgit v1.2.3-70-g09d2 From 4937422fcfd7ad2b3babe7621f201ba4376ed4cd Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Fri, 3 May 2013 20:01:32 +0200 Subject: makechrootpkg: Split out chrootbuild into a function Now syntax highlighting works properly! :D --- makechrootpkg.in | 70 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/makechrootpkg.in b/makechrootpkg.in index 862e6bc..c7baf4d 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -237,34 +237,8 @@ EOF # This is a little gross, but this way the script is recreated every time in the # working copy - cat >"$copydir/chrootbuild" <&1 | tee "/logdest/\${pkgfile##*/}-namcap.log" - done -fi - -exit 0 -EOF + printf $'#!/bin/bash\n%s\n_chrootbuild %q %q' "$(declare -f _chrootbuild)" \ + "$makepkg_args" "$run_namcap" >"$copydir/chrootbuild" chmod +x "$copydir/chrootbuild" } @@ -287,6 +261,46 @@ download_sources() { rm -rf $builddir } +_chrootbuild() { + # This function isn't run in makechrootpkg, + # so no global variables + local makepkg_args="$1" + local run_namcap="$2" + + . /etc/profile + export HOME=/build + shopt -s nullglob + + # Workaround makepkg disliking read-only dirs + ln -sft /srcdest /srcdest_host/* + ln -sft /startdir /startdir_host/* + + cd /startdir + + # Keep PKGBUILD writable for pkgver() + rm PKGBUILD* + cp /startdir_host/PKGBUILD* . + chown nobody PKGBUILD* + + # Safety check + if [[ ! -w PKGBUILD ]]; then + echo "Can't write to PKGBUILD!" + exit 1 + fi + + sudo -u nobody makepkg $makepkg_args || exit 1 + + if $run_namcap; then + pacman -S --needed --noconfirm namcap + for pkgfile in /startdir/PKGBUILD /pkgdest/*; do + echo "Checking ${pkgfile##*/}" + sudo -u nobody namcap "$pkgfile" 2>&1 | tee "/logdest/${pkgfile##*/}-namcap.log" + done + fi + + exit 0 +} + move_products() { for pkgfile in "$copydir"/pkgdest/*; do chown "$src_owner" "$pkgfile" -- cgit v1.2.3-70-g09d2 From a5bc6acf325900f2855e9f52377fb42633b75c6f Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Fri, 3 May 2013 20:15:16 +0200 Subject: arch-nspawn: Quiet systemd-nspawn again systemd-nspawn always outputs some debug messages over stderr. Both stdout and stderr from inside the chroot are sent through a pty to stdout. --- arch-nspawn.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch-nspawn.in b/arch-nspawn.in index b3dfbfb..8ef39ed 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -98,7 +98,7 @@ copy_hostconf eval $(grep '^CARCH=' "$working_dir/etc/makepkg.conf") -exec ${CARCH:+setarch "$CARCH"} systemd-nspawn \ +exec ${CARCH:+setarch "$CARCH"} systemd-nspawn 2>/dev/null \ -D "$working_dir" \ --machine "${working_dir//\//-}" \ "${mount_args[@]}" \ -- cgit v1.2.3-70-g09d2 From 38692e8d742a99e78b6f157c65dcf06dbf0c4c02 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Mon, 6 May 2013 01:35:21 +0200 Subject: archbuild: Correct makechrootpkg argument order The user-passed makechrootpkg_args may contain a "--" to pass arguments to makepkg. In this case, the order is wrong. --- archbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archbuild.in b/archbuild.in index 097cc37..b1c96f9 100644 --- a/archbuild.in +++ b/archbuild.in @@ -77,4 +77,4 @@ else fi msg "Building in chroot for [${repo}] (${arch})..." -exec makechrootpkg "${makechrootpkg_args[@]}" -r "${chroots}/${repo}-${arch}" +exec makechrootpkg -r "${chroots}/${repo}-${arch}" "${makechrootpkg_args[@]}" -- cgit v1.2.3-70-g09d2 From fc71be3479d4330dfac8641fe0a6d0517964e4be Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Thu, 9 May 2013 02:31:35 +0200 Subject: makechrootpkg: Update comments to point out the bad hacks --- makechrootpkg.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/makechrootpkg.in b/makechrootpkg.in index c7baf4d..dbe705e 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -208,7 +208,8 @@ prepare_chroot() { echo 'LOGDEST="/logdest"' >> "$copydir/etc/makepkg.conf" fi - # These two get bind-mounted + # These two get bind-mounted read-only + # XXX: makepkg dislikes having these dirs read-only, so separate them mkdir -p "$copydir/startdir" "$copydir/startdir_host" mkdir -p "$copydir/srcdest" "$copydir/srcdest_host" if ! grep -q 'SRCDEST="/srcdest"' "$copydir/etc/makepkg.conf"; then @@ -271,13 +272,13 @@ _chrootbuild() { export HOME=/build shopt -s nullglob - # Workaround makepkg disliking read-only dirs + # XXX: Workaround makepkg disliking read-only dirs ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* cd /startdir - # Keep PKGBUILD writable for pkgver() + # XXX: Keep PKGBUILD writable for pkgver() rm PKGBUILD* cp /startdir_host/PKGBUILD* . chown nobody PKGBUILD* -- cgit v1.2.3-70-g09d2 From 7a3f524201f1fe2ec1ba851f595e86aa4a4b8f51 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Thu, 9 May 2013 02:29:52 +0200 Subject: makechrootpkg: Add hack for svn sources and makepkg 4.1.1 --- makechrootpkg.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/makechrootpkg.in b/makechrootpkg.in index dbe705e..d7d3ecf 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -276,6 +276,17 @@ _chrootbuild() { ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* + # XXX: Keep svn sources writable + # Since makepkg 4.1.1 they get checked out via cp -a, copying the symlink + for dir in /srcdest /startdir; do + cd $dir + for svndir in */.svn; do + rm ${svndir%/.svn} + cp -a ${dir}_host/${svndir%/.svn} . + chown -R nobody ${svndir%/.svn} + done + done + cd /startdir # XXX: Keep PKGBUILD writable for pkgver() -- cgit v1.2.3-70-g09d2 From c3bb10046bf7633d4da6a7f304c29ab100450994 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Fri, 10 May 2013 05:49:01 +0200 Subject: crossrepomove: copy packages locally Nymeria's HTTP mirror is now password-protected and crossrepomove broke. --- crossrepomove.in | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/crossrepomove.in b/crossrepomove.in index b1204af..1d4ae6c 100644 --- a/crossrepomove.in +++ b/crossrepomove.in @@ -30,7 +30,6 @@ case $scriptname in esac server='nymeria.archlinux.org' -mirror="http://${server}" source_svn="svn+ssh://svn-${source_name}@${server}/srv/repos/svn-${source_name}/svn" target_svn="svn+ssh://svn-${target_name}@${server}/srv/repos/svn-${target_name}/svn" source_dbscripts="/srv/repos/svn-${source_name}/dbscripts" @@ -55,10 +54,8 @@ for _arch in ${arch[@]}; do fi for _pkgname in ${pkgname[@]}; do fullver=$(get_full_version $_pkgname) - # FIXME: this only works with .xz packages - ssh "${server}" "cd staging/${target_repo} - curl -O ${mirror}/${source_repo}/os/${repo_arch}/$_pkgname-$fullver-${_arch}.pkg.tar.xz - curl -O ${mirror}/${source_repo}/os/${repo_arch}/$_pkgname-$fullver-${_arch}.pkg.tar.xz.sig" || die + pkgpath="/srv/ftp/$source_repo/os/$repo_arch/$_pkgname-$fullver-${_arch}.pkg.tar.*" + ssh "$server" "cp $pkgpath staging/$target_repo" || die done done -- cgit v1.2.3-70-g09d2 From e26fddb608ec5c4727e60afbdb4211daaf91c01a Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Sat, 25 May 2013 22:17:30 +0200 Subject: Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e5e29ed..1e92b82 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ rebuildpkgs zsh_completion find-libdeps crossrepomove +arch-nspawn -- cgit v1.2.3-70-g09d2 From 6006783cbcd071bf72a1d39eddb6021fbdf70428 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 25 May 2013 22:39:11 +0200 Subject: Move all scripts from sbin to bin directories --- Makefile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index d73682a..77f0e0e 100644 --- a/Makefile +++ b/Makefile @@ -13,9 +13,7 @@ BINPROGS = \ finddeps \ rebuildpkgs \ find-libdeps \ - crossrepomove - -SBINPROGS = \ + crossrepomove\ arch-nspawn \ mkarchroot \ makechrootpkg @@ -69,7 +67,7 @@ BASHCOMPLETION_LINKS = \ archco \ communityco -all: $(BINPROGS) $(SBINPROGS) bash_completion zsh_completion +all: $(BINPROGS) bash_completion zsh_completion edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g" @@ -81,14 +79,12 @@ edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g" @chmod +x "$@" clean: - rm -f $(BINPROGS) $(SBINPROGS) bash_completion zsh_completion + rm -f $(BINPROGS) bash_completion zsh_completion install: install -dm0755 $(DESTDIR)$(PREFIX)/bin - install -dm0755 $(DESTDIR)$(PREFIX)/sbin install -dm0755 $(DESTDIR)$(PREFIX)/share/devtools install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin - install -m0755 ${SBINPROGS} $(DESTDIR)$(PREFIX)/sbin install -m0644 ${CONFIGFILES} $(DESTDIR)$(PREFIX)/share/devtools for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)$(PREFIX)/bin/$$l; done for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)$(PREFIX)/bin/$$l; done @@ -101,7 +97,6 @@ install: uninstall: for f in ${BINPROGS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done - for f in ${SBINPROGS}; do rm -f $(DESTDIR)$(PREFIX)/sbin/$$f; done for f in ${CONFIGFILES}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/$$f; done for l in ${COMMITPKG_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done for l in ${ARCHBUILD_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done -- cgit v1.2.3-70-g09d2 From 8c4553f68cb1c01b24f4883db0032f646b2e77dd Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 25 May 2013 22:39:46 +0200 Subject: prepare new release --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 77f0e0e..674d656 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -V=20130408 +V=20130525 PREFIX = /usr/local -- cgit v1.2.3-70-g09d2