diff -Nru update-manager-0.87.30/debian/changelog update-manager-0.87.31~ppa1h/debian/changelog --- update-manager-0.87.30/debian/changelog 2008-07-30 13:41:06.000000000 +0100 +++ update-manager-0.87.31~ppa1h/debian/changelog 2008-08-04 07:14:17.000000000 +0100 @@ -1,3 +1,10 @@ +update-manager (1:0.87.31~ppa1h) hardy; urgency=low + + * Added support for displaying PPA changelogs (fixes LP: #254552) + * debian/rules: added basic patch support + + -- TJ Mon, 4 Aug 2008 06:30:00 +0100 + update-manager (1:0.87.30) hardy-proposed; urgency=low * DistUpgrade/DistUpgradeCache.py: diff -Nru update-manager-0.87.30/debian/control update-manager-0.87.31~ppa1h/debian/control --- update-manager-0.87.30/debian/control 2008-04-28 14:44:32.000000000 +0100 +++ update-manager-0.87.31~ppa1h/debian/control 2008-08-04 06:54:27.000000000 +0100 @@ -2,7 +2,8 @@ Section: gnome Priority: optional XS-Python-Version: all -Maintainer: Michael Vogt +Maintainer: TJ +XSBC-Original-Maintainer: Michael Vogt Build-Depends: debhelper (>= 5.0.38), python-all-dev, python-central (>= 0.5.6), python-kde3-dev, python-distutils-extra (>= 1.90), python-apt (>= 0.6.20ubuntu12), lsb-release Build-Depends-Indep: libxml-parser-perl, scrollkeeper, intltool Standards-Version: 3.7.2 diff -Nru update-manager-0.87.30/debian/patches/01_read_ppa_changelogs.patch update-manager-0.87.31~ppa1h/debian/patches/01_read_ppa_changelogs.patch --- update-manager-0.87.30/debian/patches/01_read_ppa_changelogs.patch 1970-01-01 01:00:00.000000000 +0100 +++ update-manager-0.87.31~ppa1h/debian/patches/01_read_ppa_changelogs.patch 2008-08-04 06:32:07.000000000 +0100 @@ -0,0 +1,64 @@ +--- update-manager-0.87.30.orig/UpdateManager/UpdateManager.py 2008-06-20 18:15:41.000000000 +0100 ++++ update-manager-0.87.30/UpdateManager/UpdateManager.py 2008-08-04 06:22:51.000000000 +0100 +@@ -249,7 +249,11 @@ + self.all_changes[name] = [alllines, srcpkg] + except urllib2.HTTPError: + if lock.locked(): +- self.all_changes[name] = [_("The list of changes is not " ++ alllines = self.get_ppa_changelog(name) ++ if (len(alllines) > 0): ++ self.all_changes[name] = [alllines, srcpkg] ++ else: ++ self.all_changes[name] = [_("The list of changes is not " + "available yet.\nPlease try again " + "later."), srcpkg] + except IOError, httplib.BadStatusLine: +@@ -261,6 +265,48 @@ + if lock.locked(): + lock.release() + ++ ++ def scrape_ppa_changelog(self, name, uri, username): ++ pkg = self[name] ++ html = urllib2.urlopen(uri) ++ unique = "id=\"%s_%s\"" % (pkg.sourcePackageName, pkg.candidateVersion) ++ pre_end = "" ++ alllines = "" ++ capture = False ++ for line in html.readlines(): ++ if (capture == True): ++ end = line.find(pre_end) ++ if (-1 < end): ++ alllines = alllines + "(from PPA %s - %s)" % (username, uri) ++ break ++ else: ++ alllines = alllines + line ++ else: ++ index = line.find(unique) ++ if (-1 < index and capture == False): ++ alllines = alllines + line[index+len(unique)+1:] ++ capture = True ++ return alllines ++ ++ def get_ppa_changelog(self, name): ++ PPA_CHANGELOGS_URI="https://launchpad.net/~%s/+archive" ++ pkg = self[name] ++ alllines = "" ++ origin = pkg.candidateOrigin[0] ++ if (origin.site == "ppa.launchpad.net"): ++ path = apt_pkg.ParseSection(pkg._records.Record)["Filename"] ++ cand = pkg._depcache.GetCandidateVer(pkg._pkg) ++ for (packagefile,i) in cand.FileList: ++ indexfile = self._list.FindIndex(packagefile) ++ if indexfile: ++ uri = indexfile.ArchiveURI(path) ++ match = re.match("^http.*//ppa.launchpad.net/(.*?)/.*$",uri) ++ if match: ++ username = match.group(1) ++ uri = PPA_CHANGELOGS_URI % username ++ alllines = self.scrape_ppa_changelog(name, uri, username) ++ return alllines ++ + class UpdateList: + class UpdateOrigin: + def __init__(self, desc, importance): diff -Nru update-manager-0.87.30/debian/rules update-manager-0.87.31~ppa1h/debian/rules --- update-manager-0.87.30/debian/rules 2008-05-07 19:49:09.000000000 +0100 +++ update-manager-0.87.31~ppa1h/debian/rules 2008-08-04 06:56:10.000000000 +0100 @@ -10,14 +10,41 @@ PYVERS=$(shell pyversions -vr) -build: build-stamp +# Apply patches to the package +patch: patch-stamp +patch-stamp: + dh_testdir + @patches=debian/patches/*.patch; for patch in $$patches; do \ + test -f $$patch || continue; \ + echo "Applying $$patch"; \ + patch -stuN -p1 < $$patch || exit 1; \ + done + touch $@ + +# Remove patches from the package +unpatch: + dh_testdir + @if test -f patch-stamp; then \ + patches=debian/patches/*.patch; \ + for patch in $$patches; do \ + reversepatches="$$patch $$reversepatches"; \ + done; \ + for patch in $$reversepatches; do \ + test -f $$patch || continue; \ + echo "Reversing $$patch"; \ + patch -suRf -p1 < $$patch || exit 1; \ + done; \ + rm -f patch-stamp; \ + fi + +build: patch-stamp build-stamp build-stamp: $(PYVERS:%=build-python%) build-python%: dh_testdir python$* setup.py build touch $@ -clean: +clean: unpatch dh_testdir dh_testroot rm -f build-stamp @@ -93,4 +120,4 @@ tar -c --exclude=arch-build --no-recursion -f - `bzr inventory` | (cd debian/arch-build/$(PKG)-$(DEBVER);tar xf -) (cd debian/arch-build/$(PKG)-$(DEBVER) && $(DEB_BUILD_PROG)) -.PHONY: build clean binary-indep binary-arch binary install arch-build +.PHONY: patch unpatch build clean binary-indep binary-arch binary install arch-build