From 7b94ba7b0e9974e4bdb6b5005d21d2d360a44b0d Mon Sep 17 00:00:00 2001 From: jmmv Date: Fri, 24 Jan 2003 09:41:27 +0000 Subject: Update pkg_comp to 1.6: - Allow the user to issue any command inside the chroot environment using the "chroot" target, instead of only running ROOTSHELL. Patch provided by seb. --- pkgtools/pkg_comp/Makefile | 4 ++-- pkgtools/pkg_comp/files/pkg_comp.8 | 7 +++++-- pkgtools/pkg_comp/files/pkg_comp.sh | 22 +++++++++++++--------- 3 files changed, 20 insertions(+), 13 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/pkg_comp/Makefile b/pkgtools/pkg_comp/Makefile index 1ccac992205..88e1d461af0 100644 --- a/pkgtools/pkg_comp/Makefile +++ b/pkgtools/pkg_comp/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.6 2003/01/08 17:57:42 jmmv Exp $ +# $NetBSD: Makefile,v 1.7 2003/01/24 09:41:27 jmmv Exp $ -DISTNAME= pkg_comp-1.5 +DISTNAME= pkg_comp-1.6 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkg_comp/files/pkg_comp.8 b/pkgtools/pkg_comp/files/pkg_comp.8 index 58fc5c84d7e..f7ac5f350cf 100644 --- a/pkgtools/pkg_comp/files/pkg_comp.8 +++ b/pkgtools/pkg_comp/files/pkg_comp.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: pkg_comp.8,v 1.5 2002/12/24 16:28:34 jmmv Exp $ +.\" $NetBSD: pkg_comp.8,v 1.6 2003/01/24 09:41:28 jmmv Exp $ .\" .\" pkg_comp - Build packages inside a clean chroot environment .\" Copyright (c) 2002, Julio Merino @@ -228,7 +228,7 @@ which controls the number of processes using the chroot environment. If some of them crashes unexpectedly and you notice it does not try to unmount the file systems, this status file may get out of sync. -Be sure to check if NO file systems are mounted when issuing a +Be sure to check that NO file systems are mounted when issuing a .Sy removeroot . .Bl -tag -width indent .It REAL_DISTFILES @@ -292,6 +292,9 @@ You must specify the full name of the package and they must be reside inside .Sy REAL_PACKAGES . .It chroot Enters the chroot environment. +If no arguments are given, +.Va ROOTSHELL +is executed, otherwise whatever you typed. .It removepkgs Remove all the packages in the chroot environment. It starts deleting packages with diff --git a/pkgtools/pkg_comp/files/pkg_comp.sh b/pkgtools/pkg_comp/files/pkg_comp.sh index d8215e3d621..4a426742ab5 100644 --- a/pkgtools/pkg_comp/files/pkg_comp.sh +++ b/pkgtools/pkg_comp/files/pkg_comp.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: pkg_comp.sh,v 1.5 2003/01/08 17:57:42 jmmv Exp $ +# $NetBSD: pkg_comp.sh,v 1.6 2003/01/24 09:41:28 jmmv Exp $ # # pkg_comp - Build packages inside a clean chroot environment # Copyright (c) 2002, Julio Merino @@ -456,7 +456,11 @@ pkg_chroot() fsmount echo "PKG_COMP ==> Entering chroot: $DESTDIR" - chroot $DESTDIR $ROOTSHELL + if [ $# -eq 0 ]; then + chroot $DESTDIR $ROOTSHELL + else + chroot $DESTDIR $* + fi echo fsumount } @@ -551,7 +555,7 @@ fi target="$1" shift -pkgnames="$*" +args="$*" readconf() { @@ -607,19 +611,19 @@ case "$target" in build) readconf checkroot - pkg_build $pkgnames + pkg_build $args exit 0 ;; install) readconf checkroot - pkg_install $pkgnames + pkg_install $args exit 0 ;; chroot) readconf checkroot - pkg_chroot + pkg_chroot $args exit 0 ;; removepkgs) @@ -638,13 +642,13 @@ case "$target" in if [ -z "$REAL_PACKAGES" ]; then err "this is useless without REAL_PACKAGES" fi - if [ -z "$MAKE_PACKAGES" -a -z "$pkgnames" ]; then + if [ -z "$MAKE_PACKAGES" -a -z "$args" ]; then err "this is useless without MAKE_PACKAGES nor package names" fi pkg_makeroot checkroot - if [ -n "$pkgnames" ]; then - pkg_build $pkgnames + if [ -n "$args" ]; then + pkg_build $args fi pkg_removeroot ;; -- cgit v1.2.3