LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-23-2019, 01:27 AM   #1
lioh
Member
 
Registered: Aug 2019
Location: Switzerland
Distribution: Slackware
Posts: 194

Rep: Reputation: Disabled
slackpkg default action for .new config files


Hi all,

I would like to know if there is a way to define a default action for .new config files when updating packages with slackpkg? I would like that the old configuration is kept on a regular update and I am not prompted at the end of the update process.

Greetings

Lioh
 
Old 10-23-2019, 06:22 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
From 'man slackpkg.conf'
Quote:
POSTINST
Enables (on) or disables (off) slackpkg's post-installation features, such as checking for new (*.new) configuration files and new kernel images, and prompts you for what it should do.

The default value of POSTINST is "on".
From command line, you can use -postinst=value.
Does it work? I do not know. I have never tried as part of updating is dealing with any incoming .new files.
 
1 members found this post helpful.
Old 10-23-2019, 06:54 AM   #3
lioh
Member
 
Registered: Aug 2019
Location: Switzerland
Distribution: Slackware
Posts: 194

Original Poster
Rep: Reputation: Disabled
Thanks for pointing that out. I have only read man slackpkg not slackpkg.conf.
 
Old 10-23-2019, 10:51 AM   #4
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
I think your asking for trouble with a default action for new configuration files
 
2 members found this post helpful.
Old 10-23-2019, 10:55 AM   #5
khronosschoty
Member
 
Registered: Jul 2008
Distribution: Slackware
Posts: 648
Blog Entries: 2

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Quote:
Originally Posted by colorpurple21859 View Post
I think your asking for trouble with a default action for new configuration files
I second that thought.
 
Old 10-23-2019, 11:21 AM   #6
lioh
Member
 
Registered: Aug 2019
Location: Switzerland
Distribution: Slackware
Posts: 194

Original Poster
Rep: Reputation: Disabled
I just want to keep the old files by default and then check for the new configs afterwards, calm.
 
Old 10-23-2019, 01:17 PM   #7
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
The conservative presumption with Slackware administration is the user decides how to handle config changes. Hence the installation of "dot new" files. The user is expected to compare the new config file with the existing config file and decide what changes to make or accept.

The slackpg prompts can be disabled in /etc/slapckpkg/slackpkg.conf.

To list the "dot new" files:

[sudo] find /etc -name *.new

To provide a basic interface to review *.new files, consider the dotnew package from the Salix repos. The package is compatible with the stock Slackware. Otherwise try:

diff /etc/name_of_config /etc/name_of_config.new

Last edited by upnort; 10-23-2019 at 01:19 PM.
 
Old 10-24-2019, 03:07 AM   #8
lioh
Member
 
Registered: Aug 2019
Location: Switzerland
Distribution: Slackware
Posts: 194

Original Poster
Rep: Reputation: Disabled
Thanks for pointing that out. I am aware of that and my original question was not about the general handling of .new files. I personally use sudo slackpkg new-config for that purpose.
 
Old 10-24-2019, 11:12 PM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by lioh View Post
Thanks for pointing that out. I am aware of that and my original question was not about the general handling of .new files. I personally use sudo slackpkg new-config for that purpose.
In that case, why not set the following to off?

Code:
# Enables (on) or disables (off) slackpkg's post-installation features, such
# as checking for new (*.new) configuration files and new kernel images, and
# prompts you for what it should do.  Default=on
POSTINST=on


I really should read the thread before posting.

Last edited by Richard Cranium; 10-24-2019 at 11:14 PM.
 
Old 10-25-2019, 12:54 AM   #10
Geist
Member
 
Registered: Jul 2013
Distribution: Slackware 14 / current
Posts: 442

Rep: Reputation: 196Reputation: 196
I wish it had a blacklist, I only keep a small number of personalized config files, the rest can just get overwritten.

Not my local and local shutdowns, though, aaaaaahhhhHHhhhhhh, NO I DO NOT WANT AN EMPTY FILE, THANKSSSS.

Last edited by Geist; 10-25-2019 at 05:23 AM.
 
Old 10-30-2019, 12:23 AM   #11
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
From my current recollection, there's no easy way to override built-in functions. However, you could do something like this:

Rename /usr/libexec/slackpkg/functions.d/post-functions.sh to e.g. stock-post-functions.sh, then create a new post-functions.sh that first sources the renamed file and then redefines the looknew() function to do what you want it to do.

A better approach would be, instead of the renaming business, to create a new file in functions.d/ with your looknew() redefinition, and then append a line to the post-functions.sh to source your redefinition file.

Either of those approaches will break when the slackpkg package is upgraded or reinstalled, but the latter approach is less maintenance intensive, as it only requires re-adding the append line to the stock post-functions.sh file.
 
Old 10-30-2019, 08:35 AM   #12
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Quote:
Originally Posted by rworkman View Post
From my current recollection, there's no easy way to override built-in functions...
I agree that built in functions are not easy to override. A "wrapper" script(s) to use the functionality already available is a good alternative. For the OP a wrapper script would include for example:

Code:
slackpkg -postinst=off upgrade-all

or

POSTINST=off slackpkg upgrade-all
followed by:

Code:
slackpkg -only_new_dotnew=on upgrade-all

or

ONLY_NEW_DOTNEW=on slackpkg new-config
Both configuration options work. allend already quoted the POSTINST option above. Here's the ONLY_NEW_DOTNEW option from 'man slackpkg.conf':
Quote:
ONLY_NEW_DOTNEW
When POSTINST is set to "on", slackpkg will search for all .new files inside /etc and
prompt the user for what to do with them. However, some users prefer to see only the
.new files installed in slackpkg's last execution, so if this applies to you, set
ONLY_NEW_DOTNEW to "on".

The default value of ONLY_NEW_DOTNEW is "off". Only change this if you know what are
you doing...
From command line, you can use -only_new_dotnew=value.
I use a wrapper script for slackpkg that includes variations of both commands.

Have fun!
 
Old 10-30-2019, 09:06 AM   #13
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Awhile ago I patched pkgtools on my system to only create a .new file when the upstream (default) config has changed. I was getting tired of it asking me to look at differences in config files just because I edited something in the one on disk, and the .new file would just overwrite those changes. My solution doesn't involve slackpkg. The downside is that I need to keep a copy of the default config, but that doesn't bother me. To me, the OP's request could be risky, because sometimes default config files change upstream for a good reason, and leaving the old config file in place might cause stability or security issues.

Last edited by montagdude; 10-30-2019 at 09:10 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackpkg upgrade-all returns 'no packages to upgrade' after slackpkg-update has downloaded files san2ban Slackware 8 11-01-2019 05:44 AM
[SOLVED] slackpkg new-config not finding .new files stoa Slackware 9 06-07-2016 11:37 AM
php form action : second action ?? esteeven Programming 7 05-08-2015 08:06 AM
[SOLVED] typos in latest /etc/slackpkg/mirrors(.new) [slackpkg-2.82.0-noarch-8.tgz] wailingwailer Slackware 4 09-22-2012 04:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration