Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 11-07-2009, 06:48 PM   #1
Registered: Apr 2008
Location: China, Beijing
Distribution: Slackware
Posts: 423

Rep: Reputation: 45
[slackpkg patch] link files to work dir when mirror is local

This can avoid some io transfers and save your hard disk a bit. Some one may want a try
diff -u slackpkg-2.80.2-noarch-3/usr/libexec/slackpkg/ /usr/libexec/slackpkg/
--- slackpkg-2.80.2-noarch-3/usr/libexec/slackpkg/     2009-07-27 09:33:49.000000000 +0800       
+++ /usr/libexec/slackpkg/     2009-11-08 08:28:36.824255477 +0800                               
@@ -656,8 +667,8 @@

 function getfile() {
         if [ "$LOCAL" = "1" ]; then
-                echo -e "\t\t\tCopying $1..."
-                cp ${SOURCE}$1 $2 2>/dev/null
+                echo -e "\t\t\tLinking $1..."
+                ln -s ${SOURCE}$1 $2 2>/dev/null
                 echo -e "\t\t\tDownloading $1..."
                 wget ${WGETFLAGS} ${SOURCE}$1 -O $2
@@ -691,10 +702,10 @@
                # put then in CACHEPATH
                if [ "${LOCAL}" = "1" ]; then
-                       echo -e "\tCopying $NAMEPKG..."
-                       cp ${SOURCE}${FULLPATH}/${NAMEPKG} ${CACHEPATH}
+                       echo -e "\tLinking $NAMEPKG..."
+                       ln -s ${SOURCE}${FULLPATH}/${NAMEPKG} ${CACHEPATH}
                        if [ "$CHECKGPG" = "on" ]; then
-                               cp ${SOURCE}${FULLPATH}/${NAMEPKG}.asc ${CACHEPATH}
+                               ln -s ${SOURCE}${FULLPATH}/${NAMEPKG}.asc ${CACHEPATH}
                        echo -e "\tDownloading $NAMEPKG..."

Last edited by grissiom; 11-07-2009 at 06:54 PM.
Old 11-07-2009, 10:51 PM   #2
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 109Reputation: 109
Thanks, for pointing this out. I only recently started updating by using the and setting slackpkg to a local web server. That seems odd that it would be using a cp command when the files are local :/

Last edited by lumak; 11-07-2009 at 10:56 PM.


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
Local dir missing in Buildroot dir parag_opensrc Linux - Embedded & Single-board computer 0 09-17-2009 11:29 PM
Command to display /dir, /dir/sub, /dir/sub/files knockout_artist Linux - Newbie 9 10-25-2007 02:57 PM
how do I uncomment a mirror in slackpkg? guruwammabe Slackware 8 03-22-2007 02:55 PM
LXer: How To Create A Local Debian/Ubuntu Mirror With apt-mirror LXer Syndicated Linux News 0 01-04-2007 05:33 PM
Share configuratin dir (.dir) for 3 accounts on local computer LiNuXkOlOnIe Linux - Software 5 01-08-2006 03:36 AM

All times are GMT -5. The time now is 09:03 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration