LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 06-07-2018, 01:43 AM   #1
drgibbon
Member
 
Registered: Nov 2014
Distribution: Slackware64 14.2
Posts: 444

Rep: Reputation: 265Reputation: 265Reputation: 265
Check for updates by Changelog.txt digest?


I noticed recently that the 14.2 Changelog.txt is 471K, and that `slackpkg check-updates` looks for updates by downloading the whole file (checkchangelog in /usr/libexec/slackpkg/core-functions.sh). What do people think about the idea of having a Changelog.txt.md5 file that slackpkg can download and compare as an initial test for updates? The data transfer would be cut down to ~50 bytes. Doesn't seem like a huge difference in one instance (although it would be a little bit quicker), but it would add up to quite a bit across all Slackware users globally.
 
Old 06-07-2018, 01:40 PM   #2
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 1,659

Rep: Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087
Excellent idea drgibbon. I've put together a proposed patch for slackpkg (still untested) that determines if the ChangeLog is different by comparing CHECKSUMS.md5.asc which is very small and if it hasn't changed we know the ChangeLog didn't change either. Really no need to introduce a new digest file specifically for the ChangeLog.
 
8 members found this post helpful.
Old 06-07-2018, 01:43 PM   #3
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 1,659

Rep: Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087Reputation: 5087
Here it is, for anyone that might want to test and verify that it works correctly.
 
4 members found this post helpful.
Old 06-07-2018, 01:50 PM   #4
Xsane
Member
 
Registered: Jan 2014
Posts: 150

Rep: Reputation: 112Reputation: 112
Quote:
Originally Posted by drgibbon View Post
What do people think about the idea of having a Changelog.txt.md5 file that slackpkg can download and compare as an initial test for updates?
I use CHECKSUMS.md5.asc from the tree root. 163 bytes, WFM.

Edit:
Doh, outdrawn by BDFL.
These are not the droids you're looking for.

Last edited by Xsane; 06-07-2018 at 05:29 PM.
 
Old 06-07-2018, 07:13 PM   #5
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,338

Rep: Reputation: 864Reputation: 864Reputation: 864Reputation: 864Reputation: 864Reputation: 864Reputation: 864
https://git.rlworkman.net/slackpkg/c...484756e20ad0e8 :-)
 
3 members found this post helpful.
Old 06-07-2018, 11:28 PM   #6
drgibbon
Member
 
Registered: Nov 2014
Distribution: Slackware64 14.2
Posts: 444

Original Poster
Rep: Reputation: 265Reputation: 265Reputation: 265
Nice! I hadn't thought of just using the CHECKSUMS.md5 sig file, which is even better as there is nothing to change in the workflow

Btw, I've updated the function on my system, so I'll see how it fares on the next 14.2 update.

Last edited by drgibbon; 06-07-2018 at 11:33 PM.
 
1 members found this post helpful.
Old 06-08-2018, 12:02 AM   #7
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 138

Rep: Reputation: Disabled
Okay, I am now officially just a worm. I never thought to use other true flags.

But, really, I download ChangeLog.txt only once, after saving the prior ChangeLog.txt into ChangeLog.txt.orig. If their MD5 sums are the same, no update, so I delete ChangeLog.txt.orig and exit.

Then again, if their MD5 sums are different, I do a few rsync's to fetch the new trees for binaries and sources. Then I delete ChangeLog.txt.orig and exit.

But what if an rsync gets interrupted with Ctrl-C or X crashes or the power fails? Well, the ChangeLog.txt.orig still exists when I restart the update.sh script, so I skip all the other tests and just do the rsync's again.

How to force a fresh rsync, even if the remote stuff hasn't changed, just to be sure? It's easy:

$ echo blah >> ChangeLog.txt

then re-run update.sh.

It works for me.
 
Old 06-08-2018, 04:11 AM   #8
GazL
Senior Member
 
Registered: May 2008
Posts: 4,948
Blog Entries: 15

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
For comparison, an rsync that pulls no changes comprises of around 170K transferred. I was just contemplating the idea of pulling down CHECKSUMS.md5.asc and launching the rsync only when necessary, but I get the feeling the protocol overhead associated with pulling the file down with ftp/http will probably negate a good part of the savings made by not running the rsync.

edit:

Ok, the html headers weren't as significant as I thought and I decided it might be worth it after all. Anyone who keeps a local mirror with rsync might be interested in this simple pre-test script:

Code:
#!/bin/bash

URL="https://slackware.uk/slackware/slackware64-current/CHECKSUMS.md5.asc"
FILE=/srv/slackware/slackware64-current/CHECKSUMS.md5.asc

same()
{
  md5sum --check --strict --status \
    <( md5sum < "$FILE" ) < <( curl -sS "$URL" )
}

if same ; then
  echo "Your mirror is up to date. No action necessary"
  exit 0
else
  echo "Your mirror is out of date. Resyncronise"
  exit 1
fi

Last edited by GazL; 06-08-2018 at 05:30 AM.
 
Old 06-08-2018, 04:35 AM   #9
Skaendo
Member
 
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 846

Rep: Reputation: Disabled
Why on earth are you all not just plugging one of these: http://slackfeeds.sagredo.eu/ into a feed reader?
Attached Thumbnails
Click image for larger version

Name:	Screenshot.png
Views:	35
Size:	90.3 KB
ID:	27848  
 
Old 06-08-2018, 05:44 AM   #10
GazL
Senior Member
 
Registered: May 2008
Posts: 4,948
Blog Entries: 15

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
Quote:
Originally Posted by Skaendo View Post
Why on earth are you all not just plugging one of these: http://slackfeeds.sagredo.eu/ into a feed reader?
Because you can't do something like the following with a feed-reader

check_updates || { resync_mirror && system_update ;}
 
Old 06-08-2018, 11:36 AM   #11
Skaendo
Member
 
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 846

Rep: Reputation: Disabled
Quote:
Originally Posted by GazL View Post
Because you can't do something like the following with a feed-reader

check_updates || { resync_mirror && system_update ;}
Ok, I see your point. But I don't have to manually check for updates every {day,week,month,year}. I think that it's just one less headache because I don't have to constantly check. When I see my Slackware feed light up, I update, otherwise I don't worry.
 
2 members found this post helpful.
Old 06-08-2018, 11:53 AM   #12
GazL
Senior Member
 
Registered: May 2008
Posts: 4,948
Blog Entries: 15

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
Yep, both are valid approaches. Nothing wrong with RSS if that suits your workflow better.
 
1 members found this post helpful.
Old 06-09-2018, 02:46 AM   #13
drgibbon
Member
 
Registered: Nov 2014
Distribution: Slackware64 14.2
Posts: 444

Original Poster
Rep: Reputation: 265Reputation: 265Reputation: 265
I think that's one of the nice things about SlackwareŚwe have the option to do things our own way! For what it's worth, I also watch for Slackware updates over RSS (amongst other things like SBo, git repos, news, etc., using Newsboat*), but `slackpkg check-updates` is very convenient for scripting/cron jobs.

@volkerdi just tested the new code with the latest update, works well, cheers!

*Not entirely related, but for those interested you can do some neat tricks with Newsboat. As I only use chromium from the alien repo I don't want to see all RSS updates, so I filter the feed like this:
Code:
# in ~/.newsboat/urls
http://www.slackware.com/~alien/slackbuilds/ChangeLog.rss

# in ~/.newsboat/config
ignore-article "http://www.slackware.com/~alien/slackbuilds/ChangeLog.rss" "content !~ \".*chromium:.*\""
Then updates will only show for chromium (obviously could be reworked for whatever programs). Works very nicely alongside tmux.
 
2 members found this post helpful.
Old 06-09-2018, 06:22 AM   #14
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 932

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by GazL View Post
Yep, both are valid approaches. Nothing wrong with RSS if that suits your workflow better.
Yep.

My approach? I use Alien Bob's mirror-slackware-current.sh script via a cron job to mirror:
slackware-current
Slackware64-14.2
slackware64-current

Get notified by email when it updates. Great for updating my other computers. Use RSS too for other Slackware stuff.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
"slackpkg check-updates" only checks for .TXT files? Altiris Slackware 3 09-05-2015 04:37 PM
Fresh round of updates in changelog! astrogeek Slackware 87 06-16-2015 12:01 PM
A few more updates to the ChangeLog.txt chess Slackware 2 10-23-2013 11:00 PM
Changelog updates January 10, 2013 hitest Slackware 3 01-10-2013 08:40 PM
Bug in recent -64current ChangeLog.txt grissiom Slackware 4 06-19-2009 06:39 AM

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

All times are GMT -5. The time now is 11:11 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration