diff options
Diffstat (limited to 'files')
-rw-r--r-- | files/post-functions.sh | 13 | ||||
-rw-r--r-- | files/slackpkg | 8 | ||||
-rw-r--r-- | files/slackpkg.conf.5 | 15 | ||||
-rw-r--r-- | files/slackpkg.conf.new | 4 |
4 files changed, 34 insertions, 6 deletions
diff --git a/files/post-functions.sh b/files/post-functions.sh index b3beac8..ca61b2d 100644 --- a/files/post-functions.sh +++ b/files/post-functions.sh @@ -47,7 +47,7 @@ mergenew() { ;; I|i) if [ -f "${FULLNAME}.smerge" ]; then - if [ -e "${FULLNAME}" ]; then + if [ -e "${FULLNAME}" ] && [ "$ORIG_BACKUPS" != "off" ]; then mv "${FULLNAME}" "${FULLNAME}.orig" fi mv "${FULLNAME}.smerge" "${FULLNAME}" @@ -101,7 +101,7 @@ overold() { FILEPATH=$(dirname $i) FULLNAME="${FILEPATH}/${BASENAME}" - if [ -e ${FULLNAME} ]; then + if [ -e ${FULLNAME} ] && [ "$ORIG_BACKUPS" != "off" ]; then mv ${FULLNAME} ${FULLNAME}.orig fi mv ${FULLNAME}.new ${FULLNAME} @@ -141,15 +141,16 @@ looknew() { -not -name "shadow.new" \ -not -name "gshadow.new" 2>/dev/null | sort 2>/dev/null) if [ "$FILES" != "" ]; then - echo -e "\n\ + echo -ne "\n\ Some packages had new configuration files installed. You have four choices: (K)eep the old files and consider .new files later - (O)verwrite all old files with the new ones. The - old files will be stored with the suffix .orig - + (O)verwrite all old files with the new ones" + [ "$ORIG_BACKUPS" != "off" ] && echo -ne ". The + old files will be stored with the suffix .orig" + echo -e "\n\n\ (R)emove all .new files (P)rompt K, O, R selection for every single file diff --git a/files/slackpkg b/files/slackpkg index 6786493..52f8c9b 100644 --- a/files/slackpkg +++ b/files/slackpkg @@ -178,6 +178,14 @@ while [ -n "$1" ] ; do ONLY_NEW_DOTNEW=off shift ;; + -orig_backups=on) + ORIG_BACKUPS=on + shift + ;; + -orig_backups=off) + ORIG_BACKUPS=off + shift + ;; -use_includes=on) USE_INCLUDES=on shift diff --git a/files/slackpkg.conf.5 b/files/slackpkg.conf.5 index 5af259a..10c9576 100644 --- a/files/slackpkg.conf.5 +++ b/files/slackpkg.conf.5 @@ -211,6 +211,21 @@ is "off". Only change this if you know what are you doing... From command line, you can use -only_new_dotnew=value. .TP 5 +.B ORIG_BACKUPS +.br +During integration of .new files during the post installation phase, original +files are backed up to a file name with a .orig extension. To prevent this, +set this option to "off" and note that you will no longer have a copy of the +content of the file prior to it being replaced by the .new version. + +The default value of +.B ORIG_BACKUPS +is "on". Only change this if you are sure you don't want backups of +overwritten files. +.br +From the command line, you can use -orig_backups=value. + +.TP 5 .B ONOFF .br The diff --git a/files/slackpkg.conf.new b/files/slackpkg.conf.new index 9eae0ab..4c15538 100644 --- a/files/slackpkg.conf.new +++ b/files/slackpkg.conf.new @@ -109,6 +109,10 @@ POSTINST=on # Default=off ONLY_NEW_DOTNEW=off +# Whether to backup files overwritten by their .new counterparts with a +# .orig extension. +ORIG_BACKUPS=on + # The ONOFF variable sets the initial behavior of the dialog interface. # If you set this to "on" then all packages will be selected by default. # If you prefer the opposite option (all unchecked), then set this to "off". |