Re: yum clean bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, December 8, 2005 7:19 pm, Konstantin Ryabitsev said:

> cd /var/cache/yum
> for DIR in *; do
>     if ! grep -q "[$DIR]" /etc/yum.repos.d/*.repo; then
>         rm -rf $DIR
>     fi
> done
>
> There you go. You can put it in your cron.weekly.


This script is a bit fragile.  There will be bad consequences if
/var/cache/yum goes missing for whatever reason; it's likely to wipe out
your entire filesystem.   Better to fail rather than proceed if the "cd"
fails.   Even with that fixed the script could do unintended things if any
of the directories happen to have a space in them because $DIR isn't
properly quoted.

Sean

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux