Cleaning up after yup


Subject: Cleaning up after yup
From: Patrick Callahan (pac1@tiac.net)
Date: Thu Jan 17 2002 - 18:47:58 MST


When downloading files with yup, if the download is interrupted, say by a
modem drop, the archives will not be restarted from the point where you left
off. Yup will later try and fail to install the corrupted archives and you
will need to delete them and start yup update over.

A convenient way to check and cleanup is given below. If you use yupcleaner
while yup update is in progress, be sure you don't delete the current package
being downloaded. It will show up as incomplete and yupcleaner will ask if
you want to delete it. Just say no to that one. A safe way to use this is
to run yupcleaner just before starting yup update.

cd ~
cat <<'eof'>yupcleaner
#!/bin/sh
for f in *.rpm
do
    if [ -f $f ]
    then
        m=`rpm --checksig $f`
        if [ ! "${m#*:}" == " md5 OK" ]
        then
           rm -i $f
        echo ""
        else
        echo $m
        fi
    fi
done
eof
chmod +x yupcleaner

cd /var/cache/yup/packages
~/yupcleaner

Here's a sample of the output after an interruption:

[root@localhost pac1]# /usr/sbin/yup update
Reading RPM database... (100%)
Performing dependencies sanity check...
Checking for package list updates...
ftp.yellowdoglinux.com ready
yup.db.stat: 0 KB read (100%) 0.1 KB/s
Package list is up to date...
Reading package list... (100%)

As requested, I will do the following:

[update: cpp] [update: printtool] [update: gcc-objc] [update: tetex-afm]
[update: yaboot] [update: libstdc++] [update: sendmail] [update: glibc]
[update: openssh-askpass-gnome] [update: gcc-g77] [update: yi] [update:
tetex-xdvi] [update: rhs-printfilters] [update: openssh-clients] [update:
gcc] [update: tetex] [update: tetex-latex] [update: glibc-devel] [update:
binutils] [update: diffutils] [update: tetex-dvilj] [update: openssh-askpass]
[update: tetex-fonts] [update: pmac-utils] [update: tetex-dvips] [update:
ghostscript] [update: gcc-c++] [update: openssh] [install: glibc-common]
Is this okay? [y/N]: y
Using cached copy of binutils-2.11.92.0.12-0b.ppc.rpm
Using cached copy of tetex-xdvi-1.0.7-8.1a.ppc.rpm
Using cached copy of cpp-2.95.4-4h.ppc.rpm
Using cached copy of pmac-utils-2.1-3a.ppc.rpm
Using cached copy of openssh-3.0.2p1-1a.ppc.rpm
Using cached copy of printtool-3.54-2a.noarch.rpm
Using cached copy of gcc-g77-2.95.4-4h.ppc.rpm
Using cached copy of gcc-objc-2.95.4-4h.ppc.rpm
glibc-2.2.4-19k.ppc.rpm: 53 KB read (1%) 5.1 KB/s
Interrupted!

[root@localhost pac1]# cd ~
[root@localhost /root]# cat <<'eof'>yupcleaner
> #!/bin/sh
> for f in *.rpm
> do
> if [ -f $f ]
> then
> echo $f
> m=`rpm --checksig $f`
> if [ ! "${m#*:}" == " md5 OK" ]
> then
> rm -i $f
> fi
> fi
> done
> eof
[root@localhost /root]# chmod +x yupcleaner
[root@localhost /root]#
[root@localhost /root]# cd /var/cache/yup/packages
[root@localhost packages]# ~/yupcleaner
binutils-2.11.92.0.12-0b.ppc.rpm
cpp-2.95.4-4h.ppc.rpm
diffutils-2.7-23.ppc.rpm
gcc-2.95.4-4h.ppc.rpm
gcc-g77-2.95.4-4h.ppc.rpm
gcc-objc-2.95.4-4h.ppc.rpm
glibc-2.2.4-19k.ppc.rpm

error: glibc-2.2.4-19k.ppc.rpm: rpmReadSignature failed

rm: remove `glibc-2.2.4-19k.ppc.rpm'? y
glibc-common-2.2.4-19k.ppc.rpm
openssh-3.0.2p1-1a.ppc.rpm
pmac-utils-2.1-3a.ppc.rpm
printtool-3.54-2a.noarch.rpm
tetex-afm-1.0.7-8.1a.ppc.rpm
tetex-dvilj-1.0.7-8.1a.ppc.rpm
tetex-xdvi-1.0.7-8.1a.ppc.rpm
yaboot-1.3.6-1a.ppc.rpm
yup-0.7.6-7.noarch.rpm
[root@localhost packages]#



This archive was generated by hypermail 2a24 : Thu Jan 17 2002 - 19:44:18 MST