LinuxQuestions.org
Help answer threads with 0 replies.
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 11-09-2020, 03:41 PM   #5866
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled

Quote:
Originally Posted by drumz View Post
Please no. I like that the package manifest in /var/log/packages/ mostly describes an installed package. doinst.sh should do as little as possible to install the package. Don't get fancy. It shouldn't be creating files out of thin air.
Then I modify my suggestion to have the files renamed to "filename.something.sample", like smb.conf.sample in the Samba package.

The default rc.local file does literally nothing but act as documentation. I see no scenario where overwriting something with nothing would be desirable.

The same goes for /etc/ntp.conf; it contains useful hints about the various parameters, but by default it configures an NTP server that syncs with itself, which is actually worse than nothing.

There are a few other examples as well.
Quote:
Originally Posted by drumz View Post
If your complaint is that slackpkg doesn't handle *.new files well enough, suggest an improvement to slackpkg.
I don't think that would be feasible, to be honest. The complexity required for handling various types of config files differently would probably require a change to the package files themselves.

However, if some select config files were converted to .sample files, it would significantly lessen the risks involved in selecting "overwrite all".
 
Old 11-09-2020, 03:45 PM   #5867
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 907

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Quote:
Originally Posted by Ser Olmy View Post
Then I modify my suggestion to have the files renamed to "filename.something.sample", like smb.conf.sample in the Samba package.
Now that's something I agree with. It clearly demonstrates that *.sample is more of a documentation of what is possible. And it also documents the fact that user modifications should take priority over the package-supplied version.
 
Old 11-09-2020, 03:52 PM   #5868
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
Quote:
Originally Posted by drumz View Post
Don't get fancy. It shouldn't be creating files out of thin air.
Technically, it already kinda does, especially for config files which is what we're discussing:
Code:
$ cat /var/log/packages/sysvinit-scripts-2.1-noarch-36 | grep "rc.local$"
$
Code:
$ cat /var/log/packages/sysvinit-scripts-2.1-noarch-36 | grep "rc.local"
etc/rc.d/rc.local.new
$
But yes, I'm being pedantic and I do understand your position.
 
Old 11-09-2020, 04:01 PM   #5869
saxa
Senior Member
 
Registered: Aug 2004
Location: Nova Gorica, Salvador
Distribution: Slackware
Posts: 1,226

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
gdk-pixbuf-2.42.0
https://download.gnome.org/sources/g...-2.42.0.tar.xz
 
Old 11-09-2020, 04:04 PM   #5870
saxa
Senior Member
 
Registered: Aug 2004
Location: Nova Gorica, Salvador
Distribution: Slackware
Posts: 1,226

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Here are some notes about gdk-pixbuf:
Quote:
GdkPixbuf 2.42.0 introduced new build-time options to increase consistency with the rest of the GNOME core platform:

the docs option has been deprecated; it’s now recommended to use the gtk_doc option to build the API reference for GdkPixbuf, and the man option to build the manual pages for the various tools
the gir option has been renamed to introspection, and it uses a “feature” type instead of a boolean one

In both cases, the change was made to match what other GNOME libraries already do.
 
Old 11-09-2020, 04:33 PM   #5871
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by drumz View Post
On a related suggestion, I would like it if upgradepkg recognized that an old configuration file was identical to the previously-installed package, and move the incoming *.new file into place automatically. But I recognize there are too many gotchas in this case and it's best to leave the behavior as it is now. (This concept has already been discussed before here on LQ.)
I'm too lazy to look and see how Pat does it in official packages, but the SBo template for the doinst.sh script checks the md5sum of the contents of the old and new conf file and if they're the same, they discard the new file:

Code:
config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}
 
Old 11-09-2020, 04:35 PM   #5872
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,221

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
Quote:
Originally Posted by Ser Olmy View Post
Then I modify my suggestion to have the files renamed to "filename.something.sample", like smb.conf.sample in the Samba package.

The default rc.local file does literally nothing but act as documentation. I see no scenario where overwriting something with nothing would be desirable.
Even better
 
Old 11-09-2020, 04:40 PM   #5873
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 907

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Quote:
Originally Posted by bassmadrigal View Post
I'm too lazy to look and see how Pat does it in official packages, but the SBo template for the doinst.sh script checks the md5sum of the contents of the old and new conf file and if they're the same, they discard the new file:

Code:
config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}
No, I mean if I:

1. Install a package. This package moves the *.new file into place. I don't edit it.
2. Upgrade the package, which includes a new version of the configuration file. upgradepkg will leave the *.new file in place, as the *.new file is different than the already-existing configuration file.
3. I must compare the files and remember that all the changes are due to the package itself, not to custom changes I've made.

The use of tools such as etckeeper (https://slackbuilds.org/repository/1...tem/etckeeper/) can assist the user in these cases. Also, more and more software is making use of the *.conf.d/ convention which allows users to separate out local and package-managed configuration options.

Edit to add: But unless someone comes up with a really elegant solution, it's not worth talking about. The status quo works well enough. We're not upgrading tens of packages each week, after all. It really is minimal effort to manually review all the *.new files.

Last edited by drumz; 11-09-2020 at 04:43 PM.
 
Old 11-09-2020, 04:54 PM   #5874
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,078

Rep: Reputation: Disabled
@drumz: it is very rare that an upgrade of a package brings a modified configuration file. But if this is the case, it is worth being aware of that and spotting the differences. I don't think that in this case just replacing the old config files (even if not edited by you) by the new one be a good idea, as the new config file could include settings of new variables that you better be aware of.

Last edited by Didier Spaier; 11-09-2020 at 04:55 PM.
 
1 members found this post helpful.
Old 11-09-2020, 05:13 PM   #5875
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
Quote:
Originally Posted by Didier Spaier View Post
@drumz: it is very rare that an upgrade of a package brings a modified configuration file. But if this is the case, it is worth being aware of that and spotting the differences.
I believe the argument is that if you were using the Slackware defaults previously, it's reasonable to conclude that you'll want to keep doing so.
 
1 members found this post helpful.
Old 11-09-2020, 05:55 PM   #5876
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by drumz View Post
No, I mean if I:

1. Install a package. This package moves the *.new file into place. I don't edit it.
2. Upgrade the package, which includes a new version of the configuration file. upgradepkg will leave the *.new file in place, as the *.new file is different than the already-existing configuration file.
3. I must compare the files and remember that all the changes are due to the package itself, not to custom changes I've made.
I understand what you're going for here, but I certainly didn't get that from your previous post (although, re-reading it with context I can see what you mean now).

It would basically be impossible to do this unless a checksum of the original file was kept somewhere and compared to the checksum of the current config when a new config is presented.

Quote:
Originally Posted by drumz View Post
The use of tools such as etckeeper (https://slackbuilds.org/repository/1...tem/etckeeper/) can assist the user in these cases. Also, more and more software is making use of the *.conf.d/ convention which allows users to separate out local and package-managed configuration options.
etckeeper can be handy to track changes (and I've used it for years), but it wouldn't let you know if the file has been modified from the one included with that package unless you update the repo when installed and update it again if/when any changes are made (I'm horrible about keeping my etckeeper up-to-date) and then you'd need to check the log for any changes to that file.
 
Old 11-09-2020, 06:10 PM   #5877
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,078

Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
I believe the argument is that if you were using the Slackware defaults previously, it's reasonable to conclude that you'll want to keep doing so.
Even then, as a distribution maintainer if I bring a new feature of which users would only benefit through a new setting I'd like users be aware of that. Been there, done that. I can write a note about the change in a ChangeLog but not all users will read it. I can inform through a mailing list but not all users are subscribed to it.

Last edited by Didier Spaier; 11-09-2020 at 06:11 PM.
 
Old 11-09-2020, 09:07 PM   #5878
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,987

Rep: Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557
Quote:
Originally Posted by Ser Olmy View Post
Request/suggestion: How about simply removing these files from the packages in question, and have doinst.sh generate a default file if, and only if, the file doesn't already exist?

Can anybody envision a scenario where that wouldn't constitute an improvement?
The config files are in the package tree at the location they will be installed to. It is possible that these "default" config files have changes I might want to merge in to my existing config file. If I remove them and rely on doinst.sh to generate this default file if, and only if, the file doesn't already exist, how will I be able to compare these changes.

If your removing these config file from the package tree, how will doinst.sh handle their generation if needed in your scenario? Add the config files to doinst.sh? I sure hope not.

I am fine with the current method of handling config files.
 
Old 11-09-2020, 09:20 PM   #5879
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,987

Rep: Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557
Quote:
Originally Posted by drgibbon View Post
+1 from me for rc.local.

Right, but it's a hassle when using `slackpkg new-config` to mess with rc.local (especially if you accidentally overwrite it).
rc.local is not that big a hassle. 'p'rompt, 'm'erge, 'l', 'i'nstall. Now cups on the other hand...

Last edited by chrisretusn; 11-09-2020 at 09:21 PM.
 
1 members found this post helpful.
Old 11-09-2020, 09:23 PM   #5880
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
Quote:
Originally Posted by chrisretusn View Post
The config files are in the package tree at the location they will be installed to. It is possible that these "default" config files have changes I might want to merge in to my existing config file
The whole point was to do this only for files that are really just documentation.

But you're still right; if nothing else there might be relevant information in the newer versions of the files. Giving them a .sample extension is looking more and more like the ideal solution.
 
  


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] Requests for -current (20151216) rworkman Slackware 3441 12-28-2017 03:50 PM

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

All times are GMT -5. The time now is 04:34 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