summaryrefslogtreecommitdiff
path: root/makechrootpkg.in
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-05-05 18:40:59 -0400
committerJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2017-07-05 18:21:54 +0200
commit928744cbc457b9b7e89e4b80c136ccbfd1164fb2 (patch)
treea53691db0687bf8ff926b99e12e6ed36d59aa654 /makechrootpkg.in
parent2a9b30ed3594c2dc8c5012fc845572b8d452a9b0 (diff)
downloaddevtools-928744cbc457b9b7e89e4b80c136ccbfd1164fb2.tar.xz
makechrootpkg: sync_chroot: make usage easier to understand.
Also, shorten the "Synchronizing" message to only include the full path to the copy if it was specified. The capslocked variable names in the Usage comment were references to things in Parabola's tools, that didn't make much sense here out of context.
Diffstat (limited to 'makechrootpkg.in')
-rw-r--r--makechrootpkg.in15
1 files changed, 5 insertions, 10 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index 88c2cdc..d92d6ab 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -98,16 +98,11 @@ load_vars() {
return 0
}
-# Usage: sync_chroot $CHROOTDIR/$CHROOT <$CHROOTCOPY|$copydir>
+# Usage: sync_chroot $chrootdir $copydir [$copy]
sync_chroot() {
local chrootdir=$1
- local copy=$2
- local copydir=''
- if [[ ${copy:0:1} = / ]]; then
- copydir=$copy
- else
- copydir="$chrootdir/$copy"
- fi
+ local copydir=$2
+ local copy=${3:-$2}
if [[ "$chrootdir/root" -ef "$copydir" ]]; then
error 'Cannot sync copy with itself: %s' "$copydir"
@@ -119,7 +114,7 @@ sync_chroot() {
slock 8 "$chrootdir/root.lock" \
"Locking clean chroot [%s]" "$chrootdir/root"
- stat_busy "Synchronizing chroot copy [%s] -> [%s]" "$chrootdir/root" "$copydir"
+ stat_busy "Synchronizing chroot copy [%s] -> [%s]" "$chrootdir/root" "$copy"
if is_btrfs "$chrootdir" && ! mountpoint -q "$copydir"; then
subvolume_delete_recursive "$copydir" ||
die "Unable to delete subvolume %s" "$copydir"
@@ -379,7 +374,7 @@ main() {
lock 9 "$copydir.lock" "Locking chroot copy [%s]" "$copy"
if [[ ! -d $copydir ]] || $clean_first; then
- sync_chroot "$chrootdir" "$copy"
+ sync_chroot "$chrootdir" "$copydir" "$copy"
fi
$update_first && arch-nspawn "$copydir" \