* [gentoo-commits] portage r13982 - main/trunk/bin
@ 2009-08-10 22:05 Zac Medico (zmedico)
0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-08-10 22:05 UTC (permalink / raw
To: gentoo-commits
Author: zmedico
Date: 2009-08-10 22:05:36 +0000 (Mon, 10 Aug 2009)
New Revision: 13982
Removed:
main/trunk/bin/chkcontents
Log:
This old script does checksums on installed files. People use equery for this
now.
Deleted: main/trunk/bin/chkcontents
===================================================================
--- main/trunk/bin/chkcontents 2009-08-10 21:56:23 UTC (rev 13981)
+++ main/trunk/bin/chkcontents 2009-08-10 22:05:36 UTC (rev 13982)
@@ -1,66 +0,0 @@
-#!/usr/bin/python
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# Very simple program to compare the md5sums of a package as listed
-# in VDB_PATH/category/package/CONTENTS with the md5sums of the
-# actual programs on the system (and makes sure that symlinks point to
-# the right files).
-
-import os.path, os, sys
-try:
- import portage
-except ImportError:
- from os import path as osp
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
-
-def CONTENTScheck(path):
- try:
- contents = open(path, "r")
- except IOError, e:
- print "Unable to open %s: %s" % (path, e)
- sys.exit(1)
- lines = contents.readlines()
- for line in lines:
- items = line.split()
- # items is a list w/ size depending on the type of item listed in item[0]
- # if items[0] = 'dir' then items[1] is the path of a directory
- # if items[0] = 'obj' then items[1] is the path of a file,
- # items[2] is the file's md5sum,
- # items[3] is the file's size
- # if items[0] = 'sym' then items[1] is the path of a symbolic link,
- # items[2] is '->'
- # items[3] is the file the symlink should point to
- # items[4] is the symlink mtime
- if (items[0] == 'obj'):
- md5stored = items[2].lower()
- # fchksum.fmdft(file) returns the file's md5sum and the file's size
- md5real = portage.perform_checksum(items[1])[0].lower()
- if (md5stored != md5real):
- if md5real:
- print "%s has md5sum of %s instead of %s" % (items[1], md5real, md5stored)
- else:
- print "%s is missing!" % items[1]
- elif (items[0] == 'sym'):
- link = items[1]
- target = items[3]
- if (not os.path.islink(link)):
- print "%s is not a symbolic link" % link
- continue
- actualtarget = os.readlink(link)
- if (os.path.normpath(actualtarget) != os.path.normpath(target)):
- print "%s points to %s, not %s" % (link, actualtarget, target)
-
-
-if __name__ == '__main__':
- import sys
- if (len(sys.argv) != 2 or sys.argv[1] == "--help"):
- print "This program compares md5sums in the file VDB_PATH/category/package/CONTENTS"
- print "with the md5sums of the actual files on the filesystem"
- print "(and makes sure that symlinks point to the right files)."
- print "\nUsage: chkcontents path/to/CONTENTS"
- sys.exit(1)
- CONTENTScheck(sys.argv[1])
-
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-10 22:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-10 22:05 [gentoo-commits] portage r13982 - main/trunk/bin Zac Medico (zmedico)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox