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-02-19 14:21:29 -0500 |
commit | b62905e1e74648d51edcbfba7bc700aeda0e9808 (patch) | |
tree | 544e2fe958ae3803860870fa0816edf629975e5f /mkarchroot.in | |
parent | a4dded46e753923d82e54225e8462d4637003a7c (diff) |
-rw-r--r-- | mkarchroot.in | 11 |
diff --git a/mkarchroot.in b/mkarchroot.in index 656c74e..8499ed1 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -16,23 +16,27 @@ CHROOT_VERSION='v3' 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 } orig_argv=("$@") -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 @@ -70,6 +74,11 @@ if [[ $(stat -f -c %T "$working_dir") == btrfs ]]; 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' |