summaryrefslogtreecommitdiff
path: root/makechrootpkg
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-04-21 23:13:47 -0500
committerAaron Griffin <aaronmgriffin@gmail.com>2008-04-21 23:13:47 -0500
commit4c56be5601ebc241f9787b93154f92fdb6f87dd6 (patch)
treea94bee4154af7f9f1d4ade1c2b1867108a546a5b /makechrootpkg
parent17ecb862f2ce366ee9e3ab7c3cdfc03f93b17dd9 (diff)
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 <aaronmgriffin@gmail.com>
Diffstat (limited to 'makechrootpkg')
-rwxr-xr-xmakechrootpkg15
1 files changed, 14 insertions, 1 deletions
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"