import sys
from tempfile import mkdtemp
from os import mkdir, system
+import os.path
import rpm
def compare_header(refspec, altspec):
+ warnings = []
+
refhdr = refspec.packages()[0].header()
althdr = altspec.packages()[0].header()
alturl = althdr[rpm.RPMTAG_URL]
if refver != altver:
- print "WARNING: different version: '%s': '%s' != '%s': '%s'" % (refname, refver, altname, altver)
+ warnings.append("different version: '%s': '%s' != '%s': '%s'" % (refname, refver, altname, altver))
if refver != altver:
- print "WARNING: different license: '%s': '%s' != '%s': '%s'" % (refname, reflic, altname, altlic)
+ warnings.append("different license: '%s': '%s' != '%s': '%s'" % (refname, reflic, altname, altlic))
if refver != altver:
- print "WARNING: different URL: '%s': '%s' != '%s': '%s'" % (refname, refurl, altname, alturl)
+ warnings.append("different URL: '%s': '%s' != '%s': '%s'" % (refname, refurl, altname, alturl))
+
+ return warnings
def compare_sources(refspec, altspec):
+ warnings = []
refsrc = []
altsrc = []
refsrcname = []
for s in refsrc:
if not s[1] in altsrcname:
- print "WARNING: missing source: '%s'" % s[1]
+ warnings.append("missing source: '%s'" % s[1])
for s in altsrc:
if not s[1] in refsrcname:
- print "WARNING: extra source: '%s'" % s[1]
+ warnings.append("extra source: '%s'" % s[1])
for s1 in refsrc:
for s2 in altsrc:
if s1[1] != s2[1]:
continue
if s1[0] != s2[0]:
- print "WARNING: different base URI for source '%s': '%s' != '%s'" % (s1[1], s1[0], s2[0])
+ warnings.append("different base URI for source '%s': '%s' != '%s'" % (s1[1], s1[0], s2[0]))
+
+ return warnings
def compare_patches(refspec, altspec):
+ warnings = []
refpatch = []
altpatch = []
for src in refspec.sources():
for p in refpatch:
if not p in altpatch:
- print "WARNING missing patch '%s'" % p
+ warnings.append("missing patch '%s'" % p)
for p in altpatch:
if not p in refpatch:
- print "WARNING extra patch '%s'" % p
+ warnings.append("extra patch '%s'" % p)
+
+ return warnings
+
+
+def compare_specs(refspec, altspec):
+ warnings = []
+
+ for w in compare_header(refspec, altspec):
+ warnings.append(w)
+ for w in compare_sources(refspec, altspec):
+ warnings.append(w)
+ for w in compare_patches(refspec, altspec):
+ warnings.append(w)
+
+ return warnings
+
+def load_suppressions(file):
+ if not os.path.exists(file):
+ return []
+
+ supp = []
+ s = open(suppressionfile)
+ try:
+ while 1:
+ line = s.readline()
+ if not line:
+ break;
+
+ line = line[0:-1]
+ supp.append(line)
+ finally:
+ s.close()
+
+ return supp
+
+
scratchdir = mkdtemp("rpm-source-compare")
-if len(sys.argv) != 3:
- print "syntax: %s REFERENCE-SPEC ALTERNATE-SPEC" % sys.argv[0]
+if len(sys.argv) != 4:
+ print "syntax: %s REFERENCE-SPEC ALTERNATE-SPEC SUPPRESSIONS" % sys.argv[0]
sys.exit(1)
refspecfile = sys.argv[1]
altspecfile = sys.argv[2]
+suppressionfile = sys.argv[3]
ts = rpm.ts()
refspec = ts.parseSpec(refspecfile)
altspec = ts.parseSpec(altspecfile)
+suppressions = load_suppressions(suppressionfile)
+
+
+warnings = compare_specs(refspec, altspec)
-compare_header(refspec, altspec)
-compare_sources(refspec, altspec)
-compare_patches(refspec, altspec)
+for w in warnings:
+ if not w in suppressions:
+ print "WARNING %s" % w
--- /dev/null
+missing source: 'gdb-gstack.man'
+missing source: 'gdb-orphanripper.c'
+different base URI for source 'gdb-6.8.tar.bz2': 'ftp://sourceware.org/pub/gdb/releases' != 'http://dl.sourceforge.net/sourceforge/mingw'
+missing patch 'gdb-6.8-breakpoint-gone.patch'
+missing patch 'gdb-6.8-attach-signalled-detach-stopped.patch'
+missing patch 'gdb-6.8-attach-signalled-upstream.patch'
+missing patch 'gdb-6.8-ctors-dtors-unique.patch'
+missing patch 'gdb-6.8-fortran-module-ignore.patch'
+missing patch 'gdb-6.8-fortran-tag-constant.patch'
+missing patch 'gdb-6.8-quit-never-aborts.patch'
+missing patch 'gdb-6.8-bz436037-reg-no-longer-active.patch'
+missing patch 'gdb-6.8-bz254229-gcore-prpsinfo.patch'
+missing patch 'gdb-6.8-inlining-by-name.patch'
+missing patch 'gdb-6.8-inlining.patch'
+missing patch 'gdb-6.8-tui-singlebinary.patch'
+missing patch 'gdb-6.8-forced-enable-tui.patch'
+missing patch 'gdb-6.8-glibc-headers-compat.patch'
+missing patch 'gdb-6.8-disable-randomization.patch'
+missing patch 'gdb-6.8-constant-watchpoints.patch'
+missing patch 'gdb-6.8-auto-dependencies.patch'
+missing patch 'gdb-6.5-section-num-fixup-test.patch'
+missing patch 'gdb-6.8-gcc35998-ada-memory-trash.patch'
+missing patch 'gdb-6.8-sparc64-silence-memcpy-check.patch'
+missing patch 'gdb-6.8-sparc-fix.patch'
+missing patch 'gdb-6.8-bz442765-threaded-exec-test.patch'
+missing patch 'gdb-6.3-watchpoint-cond-gone-test.patch'
+missing patch 'gdb-6.3-focus-cmd-prev-test.patch'
+missing patch 'gdb-6.3-mapping-zero-inode-test.patch'
+missing patch 'gdb-6.8-watchpoint-inaccessible-memory.patch'
+missing patch 'gdb-6.8-bz377541-fortran-dynamic-arrays.patch'
+missing patch 'gdb-6.7-kernel-headers-compat.patch'
+missing patch 'gdb-6.6-buildid-readnever-silent.patch'
+missing patch 'gdb-6.6-threads-static-test.patch'
+missing patch 'gdb-6.5-gcore-buffer-limit-test.patch'
+missing patch 'gdb-6.7-bz426600-DW_TAG_interface_type-test.patch'
+missing patch 'gdb-6.7-bz426600-DW_TAG_interface_type-fix.patch'
+missing patch 'gdb-6.5-missed-trap-on-step-test.patch'
+missing patch 'gdb-6.5-ia64-libunwind-leak-test.patch'
+missing patch 'gdb-6.7-testsuite-stable-results.patch'
+missing patch 'gdb-6.7-ppc-clobbered-registers-O2-test.patch'
+missing patch 'gdb-6.7-reread-exec_bfd.patch'
+missing patch 'gdb-6.7-charsign-test.patch'
+missing patch 'gdb-6.6-multifork-debugreg.patch'
+missing patch 'gdb-6.6-vdso-i386-on-amd64-warning.patch'
+missing patch 'gdb-6.6-buildid-locate.patch'
+missing patch 'gdb-6.5-bz243845-stale-testing-zombie-test.patch'
+missing patch 'gdb-6.6-bz247354-leader-exit-test.patch'
+missing patch 'gdb-6.6-bz247354-leader-exit-fix.patch'
+missing patch 'gdb-6.3-attach-see-vdso-test.patch'
+missing patch 'gdb-6.6-readline-system.patch'
+missing patch 'gdb-6.6-bz237572-ppc-atomic-sequence-test.patch'
+missing patch 'gdb-6.6-testsuite-timeouts.patch'
+missing patch 'gdb-6.6-gcore32-test.patch'
+missing patch 'gdb-6.6-bz235197-fork-detach-info.patch'
+missing patch 'gdb-6.6-bz229517-gcore-without-terminal.patch'
+missing patch 'gdb-6.6-bz225783-gdb-debuginfo-paths.patch'
+missing patch 'gdb-6.6-bz225783-prelink-path.patch'
+missing patch 'gdb-6.3-bz231832-obstack-2gb.patch'
+missing patch 'gdb-6.6-bz230000-power6-disassembly-test.patch'
+missing patch 'gdb-6.8-upstream.patch'
+missing patch 'gdb-6.3-bz202689-exec-from-pthread-test.patch'
+missing patch 'gdb-6.3-bz140532-ppc-unwinding-test.patch'
+missing patch 'gdb-6.5-bz109921-DW_AT_decl_file-test.patch'
+missing patch 'gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch'
+missing patch 'gdb-6.5-bz218379-ppc-solib-trampoline-test.patch'
+missing patch 'gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch'
+missing patch 'gdb-6.5-bz216711-clone-is-outermost.patch'
+missing patch 'gdb-6.5-readline-long-line-crash-test.patch'
+missing patch 'gdb-6.5-readline-long-line-crash.patch'
+missing patch 'gdb-6.5-BEA-testsuite.patch'
+missing patch 'gdb-6.5-last-address-space-byte-test.patch'
+missing patch 'gdb-6.5-gcore-i386-on-amd64.patch'
+missing patch 'gdb-6.5-bz181390-memory-address-width.patch'
+missing patch 'gdb-6.5-bz190810-gdbserver-arch-advice.patch'
+missing patch 'gdb-6.5-sharedlibrary-path.patch'
+missing patch 'gdb-6.5-tls-of-separate-debuginfo.patch'
+missing patch 'gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch'
+missing patch 'gdb-6.5-dwarf-stack-overflow.patch'
+missing patch 'gdb-6.5-bz203661-emit-relocs.patch'
+missing patch 'gdb-6.5-bz196439-valgrind-memcheck-compat-test.patch'
+missing patch 'gdb-6.3-ia32el-fix-waitpid-20060615.patch'
+missing patch 'gdb-6.3-catch-debug-registers-error-20060527.patch'
+missing patch 'gdb-6.3-gstack-without-path-20060414.patch'
+missing patch 'gdb-6.3-large-core-20051206.patch'
+missing patch 'gdb-6.3-bt-past-zero-20051201.patch'
+missing patch 'gdb-6.3-ia64-sigill-20051115.patch'
+missing patch 'gdb-6.3-ia64-sigtramp-fp-20050926.patch'
+missing patch 'gdb-6.3-readnever-20050907.patch'
+missing patch 'gdb-6.3-inheritancetest-20050726.patch'
+missing patch 'gdb-6.3-ia64-info-frame-fix-20050725.patch'
+missing patch 'gdb-6.3-inferior-notification-20050721.patch'
+missing patch 'gdb-6.3-ia64-gcore-speedup-20050714.patch'
+missing patch 'gdb-6.3-ia64-sigtramp-frame-20050708.patch'
+missing patch 'gdb-6.3-security-errata-20050610.patch'
+missing patch 'gdb-6.3-ia64-gcore-page0-20050421.patch'
+missing patch 'gdb-6.3-sepcrc-20050402.patch'
+missing patch 'gdb-6.3-test-sepcrc-20050402.patch'
+missing patch 'gdb-6.3-inheritance-20050324.patch'
+missing patch 'gdb-6.3-warnings-20050317.patch'
+missing patch 'gdb-6.3-threaded-watchpoints2-20050225.patch'
+missing patch 'gdb-6.3-terminal-fix-20050214.patch'
+missing patch 'gdb-6.3-step-thread-exit-20050211-test.patch'
+missing patch 'gdb-6.6-step-thread-exit.patch'
+missing patch 'gdb-6.3-gcore-thread-20050204.patch'
+missing patch 'gdb-6.3-dwattype0-20050201.patch'
+missing patch 'gdb-6.3-test-movedir-20050125.patch'
+missing patch 'gdb-6.3-dtorfix-20050121.patch'
+missing patch 'gdb-6.3-test-dtorfix-20050121.patch'
+missing patch 'gdb-6.3-nonthreaded-wp-20050117.patch'
+missing patch 'gdb-6.3-test-self-20050110.patch'
+missing patch 'gdb-6.3-pie-20050110.patch'
+missing patch 'gdb-6.3-test-pie-20050107.patch'
+missing patch 'gdb-6.3-type-fix-20041213.patch'
+missing patch 'gdb-6.3-gstack-20050411.patch'
+missing patch 'gdb-6.3-removebp-20041130.patch'
+missing patch 'gdb-6.3-linespec-20041213.patch'
+missing patch 'gdb-6.6-scheduler_locking-step-is-default.patch'
+missing patch 'gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch'
+missing patch 'gdb-6.3-ppc64displaysymbol-20041124.patch'
+missing patch 'gdb-6.3-framepczero-20040927.patch'
+missing patch 'gdb-6.3-ppc64syscall-20040622.patch'
+missing patch 'gdb-6.3-ppcdotsolib-20041022.patch'
+missing patch 'gdb-6.3-sigx86-20040621.patch'
+missing patch 'gdb-6.3-rh-testlibunwind1fix-20041202.patch'
+missing patch 'gdb-6.3-rh-testlibunwind-20041202.patch'
+missing patch 'gdb-6.3-rh-testversion-20041202.patch'
+missing patch 'gdb-6.3-rh-dummykfail-20041202.patch'
+extra patch 'mingw-gdb-6.8-no-getcwd-error.patch'