Bug#685787: Praat has serious bug #713597
* Benjamin Drung bdr...@debian.org [2013-11-03 00:24]: The modification on debian/copyright is okay. I have some comments: 1) I like to have one test file for each script which contains one or more tests. So the test file for uscan should be called test_uscan and contain a test function testFileExclusion using shunit. 2) The test in test_uscan should be converted to an offline test or test_uscan should be renamed to test_uscan_online. 3) The test could do more validity checks. It could compare the list of files in the tarball with the expected content. Attached below is the patch implementing the above requests. It renames test_uscan to test_uscan_online and includes the shunit2 test function testFileExclusion in test_uscan. Two tests are included: first, it checks whether the online download of the tarball succeeded and, second, it checks whether the intended file was really excluded. Here is the relevant part of the build log of the package: ./test_uscan testFileExclusion 127.0.0.1 - - [03/Nov/2013 12:07:13] GET / HTTP/1.1 200 - 127.0.0.1 - - [03/Nov/2013 12:07:13] GET /foo-1.tar.gz HTTP/1.1 200 - foo: Newer version (1) available on remote site: http://localhost:8000/foo-1.tar.gz (local version is 0) foo: Successfully downloaded updated package foo-1.tar.gz and removed files from it in foo_1+dfsg.orig.tar.gz Ran 1 test. OK Rafael From e5a9871349d23d85611889c1e950d3306a03c63d Mon Sep 17 00:00:00 2001 From: Rafael Laboissiere raf...@laboissiere.net Date: Sat, 2 Nov 2013 18:15:54 +0100 Subject: [PATCH] Add test for the file exclusion feature of uscan This test is included into the test/test_uscan file and runs under the shunit2 framework (testFileExclusion). The file previously named test/test_uscan is renamed as test/test_uscan_online. The test/Makefile has been changed accordingly. --- debian/copyright | 2 + test/Makefile | 3 +- test/test_uscan| 101 - test/test_uscan_online | 38 +++ 4 files changed, 117 insertions(+), 27 deletions(-) create mode 100755 test/test_uscan_online diff --git a/debian/copyright b/debian/copyright index 515cb94..dcf0094 100644 --- a/debian/copyright +++ b/debian/copyright @@ -62,9 +62,11 @@ License: GPL-3 Files: doc/what-patch.1 scripts/what-patch.sh + test/test_uscan Copyright: 2009, Jonathan Patrick Davies j...@ubuntu.com 2006-2008, Kees Cook k...@ubuntu.com 2007-2008, Siegfried-Angel Gevatter Pujals rai...@ubuntu.com + 2013, Rafael Laboissiere raf...@laboissiere.net License: GPL-3+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/test/Makefile b/test/Makefile index 7b10a5c..473c68d 100644 --- a/test/Makefile +++ b/test/Makefile @@ -5,8 +5,9 @@ test: ./test_debchange ./test_debdiff ./test_licensecheck + ./test_uscan online-test: - ./test_uscan + ./test_uscan_online .PHONY: test online-test diff --git a/test/test_uscan b/test/test_uscan index 47da566..2962bb5 100755 --- a/test/test_uscan +++ b/test/test_uscan @@ -1,38 +1,87 @@ #!/bin/sh -# Copyright (C) 2012, Benjamin Drung bdr...@debian.org +# Copyright (C) 2013, Rafael Laboissiere raf...@laboissiere.net # -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 3 of the License, or (at your +# option) any later version. # -# THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# On Debian systems, the complete text of the GNU General Public License +# version 3 can be found in the /usr/share/common-licenses/GPL-3 file. -COMMAND=${0%/*}/../scripts/uscan.pl +export PERLLIB=$PWD/.. +COMMAND=$PWD/../scripts/uscan.pl -. ${0%/*}/shunit2-helper-functions.sh +cleanup(){ +kill -9 $(cat $TMPDIR/repo/pid) +rm -rf $TMPDIR -found() { -
Bug#685787: Praat has serious bug #713597
* Benjamin Drung bdr...@debian.org [2013-11-02 00:05]: I have just one recommendation/wish: It would be nice if test cases could be added for the new feature. The test cases should work offline. Would something along the lines of the very simple-minded shell script attached below be appropriate? Of course, it will need adaptation for the shunit2 framework used in devscripts. What this script does is (1) create a minimal Debian package directory, containing minimal files debian/{changelog,watch,copyright}, (2) create a minimal repository, containing a tarball (built on the fly), and (3) start an HTTP server that works offline, using the SimpleHTTPServer module of Python. When I run this with the modified uscan.pl, I obtain the following: foo/ foo/exclude-this foo/include-this Serving HTTP on 0.0.0.0 port 8000 ... -- Scanning for watchfiles in . -- Found watchfile in ./debian -- In debian/watch, processing watchfile line: http://localhost:8000/foo-(\d).tar.gz 127.0.0.1 - - [02/Nov/2013 08:27:16] GET / HTTP/1.1 200 - -- Found the following matching hrefs: foo-1.tar.gz (1) Newest version on remote site is 1, local version is 0 = Newer version available from http://localhost:8000/foo-1.tar.gz -- Downloading updated package foo-1.tar.gz 127.0.0.1 - - [02/Nov/2013 08:27:16] GET /foo-1.tar.gz HTTP/1.1 200 - -- Successfully downloaded updated package foo-1.tar.gz and removed files from it in foo_1+dfsg.orig.tar.gz -- Scan finished drwxr-xr-x root/root 0 2013-11-02 08:27 foo-1+dfsg.orig/ -rw-r--r-- root/root 0 2013-11-02 08:27 foo-1+dfsg.orig/include-this Best, Rafael test-uscan-files-excluded.sh Description: Bourne shell script
Bug#685787: Praat has serious bug #713597
On Sa, 2013-11-02 at 12:03 +0100, Rafael Laboissiere wrote: * Benjamin Drung bdr...@debian.org [2013-11-02 00:05]: I have just one recommendation/wish: It would be nice if test cases could be added for the new feature. The test cases should work offline. Would something along the lines of the very simple-minded shell script attached below be appropriate? Of course, it will need adaptation for the shunit2 framework used in devscripts. Yes, that's exactly what I hoped for. We already have test/test_uscan, which contains one online test. This could be converted to an offline test with your test framework. What this script does is (1) create a minimal Debian package directory, containing minimal files debian/{changelog,watch,copyright}, (2) create a minimal repository, containing a tarball (built on the fly), and (3) start an HTTP server that works offline, using the SimpleHTTPServer module of Python. Maybe this short description could be added to the test case as comment (for documentation). -- Benjamin Drung Debian Ubuntu Developer -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#685787: Praat has serious bug #713597
* Benjamin Drung bdr...@debian.org [2013-11-02 13:08]: On Sa, 2013-11-02 at 12:03 +0100, Rafael Laboissiere wrote: * Benjamin Drung bdr...@debian.org [2013-11-02 00:05]: I have just one recommendation/wish: It would be nice if test cases could be added for the new feature. The test cases should work offline. Would something along the lines of the very simple-minded shell script attached below be appropriate? Of course, it will need adaptation for the shunit2 framework used in devscripts. Yes, that's exactly what I hoped for. We already have test/test_uscan, which contains one online test. This could be converted to an offline test with your test framework. What this script does is (1) create a minimal Debian package directory, containing minimal files debian/{changelog,watch,copyright}, (2) create a minimal repository, containing a tarball (built on the fly), and (3) start an HTTP server that works offline, using the SimpleHTTPServer module of Python. Maybe this short description could be added to the test case as comment (for documentation). Ok, I did it and also changed test/Makefile accordingly. The patch is attached below. Note that I also added an entry in debian/copyright, but that may be wrong. There is no need to build-depend on libpython-stdlib (for the SimpleHTTPServer module), because python3-all pulls it in. This patch works here inside my pbuilder. Cheers, Rafael Laboissière From 23bd86aad69f15f83effb133237fcdd9c48daae5 Mon Sep 17 00:00:00 2001 From: Rafael Laboissiere raf...@laboissiere.net Date: Sat, 2 Nov 2013 18:15:54 +0100 Subject: [PATCH] Add test for the file exclusion feature of uscan --- debian/copyright | 2 ++ test/Makefile | 1 + test/test_uscan_file_exclusion | 73 ++ 3 files changed, 76 insertions(+) create mode 100755 test/test_uscan_file_exclusion diff --git a/debian/copyright b/debian/copyright index 515cb94..1e28919 100644 --- a/debian/copyright +++ b/debian/copyright @@ -62,9 +62,11 @@ License: GPL-3 Files: doc/what-patch.1 scripts/what-patch.sh + test/test_uscan_file_exclusio Copyright: 2009, Jonathan Patrick Davies j...@ubuntu.com 2006-2008, Kees Cook k...@ubuntu.com 2007-2008, Siegfried-Angel Gevatter Pujals rai...@ubuntu.com + 2013, Rafael Laboissiere raf...@laboissiere.net License: GPL-3+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/test/Makefile b/test/Makefile index 7b10a5c..75ca9ff 100644 --- a/test/Makefile +++ b/test/Makefile @@ -5,6 +5,7 @@ test: ./test_debchange ./test_debdiff ./test_licensecheck + ./test_uscan_file_exclusion online-test: ./test_uscan diff --git a/test/test_uscan_file_exclusion b/test/test_uscan_file_exclusion new file mode 100755 index 000..f3a3db2 --- /dev/null +++ b/test/test_uscan_file_exclusion @@ -0,0 +1,73 @@ +#!/bin/sh + +# Copyright (C) 2013, Rafael Laboissiere raf...@laboissiere.net +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# On Debian systems, the complete text of the GNU General Public License +# version 3 can be found in the /usr/share/common-licenses/GPL-3 file. + +# This script tests the Files-Excluded feature of uscan, which allows the +# selective exclusion of files from thje upstream tarball before repacking +# it. +# +# This script does the following: (1) create a minimal Debian package +# directory, containing minimal files debian/{changelog,watch,copyright}, +# (2) create a minimal repository, containing a tarball (built on the fly), +# (3) start an HTTP server that works offline, using the SimpleHTTPServer +# module of Python, and (4) run uscan inside that minimal universe. + +export PERLLIB=$PWD/.. +COMMAND=$PWD/../scripts/uscan.pl + +TMPDIR=$(mktemp -d) + +cleanup(){ +rm -rf $TMPDIR +kill -9 $pid +} + +trap cleanup 1 2 3 13 15 + +mkdir -p $TMPDIR/foo/debian + +cat END $TMPDIR/foo/debian/watch +version=3 +http://localhost:8000/foo-(\d).tar.gz +END + +cat END $TMPDIR/foo/debian/changelog +foo (0-1) unstable; urgency=low + + * Initial release + + -- Joe Developer j...@debian.org Mon, 02 Nov 2013 22:21:31 -0100 +END + +cat END $TMPDIR/foo/debian/copyright +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Files-Excluded: exclude-this +END + +mkdir -p $TMPDIR/repo/foo +touch $TMPDIR/repo/foo/include-this +touch
Bug#685787: Praat has serious bug #713597
On Sa, 2013-11-02 at 18:40 +0100, Rafael Laboissiere wrote: * Benjamin Drung bdr...@debian.org [2013-11-02 13:08]: On Sa, 2013-11-02 at 12:03 +0100, Rafael Laboissiere wrote: * Benjamin Drung bdr...@debian.org [2013-11-02 00:05]: I have just one recommendation/wish: It would be nice if test cases could be added for the new feature. The test cases should work offline. Would something along the lines of the very simple-minded shell script attached below be appropriate? Of course, it will need adaptation for the shunit2 framework used in devscripts. Yes, that's exactly what I hoped for. We already have test/test_uscan, which contains one online test. This could be converted to an offline test with your test framework. What this script does is (1) create a minimal Debian package directory, containing minimal files debian/{changelog,watch,copyright}, (2) create a minimal repository, containing a tarball (built on the fly), and (3) start an HTTP server that works offline, using the SimpleHTTPServer module of Python. Maybe this short description could be added to the test case as comment (for documentation). Ok, I did it and also changed test/Makefile accordingly. The patch is attached below. Note that I also added an entry in debian/copyright, but that may be wrong. There is no need to build-depend on libpython-stdlib (for the SimpleHTTPServer module), because python3-all pulls it in. This patch works here inside my pbuilder. The modification on debian/copyright is okay. I have some comments: 1) I like to have one test file for each script which contains one or more tests. So the test file for uscan should be called test_uscan and contain a test function testFileExclusion using shunit. 2) The test in test_uscan should be converted to an offline test or test_uscan should be renamed to test_uscan_online. 3) The test could do more validity checks. It could compare the list of files in the tarball with the expected content. -- Benjamin Drung Debian Ubuntu Developer -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#685787: Praat has serious bug #713597
On Mi, 2013-10-30 at 09:45 +0100, Rafael Laboissiere wrote: * Andreas Tille ti...@debian.org [2013-10-29 10:33]: On Mon, Oct 28, 2013 at 07:06:37PM -0400, James McCoy wrote: Thanks Rafael for the feedback and Andreas for continued patience. On Mon, Oct 28, 2013 at 10:10:00PM +0100, Andreas Tille wrote: On Mon, Oct 28, 2013 at 07:44:57PM +0100, Rafael Laboissiere wrote: It would be preferable that you had created a side branch in the Git repository for your changes, such that the merge would be trivial to do. This really wouldn't have made much of a difference. It's trivial to add Andrea's repo as a remote and then the functionality is the same as if the branch were in devscripts' repo. At the time that Andreas started work on this, devscripts wasn't in collab-maint so it made sense to just push his changes to a user repo on Alioth so people could access and review the changes. For the convenience of the developers of devscript, I am attaching below a patch generated with git format-patch that contains an appropriate log message. I cherry-picked the commits made by Andreas Tille and Gregor Herrmann into the Andreas' repo, which concern only the implementation of the Files-Excluded feature. I did also some improvements on my own. his patch works for me on the praat package, but was not extensively tested. At any rate, this slim patch introduces a single feature, namely the possibility of excluding files from upstream tarballs according to information in debain/copyright. If I had push access to the devscripts repository, I could create a side branch there with this patch. The patch looks good on a quick look. I haven't applied or tested it. I leave the integration to James, who offered to work on it. I have just one recommendation/wish: It would be nice if test cases could be added for the new feature. The test cases should work offline. -- Benjamin Drung Debian Ubuntu Developer -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#685787: Praat has serious bug #713597
* Andreas Tille ti...@debian.org [2013-10-29 10:33]: On Mon, Oct 28, 2013 at 07:06:37PM -0400, James McCoy wrote: Thanks Rafael for the feedback and Andreas for continued patience. On Mon, Oct 28, 2013 at 10:10:00PM +0100, Andreas Tille wrote: On Mon, Oct 28, 2013 at 07:44:57PM +0100, Rafael Laboissiere wrote: It would be preferable that you had created a side branch in the Git repository for your changes, such that the merge would be trivial to do. This really wouldn't have made much of a difference. It's trivial to add Andrea's repo as a remote and then the functionality is the same as if the branch were in devscripts' repo. At the time that Andreas started work on this, devscripts wasn't in collab-maint so it made sense to just push his changes to a user repo on Alioth so people could access and review the changes. For the convenience of the developers of devscript, I am attaching below a patch generated with git format-patch that contains an appropriate log message. I cherry-picked the commits made by Andreas Tille and Gregor Herrmann into the Andreas' repo, which concern only the implementation of the Files-Excluded feature. I did also some improvements on my own. his patch works for me on the praat package, but was not extensively tested. At any rate, this slim patch introduces a single feature, namely the possibility of excluding files from upstream tarballs according to information in debain/copyright. If I had push access to the devscripts repository, I could create a side branch there with this patch. Best, Rafael From 8192d448f5817cb95142124b42fd23a0ff55771d Mon Sep 17 00:00:00 2001 From: Rafael Laboissiere raf...@laboissiere.net Date: Tue, 29 Oct 2013 10:11:33 +0100 Subject: [PATCH] Enable uscan to selectively remove files from upstream arquives [N.B.: This patch includes the original patch proposed by Andreas Tille in Bug#685787 and further improvements by Gregor Herrmann and Andreas himself, posted at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685787 This is the follow up of a long discussion in the debian-devel mailing list: http://lists.debian.org/debian-devel/2012/08/msg00380.html] The changes in this commit enable uscan to remove files from upstream archives according to some information given in some control file. The current implementation is based on using debian/copyright but is easy to switch to another file. The changes do the following: 1. If (and only if) the debian/copyright file is Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ and if it contains a non-empty field Files-Excluded containing a space separated list of globs (as used by find and for specifying file lists in machine readable debian/control files). The deletion process will loop over every expression and is using the find command to delete the according globs. 2. If files matching are contained in the source tarball this will be repackaged except if the option --no-exclusion is given at uscan command line or if USCAN_NO_EXCLUSION is set in /etc/devscripts.conf or ~/.devscripts. The removal is implemented for all tar compression methods as well as for zip archives (which are unpackaged using unzip). This means if the conditions for file exclusion as given above are fullfilled the patch below works similar as --repack. 3. If the tarball did not contained any of the globs in debian/copyright::Files-Excluded it will be left untouched. 4. In case something was removed the version string will be appended by '+dfsg' to express the fact that the content of the original source was changed. 5. Sometimes upstream tarballs are dirty and unpack a load of files into the current directory. The patch tries to behave reasonable and checks whether it could move those files into a dir named $pkg-$newversion (in case no such file or directory just exists in such a dirty tarball). Also some non-dirty but quite generically named directories (like source) are renamed to $pkg-$newversion. The BEGIN block in uscal.pl has also been changed. In the previous version, it was used for requiring module LWP::UserAgent and, in case of failure, inform the user that it sould install the libwww-perl package. This has been generalized throuhg a subroutine require_module, which is called for both LWP::UserAgent and Try::Tiny. The appropriate documentation has been added to uscan.1. Appropriate Build-Depends and Suggests on libtry-tiny-perl have been set in debian/control. --- debian/control | 2 + scripts/uscan.1 | 8 +++ scripts/uscan.pl | 149 --- 3 files changed, 151 insertions(+), 8 deletions(-) diff --git a/debian/control b/debian/control index d48f7f2..b9dc690 100644 --- a/debian/control +++ b/debian/control @@ -16,6 +16,7 @@ Build-Depends: debhelper (= 9), libparse-debcontrol-perl,
Bug#685787: Praat has serious bug #713597
Hi James, On Mon, Oct 28, 2013 at 07:06:37PM -0400, James McCoy wrote: Thanks Rafael for the feedback and Andreas for continued patience. On Mon, Oct 28, 2013 at 10:10:00PM +0100, Andreas Tille wrote: On Mon, Oct 28, 2013 at 07:44:57PM +0100, Rafael Laboissiere wrote: It would be preferable that you had created a side branch in the Git repository for your changes, such that the merge would be trivial to do. This really wouldn't have made much of a difference. It's trivial to add Andrea's repo as a remote and then the functionality is the same as if the branch were in devscripts' repo. At the time that Andreas started work on this, devscripts wasn't in collab-maint so it made sense to just push his changes to a user repo on Alioth so people could access and review the changes. OK. It will also be necessary to prepare a qpatched versions for uscan.1 and debian/control. I'd happily provide this if I could be sure that this effort is not wasted in a way that uscan in devscripts simply moves on and I need to redo the patch later again. Some signal of devscripts maintainer regarding this would be helpful. As stated before, we were originally waiting for the (longish) Wheezy freeze to finish and release. Since that has happened, there has been a lack of time available from existing maintainers. Your work is not wasted, though, since we can integrate your changes regardless of whether they've been rebased on a recent version of uscan. It's just a matter of time to review and merge. I will work on this within the next month. Cool. Just let me know if I could be of any help. Kind regards and thanks for maintaining devscripts Andreas. -- http://fam-tille.de -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#685787: Praat has serious bug #713597
Thanks Rafael for the feedback and Andreas for continued patience. On Mon, Oct 28, 2013 at 10:10:00PM +0100, Andreas Tille wrote: On Mon, Oct 28, 2013 at 07:44:57PM +0100, Rafael Laboissiere wrote: It would be preferable that you had created a side branch in the Git repository for your changes, such that the merge would be trivial to do. This really wouldn't have made much of a difference. It's trivial to add Andrea's repo as a remote and then the functionality is the same as if the branch were in devscripts' repo. At the time that Andreas started work on this, devscripts wasn't in collab-maint so it made sense to just push his changes to a user repo on Alioth so people could access and review the changes. It will also be necessary to prepare a qpatched versions for uscan.1 and debian/control. I'd happily provide this if I could be sure that this effort is not wasted in a way that uscan in devscripts simply moves on and I need to redo the patch later again. Some signal of devscripts maintainer regarding this would be helpful. As stated before, we were originally waiting for the (longish) Wheezy freeze to finish and release. Since that has happened, there has been a lack of time available from existing maintainers. Your work is not wasted, though, since we can integrate your changes regardless of whether they've been rebased on a recent version of uscan. It's just a matter of time to review and merge. I will work on this within the next month. Cheers, -- James GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy james...@debian.org signature.asc Description: Digital signature