index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2024-08-16 08:06:08 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2024-08-16 08:06:08 +0200 |
commit | deffc1b87e86fffa8e4758a76a1912c6c8f69a85 (patch) | |
tree | 0f61a152c4c49d40de5042df2b25cdb8e0b0a82d /src/mkarchroot.in | |
parent | 2994bca96781afd62104c1515532a9c479cb5bed (diff) | |
parent | 27eebe383d0b571c08cba991e4824768d7623602 (diff) |
-rw-r--r-- | src/mkarchroot.in | 21 |
diff --git a/src/mkarchroot.in b/src/mkarchroot.in index 2abe001..c59c26c 100644 --- a/src/mkarchroot.in +++ b/src/mkarchroot.in @@ -22,13 +22,14 @@ nspawn_args=() usage() { echo "Usage: ${0##*/} [options] working-dir package-list..." echo ' options:' - echo ' -U Use pacman -U to install packages' - 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 ' -s Do not run setarch' - echo ' -h This message' + echo ' -U Use pacman -U to install packages' + 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 <src>[:<dst>] Copy src file from the host to the chroot.' + echo ' If dst file is not provided, it defaults to src' + echo ' -s Do not run setarch' + echo ' -h This message' exit 1 } @@ -84,8 +85,10 @@ if is_btrfs "$working_dir"; then fi for file in "${files[@]}"; do - mkdir -p "$(dirname "$working_dir$file")" - cp "$file" "$working_dir$file" + src="${file%%:*}" + dst="${file#*:}" + mkdir -p "$(dirname "$working_dir$dst")" + cp "$src" "$working_dir$dst" done unshare --mount pacstrap -${umode}Mc ${pac_conf:+-C "$pac_conf"} "$working_dir" \ |