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.
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
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".
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.
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.
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...
}
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.
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.
@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.
@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. 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
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.