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

Re: verify script for Debian packages



 > 2 Nov 1996 11:52:27 -0000
 > Date: Sat, 2 Nov 1996 02:19:15 -0800
 > Message-Id: <199611021019.CAA11643@gigan.extern.ucsd.edu>

 > From: no.junk.mail@see.message.body
 > Subject: verify script for Debian packages

 > Having gotten nervous after almost losing my file system last week, I 
 > wrote a little perl script to go through the file lists in 
 > /var/lib/dpkg/info and check to see that the files are where they're 
 > supposed to be.

 > To use: move everything from the #!/usr/bin/perl line to the end to a 
 > file named "dpkg-verify", in whatever directory you like--/usr/sbin is 
 > where I put this on my system.  Run without arguments, it gives a usage 
 > message that should be pretty self-explanatory.

 > #-/usr/bin/perl --
 > #
 > # THIS quoted SCRIPT TRUNCATED for sake of brevity in this mailing list.
 > #
 > # Please see
 > #
 > # Message-Id: <199611021019.CAA11643@gigan.extern.ucsd.edu>
 > # For the cannonical version of this script.  -tingri@ntplx.net
 > #
 > # $Id: dpkg-verify,v 1.4 1996-10-31 13:35:25-08 gobbel Exp $
 > #
 > # dpkg-verify: Given a list of packages, check to see if any of their files
 > # are missing.  If so, optionally mark the associated package as requiring
 > # reinstallation, and produce a report listing the missing files.  Currently
 > # no way to check that the files are actually correct, only that they exist.
 > # NOTE: the "mark" option is currently unimplemented, and may be a bad idea.
 >
 > sub usage {
 >     print STDERR <<END;
 > Usage: dpkg-verify <opts> <package name> ...
 >
 > Options:  -v|--verbose   Output package names as they are processed.
 >           -m|--mark-bad  Mark packages with files missing as requiring
 >                          reinstallation (unimplemented, dangerous).
 >           -l|--list      List missing files to stdout.
 >           -a|--all       Check all installed packages.
 > END
 > }
 > THIS quoted SCRIPT TRUNCATED for sake of brevity in this mailing list.

Thank you.  It's nice.  Food for thought.

Session log follows (if I'd used tf in a telnet session to the shell, 
and then su root, what follows is what tf would have logged, including 
user input.)

(/root/perl is in root's PATH, for the below).

tingrid # pwd
/root/perl

# tingrid cat do.a.dpkg-verify.job.sh

#!/bin/sh
# script name: /root/perl/do.a.dpkg-verify.job.sh
#
# Will not do anything useful if this next line is omitted:
cd /var/lib/dpkg/info

dpkg-verify --verbose CGI-modules
dpkg-verify --verbose acct
dpkg-verify --verbose adduser
dpkg-verify --verbose ae
dpkg-verify --verbose amd
dpkg-verify --verbose aout-xpm
dpkg-verify --verbose apache
dpkg-verify --verbose ash
dpkg-verify --verbose at
dpkg-verify --verbose autoconf
dpkg-verify --verbose automake
dpkg-verify --verbose axe

etc.

tingrid # pwd
/root/perl
tingrid # ./do.a.dpkg.job.sh > tail.messages &
tingrid # tail -f tail.messages

Ok: CGI-modules
Ok: acct
Ok: adduser
Ok: ae
Ok: amd
Ok: aout-xpm
Ok: apache
Ok: ash
Ok: at
Ok: autoconf
Ok: automake
***Broken package: axe
Missing files:
/usr/X11R6/bin/axe
/usr/X11R6/bin/coaxe
/usr/X11R6/bin/faxe
/usr/X11R6/bin/poleaxe
/usr/X11R6/bin/axinfo
/usr/X11R6/man/man1/axe.1x
/usr/X11R6/man/man1/axinfo.1x
/usr/X11R6/lib/X11/app-defaults/Axe
/usr/X11R6/lib/X11/app-defaults/Axinfo
/usr/X11R6/lib/X11/axe.tcl

etc.

tingrid # pwd
/root/perl

Christopher W. Hafey
-------------------------------------------------------------
tingri@ntplx.net               | 1078 New Britain Ave Apt 217
WA1TNR since 1974              | W Hartford Ct USA 06110-2434
http://www.ntplx.net/~tingri   | tel. 860-236-5400
-------------------------------------------------------------

--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: