LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   rsync_slackware_patches.sh / Can I exclude files from downlo (https://www.linuxquestions.org/questions/slackware-14/rsync_slackware_patches-sh-can-i-exclude-files-from-downlo-674278/)

JosephS 10-04-2008 08:06 PM

rsync_slackware_patches.sh / Can I exclude files from downlo
 
I have installed: Amarok: 1.4.9.1 which I compiled with extra options.

I use rsync_slackware_patches.sh which I use to upgrade packages
Is there a way to edit the script to exclude Amarok packages from
being downloaded into the patches directory on my computer?

I don't want to upgrade with a package compiled without options I added.

Woodsman 10-05-2008 12:01 AM

If you are referring to Eric (Alien) Hameleers' shell script, the script does not perform any updating. The script only synchronizes the Slackware master server and mirrors that directory tree structure to your local hard drive.

You do not have to update any package that is updated in the patches directory. You decide on your own what to update.

You can direct rsync to exclude files and directories by creating a text file with one line per exclusion. The exclusion file would look something like this:

pasture/*
zipslack/*
testing/*

After creating this text file, modify the rsync command in rsync_slackware_patches.sh by adding the --exclude-from option. Refer to the rsync man page for more information.

With that said you don't need to exclude amarok from the synchronizing. Just don't install any new patched packages. However, a better approach is to rebuild your package with the options you want but using the new sources that are downloaded with any patches update. Most patches are security related and often updating is a reasonable strategy. Consider rebuilding any stock Slackware package that you modify to your tastes. You then get the additional options you want and ensure the package is updated with the latest security fixes.

I have a few packages that I modified in this manner. When patches are issued, I use the new patched sources and rebuild my package. Usually I diff the slackbuild scripts to learn whether the new patched version contains anything new that I should include in my own build script.

JosephS 10-05-2008 09:49 AM

Thanks for help.

I am referring to Eric (Alien) Hameleers' shell script.
I'm not sure where to add the --exclude-from option in the
script. Can I add it between 'Configurable options' and
'end of configurable options'?

niels.horn 10-05-2008 12:48 PM

You'll have to alter the second 'rsync' command in the script. It's on line 105 in version 1.9 (2008/05/29).

Change:
Code:

rsync ${RSYNCOPTS} ${RSYNCVERBOSE} -az --delete ${RSYNCHOST}/slackware-$VERSION/patches .
to:
Code:

rsync ${RSYNCOPTS} ${RSYNCVERBOSE} -az --delete --exclude-from=yourfile ${RSYNCHOST}/slackware-$VERSION/patches .
where "yourfile" is a small text file like woodsman suggested.

Alien Bob 10-05-2008 02:52 PM

I've gone ahead and added a "-X" option to the rsync_slackware_patches.sh script.

When you run it as
Code:

rsync_slackware_patches.sh -X your_excludesfile
it will exclude all files from the rsync that are references in that file. Typically in your case the file "your_excludesfile" would have this line in it:
Code:

patches/packages/amarok*
Also at the same time I added "-k" as an option, to "keep" old files even when they disappear on the remote server. Some people had asked me to add this because they don't want to lose previous versions of patches that were released and that they had downloaded.

Eric


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