X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=dak%2Fexamine_package.py;h=ba2855d4aacdc3f9f567aca92b5c8d4f17e9fe0e;hb=90abdae94d533312f37173a0192f47cbfe42872f;hp=7abcb3190b736fc17ee85c3e32d29098c7a9eb31;hpb=e2ae71066cbb134753d7bfceb16e87d0b76dfd6e;p=dak.git diff --git a/dak/examine_package.py b/dak/examine_package.py index 7abcb319..ba2855d4 100755 --- a/dak/examine_package.py +++ b/dak/examine_package.py @@ -32,10 +32,9 @@ ################################################################################ -import errno, os, re, sys -import utils +import errno, os, pg, re, sys, md5 import apt_pkg, apt_inst -import pg, database +import daklib.database, daklib.utils ################################################################################ @@ -83,6 +82,8 @@ Cnf = daklib.utils.get_conf() projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])) daklib.database.init(Cnf, projectB) +printed_copyrights = {} + ################################################################################ def usage (exit_code=0): @@ -303,7 +304,15 @@ def print_copyright (deb_filename): return o = os.popen("ar p %s data.tar.gz | tar xzOf - %s" % (deb_filename, copyright)) - print o.read() + copyright = o.read() + copyrightmd5 = md5.md5(copyright).hexdigest() + + if printed_copyrights.has_key(copyrightmd5): + print "Copyright is the same as %s.\n" % \ + (printed_copyrights[copyrightmd5]) + else: + print copyright + printed_copyrights[copyrightmd5] = "%s (%s)" % (package, deb_filename) def check_dsc (dsc_filename): print "---- .dsc file for %s ----" % (dsc_filename)