diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2024-01-01 14:31:19 -0500 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2024-01-04 16:09:58 -0500 |
commit | 5cb88331ead03f9c48dbf5d7b82b3b71c58370b0 (patch) | |
tree | 9b4ca0dfb3a4db3694a9f98f53607d51541452fd | |
parent | 221a441838785dda3f58a11bb05221be43c71649 (diff) |
complete -I (SANE) insane option
-rwxr-xr-x | src/chroot-tools/librechroot | 46 | ||||
-rwxr-xr-x | src/chroot-tools/libremakepkg | 31 |
2 files changed, 43 insertions, 34 deletions
diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index abaa888..6236480 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -338,22 +338,30 @@ usage() { prose "If none of the \`%s\`, \`%s\`, or \`%s\` options are given, the chroot architecture will be that of the host." -A -C -M echo - flag 'Options:' \ - "-n <$(_ NAME)>" "Name of the chroot to use" \ - "-l <$(_ COPY)>" "Name of, or absolute path to, the copy to use" \ - "-i <$(_ INIT)>" "Specify the init-system to install, one of: \ - [ systemd non-systemd ] (default: systemd)" \ + flag 'Options:' \ + "-n <$(_ NAME)>" "Name of the chroot to use" \ + "-l <$(_ COPY)>" "Name of, or absolute path to, the copy to use" \ + "-i <$(_ INIT)>" "Specify the init-system to install, one of: \ + [ systemd non-systemd ] (default: systemd)" \ "-C <$(_ FILE)>" "Copy this file to chroot as: %s - This option is mutually exclusive with \`%s\`." \ - /etc/pacman.conf -A \ + This option is mutually exclusive with \`%s\`." \ + /etc/pacman.conf -A \ "-M <$(_ FILE)>" "Copy this file to chroot as: %s - This option is mutually exclusive with \`%s\`." \ - /etc/makepkg.conf -A \ + This option is mutually exclusive with \`%s\`." \ + /etc/makepkg.conf -A \ "-A <$(_ CARCH)>" "Specify the architecture of a new '%s' seed. - This option is mutually exclusive with %s and %s." \ + This option is mutually exclusive with %s and %s." \ root -C -M - "-N" "Disable networking in the chroot" \ - "-w <${mount_msg}>" "Bind mount a file or directory, read/write" \ + '-I' "Allow packages older than their database entries to remain + installed, after updating the database manually. + This option can lead to an insane system configuration. + Replacement packages will still be applied, for example, + unless they are help back explicitly; and there may be + dependency conflicts or shared library mismatches. + Use this only in extreme circumstances; such as if you + need to enable [testing] without synchronizing afterward." \ + "-N" "Disable networking in the chroot" \ + "-w <${mount_msg}>" "Bind mount a file or directory, read/write" \ "-r <${mount_msg}>" "Bind mount a file or directory, read-only" echo flag "Commands (create/copy/delete):" \ @@ -395,6 +403,7 @@ ExitInvalidArgument() # Globals: $CHROOTDIR, $CHROOT, $COPY, $rootdir and $copydir main() { COPY=$( [[ $LIBREUSER == root ]] && echo copy || echo "$LIBREUSER" ) + SANE=true declare -i was_conf_error=0 load_conf chroot.conf CHROOTDIR CHROOT || was_conf_error=$? @@ -417,7 +426,7 @@ main() { ## parse CLI options ## - while getopts 'n:l:i:C:M:A:Nw:r:' opt; do + while getopts 'n:l:i:C:M:A:INw:r:' opt; do case $opt in n) CHROOT=$OPTARG ;; l) COPY=$OPTARG ;; @@ -429,6 +438,7 @@ main() { def_pacmanconf="${PACMAN_DEFS_DIR}"/pacman.conf.${target_arch} def_makepkgconf="${PACMAN_DEFS_DIR}"/makepkg.conf.${target_arch} seed_pacmanconf="${tmp_pacmanconf}" ; use_tmp_pacmanconf=1 ; ;; + I) SANE=false ;; N) ChrootRunFlags+=( -N ) ;; w) ChrootRunFlags+=(-b "-B:$OPTARG") ;; r) ChrootRunFlags+=(-b "-Br:$OPTARG") ;; @@ -449,7 +459,7 @@ main() { fi eval "$(calculate_directories)" - readonly CHROOTDIR CHROOT COPY + readonly CHROOTDIR CHROOT COPY SANE readonly rootdir copydir readonly mode @@ -667,10 +677,10 @@ main() { clean-pkgs) trap "rm -f -- ${copydir@Q}{$CHCLEANUP_FILE,$CHROOTEXEC_FILE}" EXIT install -m755 "$(librelib chroot/chcleanup)" "$copydir"$CHCLEANUP_FILE - printf '%s\n' '#!/bin/bash' '' \ - 'mkdir -p /startdir' \ - 'cd /startdir' \ - '/chcleanup' > "$copydir"$CHROOTEXEC_FILE + printf '%s\n' '#!/bin/bash' '' \ + 'mkdir -p /startdir' \ + 'cd /startdir' \ + "SANE=$SANE /chcleanup" > "$copydir"$CHROOTEXEC_FILE chmod 755 "$copydir"$CHROOTEXEC_FILE chroot-run "$copydir"$CHROOTEXEC_FILE < /dev/null ;; diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index b3f51ec..e2ccfc6 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -178,27 +178,26 @@ usage() { prose 'The `-n` and `-l` options are passed to `librechroot` (see the librechroot documentation).' echo - flag 'Options (librechroot):' \ - "-n <$(_ NAME)>" 'Name of the chroot to use' \ - "-l <$(_ COPY)>" 'Name of, or absolute path to, the chroot copy to use' \ + flag 'Options:' \ + '-R' 'Repackage contents of the package without rebuilding' \ + "-S <$(_ FILE)>" 'Use an existing --allsource source-ball (not yet implemented)' \ + '-h' 'Show this message' + flag 'Options (passed to librechroot):' \ + "-n <$(_ NAME)>" 'Name of the chroot to use' \ + "-l <$(_ COPY)>" 'Name of, or absolute path to, the chroot copy to use' \ '-I' "Allow packages older than their database entries to remain installed, after updating the database manually. - This option can lead to an insane system configuaration. + This option can lead to an insane system configuration. Replacement packages will still be applied, for example, - unless they are helpd back explcitly; and there may be - dependency conflicts or shared library mis-matches. + unless they are held back explicitly; and there may be + dependency conflicts or shared library mismatches. Use this only in extreme circumstances; such as if you - need to enable [testing] without synchronizing afterward." \ - "-w <${mount_msg}>" 'Bind mount a file or directory, read/write' \ + need to enable [testing] without synchronizing afterward." \ + '-N' "Enable networking during prepare(), build(), and package(). + DO NOT use this to build for Parabola repositories. + Its use is a violation of Parabola policy." \ + "-w <${mount_msg}>" 'Bind mount a file or directory, read/write' \ "-r <${mount_msg}>" 'Bind mount a file or directory, read-only' - flag 'Options (libremakepkg):' \ - '-N' "Allow networking during prepare(), build(), and package(). - DO NOT use this to build for Parabola repositories. - Its use is a violation of Parabola policy." \ - '-R' 'Repackage contents of the package without rebuilding' \ - "-S <$(_ FILE)>" 'Use an existing --allsource source-package - (not-yet-implemented)' \ - '-h' 'Show this message' } # Convenience method for use in option parsing |