]> git.decadent.org.uk Git - dak.git/commitdiff
Merge remote-tracking branch 'lamby/misc-fixes-796786' into merge
authorJoerg Jaspert <joerg@debian.org>
Thu, 10 Sep 2015 20:07:55 +0000 (22:07 +0200)
committerJoerg Jaspert <joerg@debian.org>
Thu, 10 Sep 2015 20:07:55 +0000 (22:07 +0200)
* lamby/misc-fixes-796786:
  daklib/utils.py: mandantory -> mandatory spelling error
  daliblib/dak_exceptions: Add trailing comma to avoid future VCS noise
  tests/test_packagelist.py: make executable
  dalkib/dbconn.py: Mention which version is installed in sqlalchemy check
  dak/copy_installer.py: Include which directory doesn't exist in exception

18 files changed:
config/debian/cron.dinstall
config/debian/dinstall.functions
dak/auto_decruft.py
dak/generate_releases.py
daklib/policy.py
debian/changelog
debian/compat [new file with mode: 0644]
debian/control
debian/postinst [deleted file]
debian/python-dep [deleted file]
debian/rules
debian/source/format [new file with mode: 0644]
docs/README.stable-point-release
scripts/debian/byhand-di
tests/fixtures/changes/two-beginnings.changes [deleted file]
tests/fixtures/dsc/8.dsc [new file with mode: 0644]
tests/fixtures/dsc/9.dsc [new file with mode: 0644]
tests/test_parse_changes.py

index 3d573b5bead39a010c1378bb5e75492be31b5656..4e8c1f2849bc73f1c42e12560710f1f311ed5277 100755 (executable)
@@ -74,6 +74,8 @@ function stage() {
     error=${ERR:-"true"}
 
     ARGS=${ARGS:-""}
+
+    log "########## DINSTALL BEGIN: ${FUNC} ${ARGS} ##########"
     STAGEFILE="${stagedir}/${FUNC}_${ARGS}"
     STAGEFILE=${STAGEFILE// /_}
     if [ -f "${STAGEFILE}" ]; then
@@ -132,6 +134,8 @@ function stage() {
     cat "${STAGEFILE}.log" >> "${LOGFILE}"
     rm -f "${STAGEFILE}.log"
 
+    echo "########## DINSTALL END: ${FUNC} ##########"
+
     if [ -f "${LOCK_STOP}" ]; then
         log "${LOCK_STOP} exists, exiting immediately"
         exit 42
index 6abf1b84f9cec4a033a9c257bb8582d6b2f6c7ba..ae621185266560cfcd1a391a731b95dde40866d0 100644 (file)
@@ -458,7 +458,7 @@ function mirrorpush() {
         while read SHASUM SIZE NAME; do
             if ! [ -f "${subdir}/${NAME}" ]; then
                bname=$(basename ${NAME})
-                if [[ "${bname}" =~ ^(Packages|Sources|Translation-[a-zA-Z_]+)$ ]]; then
+                if [[ "${bname}" =~ ^(Packages|Sources|Contents-[a-zA-Z0-9-]+|Translation-[a-zA-Z_]+)$ ]]; then
                     # We don't keep unpacked files, don't check for their existance.
                     # We might want to go and check their unpacked shasum, but right now
                     # I don't care. I believe it should be enough if all the packed shasums
index e08e793b11af1d0a6b5b11f9d9d11d950c3a065c..66479a47fd863f155257a37c9d3bfdf61c9d7bdd 100644 (file)
@@ -219,15 +219,15 @@ def auto_decruft_suite(suite_name, suite_id, session, dryrun, debug):
     )
     for group in group_generator:
         group_name = group["name"]
+        pkgs = group["packages"]
+        affected_archs = group["architectures"]
+        # If we remove an arch:all package, then the breakage can occur on any
+        # of the architectures.
+        if "all" in affected_archs:
+            affected_archs = all_architectures
+        for pkg_arch in product(pkgs, affected_archs):
+            pkg_arch2groups[pkg_arch].add(group_name)
         if group_name not in groups:
-            pkgs = group["packages"]
-            affected_archs = group["architectures"]
-            # If we remove an arch:all package, then the breakage can occur on any
-            # of the architectures.
-            if "all" in affected_archs:
-                affected_archs = all_architectures
-            for pkg_arch in product(pkgs, affected_archs):
-                pkg_arch2groups[pkg_arch].add(group_name)
             groups[group_name] = group
             group_order.append(group_name)
         else:
index ba7976873c6ef0b853695450338ae56d92d13d57..2814b24a61b7ea78eea776367fe518d7fbf1d6dd 100755 (executable)
@@ -70,7 +70,7 @@ Generate the Release files
   -h, --help                 show this help and exit
   -q, --quiet                Don't output progress
 
-SUITE can be a space seperated list, e.g.
+SUITE can be a space separated list, e.g.
    --suite=unstable testing
   """
     sys.exit(exit_code)
@@ -246,11 +246,11 @@ class ReleaseWriter(object):
                 # If we find a file for which we have a compressed version and
                 # haven't yet seen the uncompressed one, store the possibility
                 # for future use
-                if entry.endswith(".gz") and entry[:-3] not in uncompnotseen.keys():
+                if entry.endswith(".gz") and filename[:-3] not in uncompnotseen:
                     uncompnotseen[filename[:-3]] = (gzip.GzipFile, filename)
-                elif entry.endswith(".bz2") and entry[:-4] not in uncompnotseen.keys():
+                elif entry.endswith(".bz2") and filename[:-4] not in uncompnotseen:
                     uncompnotseen[filename[:-4]] = (bz2.BZ2File, filename)
-                elif entry.endswith(".xz") and entry[:-3] not in uncompnotseen.keys():
+                elif entry.endswith(".xz") and filename[:-3] not in uncompnotseen:
                     uncompnotseen[filename[:-3]] = (XzFile, filename)
 
                 fileinfo[filename]['len'] = len(contents)
@@ -261,12 +261,7 @@ class ReleaseWriter(object):
         for filename, comp in uncompnotseen.items():
             # If we've already seen the uncompressed file, we don't
             # need to do anything again
-            if filename in fileinfo.keys():
-                continue
-
-            # Skip uncompressed Contents files as they're huge, take ages to
-            # checksum and we checksum the compressed ones anyways
-            if os.path.basename(filename).startswith("Contents"):
+            if filename in fileinfo:
                 continue
 
             fileinfo[filename] = {}
index 3c986c8071d678d2e74187785e8d584dcd936958..aa5f12f0ac141e10e04552c11449ff842618cea2 100644 (file)
@@ -87,7 +87,7 @@ class UploadCopy(object):
             for byhand in self.upload.byhand:
                 src = os.path.join(queue.path, byhand.filename)
                 dst = os.path.join(directory, byhand.filename)
-                if not os.path.exists(dst) or not ignore_existing:
+                if os.path.exists(src) and (not os.path.exists(dst) or not ignore_existing):
                     fs.copy(src, dst, mode=mode, symlink=symlink)
 
             # copy .changes
index 5213b3577e8b5bc07eebf63ef80ddab088d7df29..c126f3f57545e3573b58a30aff3380229ce4f0ae 100644 (file)
@@ -1,8 +1,6 @@
-dak (0notforuse0-0) unstable; urgency=low
+dak (0notforuse0) unstable; urgency=low
 
   * Initial non-release.  [The packaging is nowhere near complete; don't
     bother trying to use it unaltered.]
 
  -- James Troup <james@nocrew.org>  Tue, 16 May 2006 21:55:42 -0500
-
-
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
index 0402264bcdee6b8867192897185500c7e6a8f22a..f9a5e713cf6f8e518249f7797dcd927538a4c902 100644 (file)
@@ -1,16 +1,39 @@
 Source: dak
 Section: misc
 Priority: extra
-Build-Depends: python-all-dev
+Build-Depends: python-all-dev,
+               python-apt,
+               python-debian,
+               python-debianbts,
+               python-ldap,
+               python-psycopg2,
+               python-rrdtool,
+               python-sqlalchemy (<< 1.0),
+               python-yaml
 Maintainer: Debian FTP-Masters <ftpmaster@debian.org>
-Uploaders: Mark Hymers <mhy@debian.org>, Joerg Jaspert <joerg@debian.org>, Torsten Werner <twerner@debian.org>
-Standards-Version: 3.9.2
+Uploaders: Mark Hymers <mhy@debian.org>,
+           Joerg Jaspert <joerg@debian.org>,
+           Torsten Werner <twerner@debian.org>
+Standards-Version: 3.9.6.0
 
 Package: dak
 Architecture: all
-Depends: ${python:Depends}, python-psycopg2, python-sqlalchemy, python-apt,
-         gnupg, dpkg-dev, lintian, binutils-multiarch, python-yaml, less,
-         python-ldap, python-pyrss2gen, python-rrdtool, symlinks
+Depends: binutils-multiarch,
+         dpkg-dev,
+         gnupg,
+         less,
+         lintian,
+         python-apt,
+         python-debian,
+         python-debianbts,
+         python-ldap,
+         python-psycopg2,
+         python-pyrss2gen,
+         python-rrdtool,
+         python-sqlalchemy (<< 1.0),
+         python-yaml,
+         symlinks,
+         ${python:Depends}
 Description: Debian's archive maintenance scripts
  This is a collection of archive maintenance scripts used by the
  Debian project.
diff --git a/debian/postinst b/debian/postinst
deleted file mode 100644 (file)
index cda93b0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" = "configure" ]; then
-      # Default (blank) files so that programs at least run --help and stuff
-      touch /etc/dak/dak.conf
-fi
diff --git a/debian/python-dep b/debian/python-dep
deleted file mode 100644 (file)
index 27ca72f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-import sys;
-
-print "python:Depends=python (>= %s), python (<< %s)" % (sys.version[:3],float(sys.version[:3])+0.1)
index 2e7bbc8b521d4bf823783c7f59b1b53829890688..0a7139dda3f503b10903693814ce3472514b6b78 100755 (executable)
@@ -1,87 +1,9 @@
 #!/usr/bin/make -f
-# debian/rules file - for dak (0.0)
-# Based on sample debian/rules file - for GNU Hello (1.3).
-# Copyright 1994,1995 by Ian Jackson.
-# Copyright 1998,1999,2000,2001,2002,2006 James Troup
-# I hereby give you perpetual unlimited permission to copy,
-# modify and relicense this file, provided that you do not remove
-# my name from the file itself.  (I assert my moral right of
-# paternity under the Copyright, Designs and Patents Act 1988.)
-# This file may have to be extensively modified
 
-PYTHONVER := `/usr/bin/python -c 'import sys;print sys.version[:3]'`
+%:
+       dh $@
 
-install_dir=install -d -m 755
-install_file=install -m 644
-install_script=install -m 755
-install_binary=install -m 755 -s
-
-build: build-stamp
-build-stamp:
-       $(MAKE)
-       $(MAKE) -C docs
-       touch $@
-
-clean: checkroot
-       $(checkdir)
-       -rm -rf debian/tmp debian/*~ debian/files* debian/substvars build-stamp
-       $(MAKE) clean
-
-binary-indep: checkroot build
-       $(checkdir)
-       -rm -rf debian/tmp
-
-       $(install_dir) debian/tmp/DEBIAN/
-       $(install_script) debian/postinst debian/tmp/DEBIAN/
-
-       $(install_dir) debian/tmp/usr/lib/python/site-packages/dak/lib/
-
-       $(install_file) dak/*.py debian/tmp/usr/lib/python/site-packages/dak/
-       $(install_file) dak/lib/*.py debian/tmp/usr/lib/python/site-packages/dak/lib/
-
-
-       $(install_dir) debian/tmp/usr/bin/
-       $(install_script) dak/shell.py debian/tmp/usr/bin/dak
-
-       $(install_dir) -m 755 debian/tmp/usr/share/man/man1/
-       $(install_file) docs/manpages/*.1 debian/tmp/usr/share/man/man1/
-       gzip -9v debian/tmp/usr/share/man/man1/*
-
-       $(install_dir) -m 755 debian/tmp/etc/dak/
-
-       $(install_dir) debian/tmp/usr/share/doc/dak/
-       $(install_file) debian/changelog debian/tmp/usr/share/doc/dak/changelog.Debian
-       $(install_file) README NEWS THANKS TODO debian/tmp/usr/share/doc/dak/
-       $(install_file) docs/README* debian/tmp/usr/share/doc/dak/
-       $(install_file) ChangeLog debian/tmp/usr/share/doc/dak/changelog
-       gzip -9v debian/tmp/usr/share/doc/dak/*
-       $(install_file) debian/copyright debian/tmp/usr/share/doc/dak/
-
-       $(install_dir) debian/tmp/usr/share/doc/dak/examples/
-       $(install_file) examples/dak.conf debian/tmp/usr/share/doc/dak/examples/
-       # Hoho (err, rather: FIXME)
-       $(install_file) *.sql debian/tmp/usr/share/doc/dak/examples/
-       gzip -9v debian/tmp/usr/share/doc/dak/examples/*
-
-       dpkg-shlibdeps sql-aptvc.so
-       /usr/bin/python debian/python-dep >> debian/substvars
-       dpkg-gencontrol -isp
-       chown -R root.root debian/tmp
-       chmod -R go=rX debian/tmp
-       dpkg --build debian/tmp ..
-
-binary-arch:
-
-define checkdir
-       test -f dak/ls.py -a -f debian/rules
-endef
-
-# Below here is fairly generic really
-
-binary:        binary-indep binary-arch
-
-checkroot:
-       $(checkdir)
-       test root = "`whoami`"
-
-.PHONY: binary binary-arch binary-indep clean checkroot
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+       tests/test_all.py
+endif
diff --git a/debian/source/format b/debian/source/format
new file mode 100644 (file)
index 0000000..89ae9db
--- /dev/null
@@ -0,0 +1 @@
+3.0 (native)
index 3b98f2dd8b843b73c2dfec54e259e09c058991a1..a280bec62e744605d4afb48797e53a297345d92e 100644 (file)
@@ -6,8 +6,8 @@ Rough Guide to doing Stable Point Releases in Debian
 suite=stable
 suitename=jessie
 pusuite=proposed-updates
-oldrev=8.0
-newrev=8.1
+oldrev=8.1
+newrev=8.2
 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
 . $SCRIPTVARS
 . "${configdir}/common"
@@ -25,7 +25,16 @@ dak control-suite -l ${suite} > ${suite}.list
 - ask SRMs if there is anything to be skipped from this release. If so
   edit ${pusuite}.list (and later the Changelog too)
 - bash:
+skip="squid3 icedove php5"
+if [ -n "${skip}" ]; then
+  mv ${pusuite}.list ${pusuite}.list.ori
+  grep -vFf <(dak ls -f heidi -S -s ${pusuite} ${skip}) ${pusuite}.list.ori > ${pusuite}.list
+fi
 dak make-changelog -s ${pusuite} -b ${suite} | cat - ${ftpdir}/dists/${suite}/ChangeLog | sponge ${ftpdir}/dists/${suite}/ChangeLog
+if [ -n "${skip}" ]; then
+  $EDITOR ${ftpdir}/dists/${suite}/ChangeLog
+fi
+
 dak control-suite --add ${suite} < ${pusuite}.list
 dak control-suite --remove ${pusuite} < ${pusuite}.list
 
@@ -51,11 +60,11 @@ dak control-suite --force --add testing <propups.testing
 - ask rms if they have RMs to do.
 - and then check if they have a d-i update. if so, bash:
 # set dioldver to "empty" if there is no old to remove
-diver=20150422+deb8u1
+diver=20150422+deb8u2
 dak copy-installer -s ${pusuite} -d ${suite} ${diver}
-dioldver=empty
-cd $ftpdir/dists/${suite}/main
+dioldver=20150422+deb8u1
 if [ "${dioldver}" != "empty" ]; then
+    cd $ftpdir/dists/${suite}/main
     for iarch in $(dak admin s-a list-arch ${suite}); do
         if [ -d "installer-${iarch}/${dioldver}" ]; then
             echo "Moving installer-${iarch}/${dioldver} to morgue"
@@ -63,6 +72,12 @@ if [ "${dioldver}" != "empty" ]; then
             mv "installer-${iarch}/${dioldver}" "${base}/morgue/d-i/installer-${iarch}/"
         fi
     done
+
+    # Remove old version also from proposed-updates
+    cd $ftpdir/dists/${pusuite}/main
+    for iarch in $(dak admin s-a list-arch ${suite}); do
+        rm -rf -- "installer-${iarch}/${dioldver}"
+    done
 fi
 cd $ftpdir/dists/${suite}
 
@@ -76,8 +91,20 @@ cd ${ftpdir}
 
 - Update version number in README, README.html and dists/README,
   Clean up dists/stable/ChangeLog (add header, basically). bash:
-  $EDITOR ChangeLog ../README ../../README*
-  rm -f *~ ../*~ ../../*~
+
+cd ${ftpdir}/dists/${suite}
+
+date_long=$(date "+%A, %-dth %B %Y" | sed 's/1th/1st/; s/2th/2nd/; s/3th/3rd/')
+date_iso=$(date "+%Y-%m-%d")
+date_short=$(date "+%a, %d %b %Y")
+sed -e "1i======================================\n${date_short} - Debian ${newrev} released\n======================================" -i ChangeLog
+sed -e "/^${suite}/ s/Debian ${oldrev}/Debian ${newrev}/" -i ../README
+sed -e "s/Debian ${oldrev}/Debian ${newrev}/g; /Debian ${newrev}/ s/released .*\\./released ${date_long}./" -i ../../README
+sed -e "s/Debian ${oldrev}/Debian ${newrev}/g; /Debian ${newrew}/ s/released .*\\./released ${date_long}./; /meta name=\"Modified\"/ s/content=\".*\"/content=\"${date_iso}\"/" -i ../../README.html
+
+# Inspect changes. Regular expressions might be a bit fragile.
+$EDITOR ChangeLog ../README ../../README ../../README.html
+rm -f -- ./*~ ../*~ ../../*~
 
 - Update the 'Debian<n>.<n>r<n>' symlink in dists/
 cd $ftpdir/dists/
@@ -99,35 +126,22 @@ EOF
 dak dominate --force -s ${suite}
 - check output from cruft report:
 dak cruft-report -s ${suite}
+- if cruft was removed: go back to run dominate again
 
 - Let SRM see if all is ok
 
 - then:
 dak generate-packages-sources2 --force -s ${suite} && dak contents generate -f -s ${suite} -a ftp-master
 
-- For squeeze: merge Contents
-if [ "${suitename}" = "squeeze" ]; then
-  cd $ftpdir/dists/${suite}
-  for carch in $(dak admin s-a list-arch ${suite}); do
-    echo doing ${carch}
-    cp $base/dak/templates/contents Contents-${carch}.new;
-    zcat {main,contrib,non-free}/Contents-${carch}.gz | ~joerg/mergecontents.pl | sort >> Contents-${carch}.new;
-    gzip -9v Contents-${carch}.new;
-    mv Contents-${carch}.new.gz Contents-${carch}.gz;
-  done
-  rm {main,contrib,non-free}/Contents-*
-fi
-
 - For wheezy: update main/i18n/Index
-if [[ ${suitename} == wheezy ]] || [[ ${suitename} == jessie ]]; then
+if [[ ${suitename} == wheezy ]]; then
   ${scriptsdir}/generate-i18n-Index "${ftpdir}/dists/${suite}"
 fi
 
 - Generate Releases:
-dak generate-releases -f -s ${suite}
-if [[ ${suitename} != jessie ]]; then
-    rm ${ftpdir}/dists/${suite}/InRelease
-fi
+dak generate-releases -f -s ${suite} ${pusuite}
+# Remove InRelease: Release can be signed by both ftpmaster & stable release keys
+rm ${ftpdir}/dists/${suite}/InRelease
 
 - have the SRMs sign it and put the signature in.
 cd ${ftpdir}/dists/${suite}
index 3ba2f0057310ebcceac24592c2226c30c9301cf6..783c2b9fda952aba54b6c0c697b067a63f57c70b 100755 (executable)
@@ -22,7 +22,7 @@ error() {
 # Check validity of version number
 # Expected are: YYYYMMDD, YYYYMMDD.x, YYYYMMDD<suite>x, YYYYMMDD+<suite>x,
 # YYYYMMDD+debXuZ and the +b[0-9] on the end
-if ! echo "$VERSION" | grep -Eq "^[0-9]{8}((\.|\+?[a-z]+|\+deb[0-9]+u)[0-9]+)?(\+b[0-9])?$"; then
+if ! echo "$VERSION" | grep -Eq "^[0-9]{8}((\.|\+?[a-z]+|\+deb[0-9]+u|\+kbsd[0-9]+u)[0-9]+)?(\+b[0-9])?$"; then
        error "Invalid version: '$VERSION'"
 fi
 
diff --git a/tests/fixtures/changes/two-beginnings.changes b/tests/fixtures/changes/two-beginnings.changes
deleted file mode 100644 (file)
index 33fc072..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
------BEGIN PGP SIGNED MESSAGE OR SO-----
-Hash: SHA512
-
-This: is a bug.
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA512
-
-Question: Is this a bug?
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.11 (GNU/Linux)
-
-iQIcBAEBCgAGBQJN1s1eAAoJEIATJTTdNH3Is4IP/3ppCve+jzobPjacyqYGyAec
-Op2rnYkQulfln1tyaxr8A40MHSWUly1kFebPgO3XNgAQ8mIh7FCeL7tSsaDnrBwq
-v/S/6JK1ZGCSuL6dleoqxoBgViJWQEvd297zAe0CzIdJ+JYgTPxX5cHh4E23rWmG
-zG9ct3v+5J4mSeEGksZPn8/YalnWRwb72hj/0WTagA2SY89TVZ9onT6p8ftWf6aO
-ODXDtclP56GixfnA3jR3reKI5/aLHXSLSYWGDOyEXffr0NoFvgtbsO4Y0FF2+Np3
-MpmJitoIRuJWk3zInYt0GeJskhEbvuF5Fnhiqrg43W5tFxB8pz5QHpDa/oq8Gfea
-MU/2p6FHA12nwD7CVdKWv/ra3nAWcJPqqfV//xgnZaBdS7d4G+3+tMFFYk8sWqc1
-JphkXJ9M8eX67oEuKgwhwHGV/wGu96nkTergnvlqpxk6uesfnsy0ixXX0UgLzwEZ
-ty1sZcCgq8dhdnEatkvRy2M13pS8S9iONmrowAck15YZuHcudBmvh5PFeNbpldmM
-ABLFApnjtD3DljzrjBgnHQS5UHDzDhDiEEAiQrUM3nu/CNi6UPoxasGszJK8W0iV
-MQmYVybk2L2lVV3b1qXURMyaFRcmVnLBNad/IiCbQiWTUCwg8zxzJoty1+f7+EDa
-rPpj3R0qGxz01UsVtS3W
-=/dES
------END PGP SIGNATURE-----
diff --git a/tests/fixtures/dsc/8.dsc b/tests/fixtures/dsc/8.dsc
new file mode 100644 (file)
index 0000000..92f3c52
--- /dev/null
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.0.2 (GNU/Linux)
+Comment: For info see http://www.gnupg.org
+
+iD8DBQE5j091iPgEjVqvb1kRAvFtAJ0asUAaac6ebfR3YeaH16HjL7F3GwCfV+AQ
+rhYnRmVuNMa8oYSvL4hl/Yw=
+=EFAA
+-----END PGP SIGNATURE-----
diff --git a/tests/fixtures/dsc/9.dsc b/tests/fixtures/dsc/9.dsc
new file mode 100644 (file)
index 0000000..33fc072
--- /dev/null
@@ -0,0 +1,25 @@
+-----BEGIN PGP SIGNED MESSAGE OR SO-----
+Hash: SHA512
+
+This: is a bug.
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA512
+
+Question: Is this a bug?
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.11 (GNU/Linux)
+
+iQIcBAEBCgAGBQJN1s1eAAoJEIATJTTdNH3Is4IP/3ppCve+jzobPjacyqYGyAec
+Op2rnYkQulfln1tyaxr8A40MHSWUly1kFebPgO3XNgAQ8mIh7FCeL7tSsaDnrBwq
+v/S/6JK1ZGCSuL6dleoqxoBgViJWQEvd297zAe0CzIdJ+JYgTPxX5cHh4E23rWmG
+zG9ct3v+5J4mSeEGksZPn8/YalnWRwb72hj/0WTagA2SY89TVZ9onT6p8ftWf6aO
+ODXDtclP56GixfnA3jR3reKI5/aLHXSLSYWGDOyEXffr0NoFvgtbsO4Y0FF2+Np3
+MpmJitoIRuJWk3zInYt0GeJskhEbvuF5Fnhiqrg43W5tFxB8pz5QHpDa/oq8Gfea
+MU/2p6FHA12nwD7CVdKWv/ra3nAWcJPqqfV//xgnZaBdS7d4G+3+tMFFYk8sWqc1
+JphkXJ9M8eX67oEuKgwhwHGV/wGu96nkTergnvlqpxk6uesfnsy0ixXX0UgLzwEZ
+ty1sZcCgq8dhdnEatkvRy2M13pS8S9iONmrowAck15YZuHcudBmvh5PFeNbpldmM
+ABLFApnjtD3DljzrjBgnHQS5UHDzDhDiEEAiQrUM3nu/CNi6UPoxasGszJK8W0iV
+MQmYVybk2L2lVV3b1qXURMyaFRcmVnLBNad/IiCbQiWTUCwg8zxzJoty1+f7+EDa
+rPpj3R0qGxz01UsVtS3W
+=/dES
+-----END PGP SIGNATURE-----
index 20dab4b9e51dfd0d30656a95ea7355941e205002..c7193dbef1148379509b097bd1f928ff09933965 100755 (executable)
@@ -12,18 +12,6 @@ class ParseChangesTestCase(DakTestCase):
     def assertParse(self, filename, *args):
         return parse_changes(fixture(filename), *args)
 
-    def assertFails(self, filename, line=None, *args):
-        try:
-            self.assertParse(filename, *args)
-            self.fail('%s was not recognised as invalid' % filename)
-        except ParseChangesError:
-            pass
-        except GpgException:
-            pass
-        except InvalidDscError as actual_line:
-            if line is not None:
-                assertEqual(actual_line, line)
-
 class ParseDscTestCase(ParseChangesTestCase):
     def test_1(self):
         self.assertParse('dsc/1.dsc', -1, 1)
@@ -46,7 +34,8 @@ class ParseDscTestCase(ParseChangesTestCase):
 
     def test_4(self):
         # No blank lines at all
-        self.assertFails('dsc/4.dsc', -1, 1)
+        with self.assertRaises(GpgException):
+            self.assertParse('dsc/4.dsc', -1, 1)
 
     def test_5(self):
         # Extra blank line before signature body
@@ -56,10 +45,26 @@ class ParseDscTestCase(ParseChangesTestCase):
         # Extra blank line after signature header
         self.assertParse('dsc/6.dsc', -1, 1)
 
+    def test_7(self):
+        # Blank file is an invalid armored GPG file
+        with self.assertRaises(GpgException):
+            self.assertParse('dsc/7.dsc', -1, 1)
+
+    def test_8(self):
+        # No armored contents
+        with self.assertRaisesRegexp(ParseChangesError, "Empty changes"):
+            self.assertParse('dsc/8.dsc', -1, 1)
+
+    def test_9(self):
+        changes = self.assertParse('dsc/9.dsc', -1, 1)
+        self.assert_(changes['question'] == 'Is this a bug?')
+        self.failIf(changes.get('this'))
+
 class ParseChangesTestCase(ParseChangesTestCase):
     def test_1(self):
         # Empty changes
-        self.assertFails('changes/1.changes', 5, -1)
+        with self.assertRaises(GpgException):
+            self.assertParse('changes/1.changes', 1)
 
     def test_2(self):
         changes = self.assertParse('changes/2.changes', -1)
@@ -77,10 +82,5 @@ class ParseChangesTestCase(ParseChangesTestCase):
                 )
                 self.failIf(changes.get('you'))
 
-    def test_4(self):
-        changes = self.assertParse('changes/two-beginnings.changes', -1, 1)
-        self.assert_(changes['question'] == 'Is this a bug?')
-        self.failIf(changes.get('this'))
-
 if __name__ == '__main__':
     unittest.main()