LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 01-28-2010, 01:57 PM   #16
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550

Quote:
Originally Posted by carbonfiber View Post
I don't get it. I've not used Slackware in years, but when I did, I used a similar method, but using rsync. Anyway. Y'all need to hang out on FreeNode's ##slackware more.
I might try this sometime

I've never been one for IRC..
 
Old 01-28-2010, 02:41 PM   #17
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.0
Posts: 1,142
Blog Entries: 29

Original Poster
Rep: Reputation: 119Reputation: 119
IRC can be kind of fun. I hang out on ##slackware from time to time, but usually just lurk.

The mention of MD5 sum checking is a good point. I'm going to investigate what it would take for my script to automatically check the MD5sums and spit out an error if needed before running upgradepkg.

This step is beyond my scripting skills right now. The main problem is that the /patches/CHECKSUMS.md5 file has checksums for the sources as well as the compiled packages, but I'm only downloading the compiled packages.

SO, I think I need to do some work with grep to output just the lines from the /patches directory into a new file and run the md5sum command on that file.

Thoughts?
 
Old 01-28-2010, 03:39 PM   #18
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,252

Rep: Reputation: 630Reputation: 630Reputation: 630Reputation: 630Reputation: 630Reputation: 630
I used to use rsync and check the md5sums before upgrading until I switched to slackpkg in 13.0. I don't have my old script handy but something like

Code:
egrep "\./packages/" /path/to/patches/CHECKSUMS.md5 | md5sum -c | grep -v OK$
should do the trick; no need for a new file. Of course I don't know how your script is setup directory-wise so it'll attempt to search for ./packages/packagename.txz. If you have the packages/ folder on your system then just adjust for the working directory; otherwise you'd have to use sed or something to get rid of ./packages/ from the CHECKSUMS.md5 output. You can check the $? variable after that command in your script to see if any results were obtained and either run upgradepkg or abort.
 
Old 01-28-2010, 03:53 PM   #19
GazL
Senior Member
 
Registered: May 2008
Posts: 3,383

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
I used to do it by checking the gpg signatures.

Something like:
Code:
cd patches/packages
for package in *.t?z.asc
do
  if gpg --verify "$package"
  then  
    upgradepkg ${package%.asc}
  else
    echo "ERROR:  ${package%.asc} doesn't match signature file. Skipped!" 1>&2
  fi
done
Like T3' I'm on current at the moment so I pay a little more attention and do it all manually.
 
Old 01-28-2010, 03:57 PM   #20
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 227Reputation: 227Reputation: 227
Quote:
IRC can be kind of fun. I hang out on ##slackware from time to time, but usually just lurk
Yes - I'm a lurker there too, (lurking now in fact), reading the goings on from the previous night often makes me laugh and brightens up my morning. Pat used to occasionally pop in - not sure if he still does though. Anyway - apologies for going OT for a bit.

Personally I just run " slackpkg update && slackpkg install-new && slackpkg upgrade-all" on a daily basis - it's a wondrous tool. I used to regularly rsync to the current tree before slackpkg was out.
 
Old 01-28-2010, 08:38 PM   #21
hitest
Senior Member
 
Registered: Mar 2004
Location: Prince Rupert, B.C., Canada
Distribution: Slackware, OpenBSD
Posts: 4,163

Rep: Reputation: 527Reputation: 527Reputation: 527Reputation: 527Reputation: 527Reputation: 527
Quote:
Originally Posted by Lufbery View Post

The mention of MD5 sum checking is a good point. I'm going to investigate what it would take for my script to automatically check the MD5sums and spit out an error if needed before running upgradepkg.
Yes. If you could add md5 checking into your method it would be fully functional. The reason I posted the md5 functionality of slackpkg is because I have on occasion poor connectivity and, therefore, download incomplete or corrupt packages. Slackpkg catches that for me so that I can re-download a corrupted package.
 
Old 01-28-2010, 09:57 PM   #22
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.0
Posts: 1,142
Blog Entries: 29

Original Poster
Rep: Reputation: 119Reputation: 119
Thanks all, the script is coming along pretty well.

Thanks T3 for the grep/md5sum pipe code.

Here's what it looks like now:

Code:
#!/bin/bash
#update_slackware.sh
#Note: run this script from the local ./patches directory.

#Synchronize the local mirror with the remote mirror:
lftp -c "open my-favorite-slackware-mirror/Slackware-version/patches/ ; mirror -e -n packages"

#Download the CHECKSUMS.md5 file:
lftp -c get my-favorite-slackware-mirror/Slackware-version/patches/CHECKSUMS.md5

#Check for MD5 checksum errors
grep "\./packages/" CHECKSUMS.md5 | md5sum -c | grep -v OK$

#Add if test so that script fails and exits if MD5 sum fails:
#
#
#

#Upgrade Slackware with downloaded packages:
upgradepkg ./packages/*.txz

#Find configuration files that need attention:
find /etc -name "*.new"
As you can see, I have a hole where I need to fill in the error-checking intervention if an MD5 sum fails. I think the code needs to look like was GazL posted above, but I need to learn more about that stuff with Bash scripting.

Edit: isn't it funny how the comments double the size of the script?

Regards,

Last edited by Lufbery; 01-28-2010 at 10:30 PM.
 
Old 01-29-2010, 03:01 AM   #23
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 6,970
Blog Entries: 52

Rep: Reputation: Disabled
What I should have said in my first post is: I don't know enough about shell scripting yet, so I use slackpkg. I've got a hell of a lot to learn yet about Slackware, and Linux in general.
 
Old 01-29-2010, 04:26 AM   #24
grissiom
Member
 
Registered: Apr 2008
Location: China, Beijing
Distribution: Slackware
Posts: 421

Rep: Reputation: 45
When facing tools that could make life easier, someone always want to "create his own" in haste. This especially happens in Linuxers(Slackers).
 
Old 01-29-2010, 05:38 AM   #25
gegechris99
Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 14.1 32bit
Posts: 720
Blog Entries: 3

Rep: Reputation: 76
@Lufbery

FYI, I use slackpkg but I understand and support you in this initiative. By the way, who am I to say that your script might be useless?

Regarding security update of the kernel, I make a new initrd.gz image file and run "lilo" after the upgrade (i.e. I don't use the lilo option in slackpkg because I have to rebuild the initrd.gz file first).

Should your script include an automatic run of "lilo" (useless most of the time) or will the script grow more complicated (i.e. what about initrd.gz)?
 
Old 01-29-2010, 05:46 AM   #26
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
My concerns with this script:

1) What about new packages, you would have to read the changelog ... I'm too lazy.

2) You need to store a mirror on you computer ... I don't like doing this, it wastes space. I wonder if you could somehow only keep a place marker for each package after you install them, that may prevent the downloading of that package over again and yet not waste space.

I too made a script to update slackware at one point, but it is obsolete now that slackpkg is official and included, besides the directory structure was changed and that made the script mess up.
 
Old 01-29-2010, 06:05 AM   #27
hitest
Senior Member
 
Registered: Mar 2004
Location: Prince Rupert, B.C., Canada
Distribution: Slackware, OpenBSD
Posts: 4,163

Rep: Reputation: 527Reputation: 527Reputation: 527Reputation: 527Reputation: 527Reputation: 527
Quote:
Originally Posted by grissiom View Post
When facing tools that could make life easier, someone always want to "create his own" in haste. This especially happens in Linuxers(Slackers).
I think Lufbery's experiment is interesting indeed. However, for my systems I will stick with a proven Slackware technology: slackpkg
I've found Piter Punk's slackpkg program to be very reliable. I trust slackpkg.
 
Old 01-29-2010, 06:28 AM   #28
GazL
Senior Member
 
Registered: May 2008
Posts: 3,383

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
Quote:
Originally Posted by grissiom View Post
When facing tools that could make life easier, someone always want to "create his own" in haste. This especially happens in Linuxers(Slackers).
Some of us have been doing this since long before slackpkg came along, so if anything one could argue that it's slackpkg that's providing the duplicate functionality and was written by someone who wanted to 'create his own'. (just making the point, not suggesting there's anything wrong with slackpkg)

I don't believe in reinventing the wheel, but combining basic utilities to achieve something more advanced is part and parcel of the UNIX way of doing things and one of the reasons UNIX is so powerful. I see nothing wrong with lufbery writing his/her own script (and learning some valuable lessons in the process) even if it only ends up doing something similar to what slackpkg now provides.

Last edited by GazL; 01-29-2010 at 06:29 AM.
 
Old 01-29-2010, 06:43 AM   #29
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 6,970
Blog Entries: 52

Rep: Reputation: Disabled
I think Slackware encourages this sort of experimenting more than some other distros (no names ), with their "Policies" and "Ways" of doing things.
 
Old 01-29-2010, 08:28 AM   #30
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.0
Posts: 1,142
Blog Entries: 29

Original Poster
Rep: Reputation: 119Reputation: 119
Hi all,

It seems that pretty much everyone is getting where I'm coming from. The whole point of this exercise is to go from doing a task manually to automating some or all of the steps of that task with a script.

Slackpkg is a fine program! However I tend to prefer to do things manually, at least at first, so I know what's going on. For example, I initially got started with SlackBuild scripts by manually downloading the source, downloading the SlackBuild package from Slackbuilds.org, and running the script to build the package. Now I use sbopkg, but I get a lot more out of sbopkg knowing exactly what it automates and what it enhances.

This exercise is similar. I could simply use slackpkg, but then I wouldn't get the benefit of knowing what's going on, or learning how to write better bash scripts. And besides, slackpkg is 476 lines lnog. My script (so far) is only 23.


Quote:
Originally Posted by H_TeXMeX_H View Post
My concerns with this script:

1) What about new packages, you would have to read the changelog ... I'm too lazy.
Well, I think reading the changelog is important even when using slackpkg, however, if I changed the upgradepkg command to upgradepkg --install-new, I've got that problem covered.

Quote:
2) You need to store a mirror on you computer ... I don't like doing this, it wastes space. I wonder if you could somehow only keep a place marker for each package after you install them, that may prevent the downloading of that package over again and yet not waste space.
Hm. That's an interesting idea. However, that would make the MD5sum checking more difficult.

Regards,
 
  


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
I need help keeping Xandros 4.1 up to date. litefoot Linux - Newbie 2 01-13-2010 04:53 PM
Keeping Slackware Up-to-date Bash Rules Slackware 22 09-08-2009 10:20 PM
Keeping Slackware 12.1 up to date. glore2002 Slackware 10 06-18-2008 09:58 AM
keeping slackware 11 up-to date ronty Slackware 6 01-20-2007 08:14 AM
Keeping Slackware Up-To-Date introuble Slackware 4 03-21-2006 08:08 AM


All times are GMT -5. The time now is 07:14 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration