diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2021-03-11 00:41:29 -0500 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2021-07-26 19:20:09 -0400 |
commit | 82067ca0ff8a33f03f845b9033da4bebfe054bf8 (patch) | |
tree | ab9f9516cccc56d71ff8fcdf8eb26a50ee3098a3 /src/chroot-tools/libremakepkg | |
parent | f7b539224b4ddf45cbd3fe4013bdeb58a762fdfd (diff) |
add -I option to guard/allow insane base-packages<->db sync
Diffstat (limited to 'src/chroot-tools/libremakepkg')
-rwxr-xr-x | src/chroot-tools/libremakepkg | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 14ec0ff..3718166 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -36,6 +36,7 @@ umask 0022 # Global variables: readonly _indent="$(librelib chroot/indent)" readonly INCHROOT=$([[ -f /.arch-chroot ]] && echo true || echo false) +SANE=true # can be changed with the -I flag NONET=true # can be changed with the -N flag # {PKG,SRC,SRCPKG,LOG}DEST set at runtime by makepkg.conf # MAKEFLAGS, PACKAGER set at runtime by makepkg.conf @@ -134,6 +135,7 @@ build() ( $NONET || run_nnet=("${run_ynet[@]}") prepare_chroot "$copydir" "$LIBREHOME" "$repack" false + run_hook pre_build "$copydir" trap "run_hook post_build ${copydir@Q}; rm -rf -- ${startdir@Q}" EXIT "${run_nnet[@]}" /chrootbuild "${makepkg_args[@]}" </dev/null |& indent @@ -170,13 +172,21 @@ usage() { environment variables for {SRC,SRCPKG,PKG,LOG}DEST, MAKEFLAGS and PACKAGER override the settings in makepkg.conf(5).' echo - prose 'The `-n` and `-l` options behave identically to librechroot (see - the librechroot documentation).' + 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' \ - "-w <${mount_msg}>" 'Bind mount a file or directory, read/write' \ + flag 'Options (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. + 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. + 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' \ "-r <${mount_msg}>" 'Bind mount a file or directory, read-only' flag 'Options (libremakepkg):' \ '-N' "Don't disable networking during prepare(), @@ -204,11 +214,12 @@ main() { local srcpkg='' # Parse command line options ########################################### - while getopts 'n:l:w:r:NRS:h' flag ; do + while getopts 'n:l:w:r:INRS:h' flag ; do case "${flag}" in n ) chroot=$OPTARG ; ! $INCHROOT || err_chflag "$flag";; l ) copy=$OPTARG ; ! $INCHROOT || err_chflag "$flag";; w|r) librechroot_flags+=(-$flag "$OPTARG") ; ! $INCHROOT || err_chflag "$flag";; + I ) SANE=false;; N ) NONET=false;; R ) repack=true; makepkg_args+=(-R);; S ) srcpkg='';; # srcpkg=$OPTARG;; TODO: not yet implemented |