summaryrefslogtreecommitdiff
path: root/src/chroot-tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/chroot-tools')
-rwxr-xr-xsrc/chroot-tools/librechroot52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot
index cb74f98..e6b3a3a 100755
--- a/src/chroot-tools/librechroot
+++ b/src/chroot-tools/librechroot
@@ -357,36 +357,36 @@ main() {
lock 9 "$copydir.lock" \
"Waiting for existing lock on chroot copy to be released: [%s]" "$COPY"
- if ! check_mountpoint "$copydir.lock"; then
- error "Chroot copy is mounted with nosuid or noexec options: [%s]" "$COPY"
- return 1
- fi
-
- if [[ ! -d $rootdir ]]; then
- msg "Creating 'root' copy for chroot [%s]" "$CHROOT"
- mkarchroot "$rootdir" base-devel
- make_empty_repo "$rootdir"
- fi
+ if [[ $mode != delete ]]; then
+ if ! check_mountpoint "$copydir.lock"; then
+ error "Chroot copy is mounted with nosuid or noexec options: [%s]" "$COPY"
+ return 1
+ fi
- if [[ ! -d $copydir ]] || [[ $mode == sync ]]; then
- msg "Syncing copy [%s] with root copy" "$COPY"
- _makechrootpkg sync_chroot "$CHROOTDIR/$CHROOT" "$COPY"
- fi
+ if [[ ! -d $rootdir ]]; then
+ msg "Creating 'root' copy for chroot [%s]" "$CHROOT"
+ mkarchroot "$rootdir" base-devel
+ make_empty_repo "$rootdir"
+ fi
- # Note: the in-chroot pkgconfdir is non-configurable, this is
- # intentionally hard-coded.
- mkdir -p "$copydir/etc/libretools.d"
- {
- if [[ ${#CHROOTEXTRAPKG[*]} -eq 0 ]]; then
- echo 'CHROOTEXTRAPKG=()'
- else
- printf 'CHROOTEXTRAPKG=('
- printf '%q ' "${CHROOTEXTRAPKG[@]}"
- printf ')\n'
+ if [[ ! -d $copydir ]] || [[ $mode == sync ]]; then
+ msg "Syncing copy [%s] with root copy" "$COPY"
+ _makechrootpkg sync_chroot "$CHROOTDIR/$CHROOT" "$COPY"
fi
- } > "$copydir"/etc/libretools.d/chroot.conf
- if [[ $mode != delete ]]; then
+ # Note: the in-chroot pkgconfdir is non-configurable, this is
+ # intentionally hard-coded.
+ mkdir -p "$copydir/etc/libretools.d"
+ {
+ if [[ ${#CHROOTEXTRAPKG[*]} -eq 0 ]]; then
+ echo 'CHROOTEXTRAPKG=()'
+ else
+ printf 'CHROOTEXTRAPKG=('
+ printf '%q ' "${CHROOTEXTRAPKG[@]}"
+ printf ')\n'
+ fi
+ } > "$copydir"/etc/libretools.d/chroot.conf
+
# "touch" the chroot first
# this will
# - overwrite '/etc/pacman.d/mirrorlist'"