index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
author | Luke Shumaker <lukeshu@parabola.nu> | 2017-02-15 14:37:10 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@parabola.nu> | 2017-04-05 14:42:43 -0400 |
commit | ccb26ff1435a79f13bbed6a0f46d985138eedb75 (patch) | |
tree | 0e020e38f27b5a9ae1f6a9ce53242e9c0ce80398 /mkarchroot.in | |
parent | 05ff74daefaa878a82e82e4b025bb3d8bd23ddf1 (diff) |
-rw-r--r-- | mkarchroot.in | 11 |
diff --git a/mkarchroot.in b/mkarchroot.in index 1265335..4f35c1a 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -15,21 +15,25 @@ m4_include(lib/archroot.sh) working_dir='' +files=() + usage() { echo "Usage: ${0##*/} [options] working-dir package-list..." echo ' options:' echo ' -C <file> Location of a pacman config file' echo ' -M <file> Location of a makepkg config file' echo ' -c <dir> Set pacman cache' + echo ' -f <file> Copy file from the host to the chroot' echo ' -h This message' exit 1 } -while getopts 'hC:M:c:' arg; do +while getopts 'hC:M:c:f:' arg; do case "$arg" in C) pac_conf="$OPTARG" ;; M) makepkg_conf="$OPTARG" ;; c) cache_dir="$OPTARG" ;; + f) files+=("$OPTARG") ;; h|?) usage ;; *) error "invalid argument '%s'" "$arg"; usage ;; esac @@ -67,6 +71,11 @@ if is_btrfs "$working_dir"; then chmod 0755 "$working_dir" fi +for file in "${files[@]}"; do + mkdir -p "$(dirname "$working_dir$file")" + cp "$file" "$working_dir$file" +done + pacstrap -GMcd ${pac_conf:+-C "$pac_conf"} "$working_dir" \ "${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages' |