I'm not sure if my initial message made it to the list (spam filter
intervention 8-) ). Let's try it again. I fetch my Debian release packages
manually with FTP. I've always wanted an easy way to verify the integrity of
the packages (looking for stupidity like using text mode instead of binary
mode). Attached to this message is a short bash script which does the trick.
Enjoy!

-----------------------------CUT HERE-----------------------------------

## dpkg-check - checks downloaded packages for correctness
## Written by Thomas Kocourek, (c) 1996
## In the spirit of the Linux community, this script is freeware.
## This command was written for those of us who FTP our Debian by hand 8-)
## Feel free to use at anytime to check your Debian release
## And for those adventureous souls, modify this to your heart's content
#!/bin/sh 

## Has this command been run before?
if [ -r /tmp/results ]
then
## yes, destroy old results
        rm /tmp/results
fi

echo You need root permissions to run this program.

## get new path to *.deb binaries
## For non-Debian releases, change this next line
echo What is the path to the binaries? "[*.deb]"
read DEBPATH

## Check for empty input
if [ -z $DEBPATH ]
then
        exit 0
fi

## Let's check the validity of the path
if [ ! -d $DEBPATH ]
then
        echo The path $DEBPATH is not valid directory. Exiting...
        exit 0
fi

## create new directory listing from path and filter out non-*.deb files
ls --width=1 $DEBPATH > /tmp/directory
## For non-Debian releases, change this next line
cat /tmp/directory | grep "deb" > /tmp/direct

## check for valid *.deb packages
read PACKAGE < /tmp/direct
if [ -z $PACKAGE ]
then
## For non-Debian releases, change this next line
        echo No "*.deb" packages in directory $DEBPATH. Exiting...
        exit 0
fi

## walk through each entry and evaluate
for DEB in `cat /tmp/direct`
do
        echo Checking $DEBPATH/$DEB now ------------
        echo Checking $DEB ---- >> /tmp/results
## For non-Debian releases, change this next line
## dpkg is the package managing program which is issued a "content"
## option. If the package is corrupted, 'dpkg' will issue an error
## message (via stderr) which we will log.
## The stdout path is dumped into the "bit-bucket" 8-)
        dpkg --contents $DEBPATH/$DEB > /dev/null 2>> /tmp/results
done

## announce that we are finished
echo Finished! Check the file "/tmp/results" for bad packages.

## And clean up after ourself
rm /tmp/direc*


-- 
-= Sent by Debian Linux =-
Thomas Kocourek  KD4CIK
[EMAIL PROTECTED]


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED]

Reply via email to