LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices


Reply
  Search this Thread
Old 05-21-2024, 08:00 PM   #1
lazardo
Member
 
Registered: Feb 2010
Location: SD Bay Area
Posts: 276

Rep: Reputation: Disabled
[SOLVED] avoid downloading packages with patches for new installs


Small tool to skip downloading both packages and their respective patches. Useful for those with frequent new installs, esp multiple machines.
Code:
#!/bin/bash

# Generate an rsync filter containing any original package that has
# a corresponding patch package.  Avoid double download penality
# for installations with patches.
#
# After normal installation and before reboot: 'installpkg patches/packages/*.txz'
# rather than 'upgradepkg'

# tested on: slackware64, slackwarearm-15.0.  -current is ALL patches ;)
RSYNC=rsync://slackware.uk/slackwarearm/slackwarearm-15.0/
RSYNC=rsync://slackware.osuosl.org/slackware/slackware64-15.0/

RSYNC_ADD=""	# like exclude-from=

PATCHES=/tmp/patches.list
PACKAGES=/tmp/packages.list
EXCLUDES=/tmp/excludes.list

###########

RSYNC_OPS="--include='/*' --include='/slackware*/***' --include='/patches/packages/***' --exclude='*'"

echo "$RSYNC $RSYNC_ADD ===
lists ..."

for LIST in $PATCHES $PACKAGES $EXCLUDES; do
	echo "# $RSYNC $( date )" > $LIST
done

rsync -avn $RSYNC $RSYNC_OPS $RSYNC_ADD |
	awk -F / -v Patches=$PATCHES -v Packages=$PACKAGES '\
	/ patches\/packages\/.*txz$/ { print $NF >> Patches; system("") }
	/ slackware.*\/.*txz$/ { print $(NF-1)"/"$NF >> Packages; system("") }
	/^d/ && NF<4 { print substr($NF,12); next }'

echo "filter ..."
for PATCH in $( grep -v '^#' $PATCHES ); do
	KEY="\/$( echo $PATCH | sed 's/-[0-9].*/-[0-9]/' )"
	sed -n "/$KEY/{s/^/- /; s/.txz/\*/p}" $PACKAGES
done | sort >> $EXCLUDES

echo "exclude-from file: $EXCLUDES"
Code:
$ excludes; for i in /tmp/{excludes,patches,packages}.list; do head -vn 5 $i; done
rsync://slackware.osuosl.org/slackware/slackware64-15.0/  ===
lists ...
 .
 EFI
 extra
 isolinux
 kernels
 pasture
 patches
 slackware64
 source
 testing
 usb-and-pxe-installers
filter ...
exclude-from file: /tmp/excludes.list
==> /tmp/excludes.list <==
# rsync://slackware.osuosl.org/slackware/slackware64-15.0/ Tue May 21 17:52:38 PDT 2024
- a/aaa_base-15.0-x86_64-3*
- a/aaa_glibc-solibs-2.33-x86_64-5*
- a/coreutils-9.0-x86_64-3*
- a/dcron-4.5-x86_64-11*
==> /tmp/patches.list <==
# rsync://slackware.osuosl.org/slackware/slackware64-15.0/ Tue May 21 17:52:38 PDT 2024
Cython-0.29.36-x86_64-1_slack15.0.txz
LibRaw-0.20.2-x86_64-4_slack15.0.txz
aaa_base-15.0-x86_64-4_slack15.0.txz
aaa_glibc-solibs-2.33-x86_64-6_slack15.0.txz
==> /tmp/packages.list <==
# rsync://slackware.osuosl.org/slackware/slackware64-15.0/ Tue May 21 17:52:38 PDT 2024
a/aaa_base-15.0-x86_64-3.txz
a/aaa_glibc-solibs-2.33-x86_64-5.txz
a/aaa_libraries-15.0-x86_64-19.txz
a/aaa_terminfo-6.3-x86_64-1.txz

Last edited by lazardo; 05-21-2024 at 08:06 PM. Reason: typo
 
  


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
Intel Laptop Users Should Avoid Linux 5.19.12 To Avoid Potentially Damaging The Display chris.willing Slackware 3 10-05-2022 02:32 AM
alps errors - While downloading packages/patches chandrakant AryaLinux 5 05-10-2016 06:26 AM
[SOLVED] Stale/duplicate packages in 14.1 patches/packages/ GazL Slackware 3 06-17-2015 09:06 AM
Logic to avoid duplicate instances arjundey AIX 10 03-12-2013 06:40 AM
Yum installs duplicate packages cuco76 Linux - Software 1 10-14-2007 03:37 PM

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

All times are GMT -5. The time now is 03:05 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
Open Source Consulting | Domain Registration