summaryrefslogtreecommitdiff
path: root/src/chroot-tools
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-01-18 20:30:08 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-01-18 20:30:08 -0500
commit0fd1e7b1333b8793c1cc448c2a00cb085544cc8c (patch)
tree22e138e30d30918140d0437724f18648fb762b1a /src/chroot-tools
parent27274846fa112b3309a5cebe6afa2753d641a992 (diff)
libremakepkg: support -r and -w flags, same as librechroot
Feature request: https://labs.parabola.nu/issues/458
Diffstat (limited to 'src/chroot-tools')
-rwxr-xr-xsrc/chroot-tools/libremakepkg16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg
index fc6418c..dbeeb81 100755
--- a/src/chroot-tools/libremakepkg
+++ b/src/chroot-tools/libremakepkg
@@ -148,8 +148,12 @@ usage() {
the documentation there.'
echo
print 'Options:'
+ print ' %s options:' librechroot
flag "-n <$(_ CHROOT)>" 'Name of the chroot to use'
flag "-l <$(_ COPY)>" 'Name of, or absolute path to, the chroot copy to use'
+ flag "-w <$(_ 'PATH[:PATH]')>" 'Bind mount a file or directory, read/write'
+ flag "-r <$(_ 'PATH[:PATH]')>" 'Bind mount a file or directory, read-only'
+ print ' %s options:' libremakepkg
flag '-N' "Don't disable networking during build() and
package(). PLEASE don't use this unless you
have a special reason, its use is a violation
@@ -173,10 +177,14 @@ main() {
local chroot=''
# Parse command line options ###########################################
- while getopts 'n:l:NRh' flag ; do
+ while getopts 'n:l:wrNRh' flag ; do
case "${flag}" in
- n) if $INCHROOT; then err_chflag "$flag"; else chroot=$OPTARG; fi;;
- l) if $INCHROOT; then err_chflag "$flag"; else copy=$OPTARG; fi;;
+ n) if $INCHROOT; then err_chflag "$flag"; else
+ chroot=$OPTARG; fi;;
+ l) if $INCHROOT; then err_chflag "$flag"; else
+ copy=$OPTARG; fi;;
+ w|r) if $INCHROOT; then err_chflag "$flag"; else
+ librechroot_flags+=(-$flag "$OPTARG"); fi;;
N) NONET=false;;
R) repack=true; makepkg_args+=(-R);;
h) usage; return 0;;
@@ -226,7 +234,7 @@ main() {
MAKEFLAGS="$(get_var makepkg MAKEFLAGS '')"
PACKAGER="$(get_var makepkg PACKAGER '')"
- librechroot_flags=(
+ librechroot_flags+=(
-r "$PWD:/startdir_host"
-r "$SRCDEST:/srcdest_host"
-n "$CHROOT"