LinuxQuestions.org
Visit Jeremy's Blog.
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-12-2019, 08:55 PM   #1
Andypoo
Member
 
Registered: Oct 2019
Distribution: Slackware
Posts: 66

Rep: Reputation: 57
pkgtools: upgradepkg optimisation


I noticed recently the change for --no-overwrite in installpkg and that got me thinking about something that has been on my mind for a while.

When I am doing machine upgrades (more common now with -current), then I am noticing a lot the time spent verifying/decompressing.

The change for no-overwrite got me looking at the installpkg/upgradepkg code, and I noticed that the current flow I believe includes 2 verifications (effectively, due to the two calls to installpkg if I'm not mistaken).

With the introduction of --no-overwrite, would it also be possible/appropriate to remove the verification from the second installpkg pass aswell?

Andypoo.
 
Old 10-12-2019, 09:00 PM   #2
Andypoo
Member
 
Registered: Oct 2019
Distribution: Slackware
Posts: 66

Original Poster
Rep: Reputation: 57
Silly side question: Is there a repository somewhere for the pkgtools scripts, or is their primary existance in the -current source tree?

I'm happy to provide patches for consideration if appropriate.

Andypoo.
 
1 members found this post helpful.
Old 10-13-2019, 05:33 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107Reputation: 8107
The official source of pkgtools (and anything in Slackware) is the Slackware distro tree you can find anywhere online.
Since 31 May 2018 I maintain a git repository which tracks slackware-current so you can more easily see the changes: https://git.slackware.nl/current/log/source/a/pkgtools
 
1 members found this post helpful.
Old 10-13-2019, 06:33 AM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,079

Rep: Reputation: Disabled
@Andyppoo: as an aside, a lot of time is spent (spent, not lost!) in removepkg verifying that a to be removed file be not shipped in another package, in which case it should be preserved.

Indeed bash is slow, and there is an unofficial binary utility named spkg that tries to mimic pkgtools behavior while being way faster. As an example "spkg -d" does the aforementioned check way faster

Originally written by Ondrej Jirman it is currently maintained by George Vlahavas (also the Salix maintainer), here: https://github.com/megous/spkg

As I have discussed with George, it would be very useful to bring to spkg a feature provided by upgradepkg, that is the pre-installation of the new package before removing the old one. This feature can avoid to break the system preventing to use an utility necessary for it to work (the /bin/sh symlink to /bin/bash is a well known example).

George agreed but is very busy now, and my knowledge of the C language is almost non-existent. Your help to do that would be much appreciated!

Last edited by Didier Spaier; 10-13-2019 at 06:45 AM.
 
1 members found this post helpful.
Old 10-13-2019, 10:30 AM   #5
Andypoo
Member
 
Registered: Oct 2019
Distribution: Slackware
Posts: 66

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by Didier Spaier View Post
@Andyppoo: as an aside, a lot of time is spent (spent, not lost!) in removepkg verifying that a to be removed file be not shipped in another package, in which case it should be preserved.
Yes, definitely. I was not planning on touching this removepkg process at all. And I also understand why the installpkg double-install trick happens.

It was more the installpkg initial verification that I was referring to which basically confirms that decompress is successful (and is also used to get the uncompressed size of the package). And I did not want it removed, just to be avoided running twice in short succession :-)

Andypoo.
 
Old 10-13-2019, 01:52 PM   #6
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 Didier Spaier View Post
Indeed bash is slow, and there is an unofficial binary utility named spkg that tries to mimic pkgtools behavior while being way faster.
Slow enough that using /sbin/ash usually results in a noticeably faster script. PV made a conscious decision to move from ash to bash years ago and I rather doubt that the reasons for that change have gone away or even weakened.
 
Old 10-13-2019, 02:06 PM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,079

Rep: Reputation: Disabled
Quote:
Originally Posted by Richard Cranium View Post
Slow enough that using /sbin/ash usually results in a noticeably faster script. PV made a conscious decision to move from ash to bash years ago and I rather doubt that the reasons for that change have gone away or even weakened.
I didn't suggest to replace usage of bash in pkgtools by another shell (which others have done long ago to no avail) and don't really care (although I try to avoid extensions beyond the POSIX specification in my own scripts), but rather speed of any shell vs a compiled program.
 
Old 10-14-2019, 08:47 AM   #8
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Quote:
Originally Posted by Richard Cranium View Post
PV made a conscious decision to move from ash to bash years ago and I rather doubt that the reasons for that change have gone away or even weakened.
Bash is one of the most viable shells because it is popular and an often targeted shell, but if you ignore that it has serious drawbacks and bugs. However the main issue is that reporting these problems in my experience is pointless because the community is more willing to pick apart an example script for being badly written than discuss the serious issues in bash they reveal while the devs wish distros to fix their own trivial bugs downstream because they are unwilling to merge patches.
 
Old 10-14-2019, 01:32 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 Didier Spaier View Post
I didn't suggest to replace usage of bash in pkgtools by another shell (which others have done long ago to no avail) and don't really care (although I try to avoid extensions beyond the POSIX specification in my own scripts), but rather speed of any shell vs a compiled program.
I didn't mean to imply that you did make such a suggestion.
 
  


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
Curious: pkgtools Directories and SymlLnks with pkgtools-15.0-noarch-20.txz on Thu Jun 21 22:58:42 UTC 2018 kjhambrick Slackware 4 06-23-2018 01:16 AM
-march optimisation for kernel BenPope Linux - General 2 09-03-2003 11:36 AM
Hard drive access optimisation chakkerz Linux - Newbie 2 07-08-2003 06:51 AM
Compiling (GCC) - Optimisation anonE9 Programming 5 03-15-2003 08:20 PM
debian source package optimisation rlpt Linux - General 1 03-17-2002 04:23 PM

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

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