[sbopkg-users] Obsolete Packages

alkos333 me at alkos333.net
Thu Mar 5 00:02:14 UTC 2009


On Wed, Mar 4, 2009 at 5:35 PM, slakmagik <jsunx1 at bellsouth.net> wrote:
> On 2009-03-04 (Wed) 16:55:04 [-0600], alkos333 wrote:
>> On Wed, Mar 4, 2009 at 4:36 PM, slakmagik <jsunx1 at bellsouth.net> wrote:
>> >
>> > The above would need to be something like
>> >
>> > for pkg in /home/slackbuilds/pkgs/*.tgz; do
>> >      pkgfile=${pkg##*/}
>> >      if [ ! -f /var/log/packages/${pkgfile%.tgz} ]; then
>> >            rm $pkg
>> >      fi
>> > done
>> >
>> > to do the path substitution as well as extension removal.
>> >
>>
>> I don't see the point of hardcoding the search path and the defining pkgfile
>>
>
> Crap. I just changed the search path to run it off the command line and
> it should have been changed back before I mailed it, but I forgot.
>
> But the definition of pkgfile is because your
>
>    if [ ! -f /var/log/packages/${pkg%.tgz} ]; then
>
> expands to
>
>    if [ ! -f /var/log/packages//value/of/OUTPUT/pkgname ]; then
>
> The expansion of $OUTPUT (or '/value/of/output') needs to be removed and
> doing two parameter expansions is faster than 'basename $pkg .tgz'. You
> could also 'cd $OUTPUT' and then do 'for pkg in *.tgz', I guess, though
> I'd rather not.
> _______________________________________________
> sbopkg-users mailing list
> sbopkg-users at sbopkg.org
> http://sbopkg.org/mailman/listinfo/sbopkg-users
>

I see.  I just ran my snippet from the current directly ($OUTPUT), so
I didn't think of that.  Yes, the two parameter replacement is
definitely faster than a running an outside c binary.

-- 

Joe DiMaggio  - "Pair up in threes."


More information about the sbopkg-users mailing list