SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello All , As mentioned in the subject line this is one more attempt to educate myself & keep my CRON Script in line with newer options showing up in slackpkg .
Please no mentions that slackpkg shouldn't be run as a cron script it is and for the forseeable future will have to remain so .
One beef is that even with , -batch=on & -default_answer=y , I still get the 'Select what you want file-by-file' options floating around in the output . Which My script in its present form is unable to direct slackpkg to do what I wish to have happen .
ALSO Please note the wonderful escape codes plunked into output shown below .
My hopes are to ...
1 ) Not have the escape output from a manually run command when I am usung -batch=on
2 ) A way of Keeping the previous *.conf files unchanged .
3 ) A way of getting a DIFF in the output from the cron run . Hopefully using slackpkg's selection of diff .
ie: ...
Code:
Select what you want file-by-file
/etc/bluetooth/input.conf.new - ^[7(K)eep
^[8(O)verwrite
^[8(R)emove
^[8(D)iff
^[8(M)erge
^[8(V)imdiff
^[8K
Please note the bash script that is in use is attached .
NS4-do-slackpkg-for-updates.sh.txt
as well as an output file ...
cron_do-slackpkg-for-updates.sh_of_20231221012133.txt
One beef is that even with , -batch=on & -default_answer=y , I still get the 'Select what you want file-by-file' options floating around in the output .
ALSO Please note the wonderful escape codes plunked into output shown below .
My hopes are to ...
1 ) Not have the escape output from a manually run command when I am usung -batch=on
2 ) A way of Keeping the previous *.conf files unchanged .
I added a cronjob to simply run '/usr/sbin/slackpkg -batch=on -default_answer=y new-config'. I did not get escape codes nor 'Select what you want file-by-file'. This is the mail message crond sent me:
Code:
Searching for NEW configuration files...
Some packages had new configuration files installed (2 new files):
/etc/a2ps.cfg.new
/etc/a2ps-site.cfg.new
What do you want (K/O/R/P)?
(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
(R)emove all .new files
(P)rompt K, O, R selection for every single file
y
OK! Your choice is nothing! slackpkg will Keep the old files for you to deal with later
Last edited by Petri Kaukasoina; 02-03-2024 at 08:55 AM.
Your run of 'slackpkg -batch=on -default_answer=y new-config' selected P for (P)rompt K, O, R selection for every single file. Mine did not.
OK, let's look at /usr/libexec/slackpkg/functions.d/post-functions.sh:
Code:
140 # if there is a /etc/slackpkg/post-functions.conf file, it will be
141 # used to take the pre-defined action to each file specified there.
142 if [ -f /etc/slackpkg/post-functions.conf ]; then
143 NEWCONFIG="/etc/slackpkg/post-functions.conf"
144 fi
...
254 if [ "${BATCH}" = "on" ] && [ -n "${NEWCONFIG}" ]; then
255 ANSWER=P
256
257 # This allows to have a default behaviour for all .new files in batch mode.
258 DEF_AUTOANSWER="$(sed -ne 's#^default:\([ORK]\)#\1#p' $NEWCONFIG 2>/dev/null)"
259 fi
You must have created file /etc/slackpkg/post-functions.conf to select actions for different .new files. It does not exist originally. What does it contain? Try to rename it. There is only a sample file /etc/slackpkg/post-functions.conf-sample here.
@Petri Kaukasoina ,
As re: #7 , Yes indeed that file existed and contained (*) , It was placed there as a test iirc , I've renamed it . Next update will see what happens then & report back . But iirc without that my script never ends and/or leaves alot of lost bits lying about .
As re: #5 , And WHY that update to slackpkg Doesn't seem to be affective in my installation of slackpkg is a quandry for me (**) & (***) .
As re: #8 , I could run a diff as a further function of my script , Tho was hoping to leverage slackpkg's than to duplicate the work .
@dchmelik , The intent is to update all packages that have been installed .
(*)
Code:
blacklist
# You can list here the .new files and the default action
# to do for each file. The list format is:
#
# /full/path/of/dot/new/file.new:action
#
# The action can be:
#
# O to Overwrite it with the new version
# R to Remove the new file
# K to Keep the current and the .new files
#
# Using "default" as file name, you'll set the action for
# the .new files in batch mode. The action for each file
# takes precedence over the "default" one.
#
# E.g:
#/etc/slackpkg/mirrors.new:K
#/etc/ntp.conf.new:R
#
#
#default:O
default:K
(**)
Code:
# slackpkg -h
-h: Unknown option.
slackpkg - version 15.0.10
(***)
Code:
Mon Jan 17 22:44:42 UTC 2022
Things haven't quite settled down yet with more bugfixes and a couple of safe
upgrades, so not today folks. But enjoy Slackware's half-birthday anyway! ;-)
ap/slackpkg-15.0.10-noarch-1.txz: Upgraded.
Fix mirrors.ucr.ac.cr link address (Emmet Ford)
Remove wroc.pl mirrors (Emmet Ford)
Remove kddilabs.jp from mirrors (Emmet Ford)
Unattended usage improvements (PiterPUNK)
Create file to flag if the system needs restart (PiterPUNK)
Thanks to Robby Workman.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.