From 4c56be5601ebc241f9787b93154f92fdb6f87dd6 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 21 Apr 2008 23:13:47 -0500 Subject: Allow makechrootpkg to install package files in the chroot This is a very very hackish way to deal with rebuilds for right now. The intent is the following: First build foobar-1.2 makechrootpkg -i foobar-1.2-1-i686.pkg.tar.gz Now build packages that depend on foobar-1.2 Signed-off-by: Aaron Griffin --- makechrootpkg | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'makechrootpkg') diff --git a/makechrootpkg b/makechrootpkg index 3050528..a0ee98b 100755 --- a/makechrootpkg +++ b/makechrootpkg @@ -14,6 +14,7 @@ MAKEPKG_ARGS="-sr" REPACK="" WORKDIR=$PWD clean_first="0" +install_pkg="" chrootdir="$CHROOT_SHELL" @@ -45,9 +46,10 @@ usage () exit 1 } -while getopts ':r:h:c' arg; do +while getopts ':r:i:h:c' arg; do case "${arg}" in r) chrootdir="$OPTARG" ;; + i) install_pkg="$OPTARG" ;; c) clean_first=1 ;; h|?) usage ;; *) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;; @@ -114,6 +116,17 @@ fi mount -t unionfs none -o "dirs=$chrootdir/rw=rw:$chrootdir/root=ro" "$uniondir" trap 'cleanup' 0 1 2 15 +if [ -n "$install_pkg" ]; then + pkgname="$(basename "$install_pkg")" + echo "installing '$pkgname' in chroot" + cp "$install_pkg" "$uniondir/$pkgname" + mkarchroot -r "pacman -U /$pkgname" "$uniondir" + ret=$? + rm "$uniondir/$pkgname" + #exit early, we've done all we need to + exit $ret +fi + echo "moving build files to chroot" [ -d "$uniondir/build" ] || mkdir "$uniondir/build" -- cgit v1.2.3-24-g4f1b