[Slackbuilds-users] for testing - 'sbopkg' tool

Robby Workman rworkman at slackbuilds.org
Mon Mar 24 13:01:36 EDT 2008


Chess Griffin wrote:

> 
> Yeah, the only reason I specifically did not include --delete was that I 
> did not want to delete the source tarballs to save having to redownload 
> them.  However, maybe a separate directory could be created where all 
> source tarballs are kept (like the /distfiles directory in FreeBSD) and 
> that this directory is checked for a copy of the source tarball before 
> building the package.  If it's there, the source is moved to where it 
> needs to be for the SlackBuild to run.  If not, it's downloaded into 
> that directory for future use.


Hmmm...

Perhaps something along these lines...

# Probably pull this from the config file instead, but you get the
# idea :)    Also, /var is probably a bad place to put this, but
# maybe a sane default ??
SRC_DIR=${SRC_DIR:-/var/cache/sbopkg}

When getting ready to build the package, do something like this:

if [ ! -e $CWD/$SRCTARBALL ]; then   # maybe check md5sum here too?
   if [ -e $SRC_DIR/$SRCTARBALL ]; then
     ln -s $SRC_DIR/$SRCTARBALL $CWD/$SRCTARBALL
   else
     cd $SRC_DIR ; wget $DOWNLOAD ; cd -
   fi
fi

That's ugly, but maybe gets the point across.  Perhaps wrap that in a
while loop would be better too.  Anyway, the symlink to the source
cache would be IMHO better than a copy or move of the actual source
tarball...

-RW


More information about the Slackbuilds-users mailing list