From 9974309cee341fd2e6638924a4918e332c67348e Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 20 Oct 2013 16:17:43 -0400 Subject: makechrootpkg: Look harder for -R argument We shouldn't be in the business of reparsing makepkg's arguments, but since we have to treat the case of repackaging separately, do a better job of trying to find signs of it happening. This change lets you pass the longopt, --repackage, or multiple shortopts such as -RA, and still get the intended effect. Signed-off-by: Dave Reisner Signed-off-by: Pierre Schmitz --- makechrootpkg.in | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'makechrootpkg.in') diff --git a/makechrootpkg.in b/makechrootpkg.in index 8c64ae1..00e538a 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -104,11 +104,13 @@ fi makepkg_args="$makepkg_args ${*:$OPTIND}" # See if -R was passed to makepkg -for arg in ${*:$OPTIND}; do - if [[ $arg = -R ]]; then - repack=true - break - fi +for arg in "${@:OPTIND}"; do + case ${arg%%=*} in + -*R*|--repackage) + repack=true + break 2 + ;; + esac done if [[ -n $SUDO_USER ]]; then -- cgit v1.2.3-70-g09d2 From 59e348fc3c5dd086331d884a6dd76fb43a92b7eb Mon Sep 17 00:00:00 2001 From: WorMzy Tykashi Date: Mon, 16 Sep 2013 00:35:37 +0100 Subject: Add mountpoint check to btrfs subvol logic Signed-off-by: Pierre Schmitz --- makechrootpkg.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makechrootpkg.in') diff --git a/makechrootpkg.in b/makechrootpkg.in index 00e538a..2309be2 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -142,7 +142,7 @@ create_chroot() { slock 8 "$chrootdir/root.lock" "Locking clean chroot" stat_busy "Creating clean working copy [$copy]" - if [[ "$chroottype" == btrfs ]]; then + if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; then if [[ -d $copydir ]]; then btrfs subvolume delete "$copydir" >/dev/null || die "Unable to delete subvolume %s" "$copydir" -- cgit v1.2.3-70-g09d2 From 4b3a6c7803d70e131e23842e2957fc81bf35f289 Mon Sep 17 00:00:00 2001 From: Maxime Gauduin Date: Mon, 26 Aug 2013 00:56:58 +0200 Subject: Add support for building bzr packages Fixes FS#36654: https://bugs.archlinux.org/task/36654. Signed-off-by: Maxime Gauduin Signed-off-by: Pierre Schmitz --- makechrootpkg.in | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'makechrootpkg.in') diff --git a/makechrootpkg.in b/makechrootpkg.in index 2309be2..a6123be 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -287,14 +287,16 @@ _chrootbuild() { ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* - # XXX: Keep svn sources writable + # XXX: Keep bzr and 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} + for vcs in bzr svn; do + cd "$dir" + for vcsdir in */.$vcs; do + rm "${vcsdir%/.$vcs}" + cp -a "${dir}_host/${vcsdir%/.$vcs}" . + chown -R nobody "${vcsdir%/.$vcs}" + done done done -- cgit v1.2.3-70-g09d2 From 8ce6e29add2d6bf40df302a24a17ccad15875c08 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Wed, 6 Nov 2013 14:58:39 +0100 Subject: makechrootpkg: Don't copy the logpipe Signed-off-by: Pierre Schmitz --- makechrootpkg.in | 1 + 1 file changed, 1 insertion(+) (limited to 'makechrootpkg.in') diff --git a/makechrootpkg.in b/makechrootpkg.in index a6123be..f5238a4 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -333,6 +333,7 @@ move_products() { done for l in "$copydir"/logdest/*; do + [[ $l == */logpipe.* ]] && continue chown "$src_owner" "$l" mv "$l" "$LOGDEST" done -- cgit v1.2.3-70-g09d2 From fd1be1b27a4b9639f16cddfc9720d6efcfbba909 Mon Sep 17 00:00:00 2001 From: "Markus M. May" Date: Wed, 6 Nov 2013 18:56:50 +0100 Subject: FS#37656 - [devtools] add SRCPKGDEST to makechrootpkg Signed-off-by: Markus M. May Signed-off-by: Pierre Schmitz --- makechrootpkg.in | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'makechrootpkg.in') diff --git a/makechrootpkg.in b/makechrootpkg.in index f5238a4..d03b703 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -125,7 +125,7 @@ load_vars() { [[ -f $makepkg_conf ]] || return 1 - for var in {SRC,PKG,LOG}DEST MAKEFLAGS PACKAGER; do + for var in {SRC,SRCPKG,PKG,LOG}DEST MAKEFLAGS PACKAGER; do [[ -z ${!var} ]] && eval $(grep "^${var}=" "$makepkg_conf") done @@ -214,6 +214,11 @@ prepare_chroot() { echo 'PKGDEST="/pkgdest"' >> "$copydir/etc/makepkg.conf" fi + mkdir -p "$copydir/srcpkgdest" + if ! grep -q 'SRCPKGDEST="/srcpkgdest"' "$copydir/etc/makepkg.conf"; then + echo 'SRCPKGDEST="/srcpkgdest"' >> "$copydir/etc/makepkg.conf" + fi + mkdir -p "$copydir/logdest" if ! grep -q 'LOGDEST="/logdest"' "$copydir/etc/makepkg.conf"; then echo 'LOGDEST="/logdest"' >> "$copydir/etc/makepkg.conf" @@ -227,7 +232,7 @@ prepare_chroot() { echo 'SRCDEST="/srcdest"' >> "$copydir/etc/makepkg.conf" fi - chown -R nobody "$copydir"/{build,pkgdest,logdest,srcdest,startdir} + chown -R nobody "$copydir"/{build,pkgdest,srcpkgdest,logdest,srcdest,startdir} if [[ -n $MAKEFLAGS ]]; then sed -i '/^MAKEFLAGS=/d' "$copydir/etc/makepkg.conf" @@ -337,6 +342,11 @@ move_products() { chown "$src_owner" "$l" mv "$l" "$LOGDEST" done + + for s in "$copydir"/srcpkgdest/*; do + chown "$src_owner" "$s" + mv "$s" "$SRCPKGDEST" + done } # }}} @@ -346,9 +356,10 @@ load_vars "$USER_HOME/.makepkg.conf" load_vars /etc/makepkg.conf # Use PKGBUILD directory if these don't exist -[[ -d $PKGDEST ]] || PKGDEST=$PWD -[[ -d $SRCDEST ]] || SRCDEST=$PWD -[[ -d $LOGDEST ]] || LOGDEST=$PWD +[[ -d $PKGDEST ]] || PKGDEST=$PWD +[[ -d $SRCDEST ]] || SRCDEST=$PWD +[[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD +[[ -d $LOGDEST ]] || LOGDEST=$PWD create_chroot -- cgit v1.2.3-70-g09d2