[sbopkg-users] md5sum of cached source

Mauro Giachero mauro.giachero at gmail.com
Sat May 23 13:28:46 UTC 2009


On Fri, May 22, 2009 at 6:17 PM, David Spencer <nobbutl at yahoo.co.uk> wrote:

> > The attached is a much smaller change targeting the stable branch, making
> > the md5 check unconditional (but with no "download again" option). Any
> > chance you can give it a spin before the commit?
>
> Hi Mauro, many thanks for such a quick response!  The patch *almost*
> works ;-)
>
> Unfortunately the current directory isn't changed to $SRCDIR when the
> body of 'if [ ( -z $SRCNAME ... fi' is skipped, so the md5sum check then
> fails (file not found).
>
> I'd suggest adding 'cd $SRCDIR' up before that 'if' statement (just
> after '. "$INFO"' which you also had to move), so that the current
> directory is the same whether or not the body of the 'if' statement has
> been executed.  In other words
>
>    SRCNAME=$(get_source_names "$INFO")
>    . "$INFO"
>    cd $SRCDIR
>    if [[ (-z "$SRCNAME") || (! -f "$SRCDIR/$SRCNAME") ]]; then
>        mkdir -p $DLDIR
>        cd $DLDIR
>        ...
>        cd $SRCDIR
>        rm -rf $DLDIR
>    fi
>
> That seems slightly better than the alternative solution, which is to
> add $SRCDIR to the pathname in the md5sum command
>
>        MD5CHK=$(md5sum "$SRCDIR/$SRCNAME" | cut -d' ' -f1)


Umph.
Thank you, I'll commit the fixed patch on Monday.


> Hope this helps, sorry not to do a proper patch but such things are
> dangerous in the hands of amateurs like me :-)


:-)

-- 
Mauro Giachero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sbopkg.org/pipermail/sbopkg-users/attachments/20090523/b0d47225/attachment-0001.htm>


More information about the sbopkg-users mailing list