[devscripts] 01/02: debclean: do not descend into subdirs if cwd is already a package

Antonio Terceiro terceiro at moszumanska.debian.org
Thu Dec 1 12:52:52 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository devscripts.

commit f678a72b1183a3b4eba505a4b60d19bddd3e243a
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Thu Dec 1 10:32:03 2016 -0200

    debclean: do not descend into subdirs if cwd is already a package
---
 debian/changelog    | 6 ++++++
 scripts/debclean.1  | 3 +++
 scripts/debclean.sh | 9 ++++++++-
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 671833a..23327d4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,14 @@
 devscripts (2.16.11) UNRELEASED; urgency=medium
 
+  [ James McCoy ]
   * debuild:
     + Avoid setting a hook to just "cd ..; ".
 
+  [ Antonio Terceiro ]
+  * debclean:
+    + do not descend on subdirectories if current directory is already a
+      Debian source package.
+
  -- James McCoy <jamessan at debian.org>  Wed, 30 Nov 2016 00:05:18 -0500
 
 devscripts (2.16.10) unstable; urgency=medium
diff --git a/scripts/debclean.1 b/scripts/debclean.1
index ed45ac9..c3e3e09 100644
--- a/scripts/debclean.1
+++ b/scripts/debclean.1
@@ -11,6 +11,9 @@ for each Debian source directory encountered.  These directories are
 recognised by containing a debian/changelog file for a package whose
 name matches that of the directory.  Name matching is described below.
 .PP
+If \fBdebclean\fR is invoked from a directory that is already a Debian source
+package, it will not descend into its subdirectories.
+.PP
 Also, if the \fB\-\-cleandebs\fR option is given, then in every
 directory containing a Debian source tree, all files named *.deb,
 *.changes and *.build are removed.  The .dsc, .diff.gz and
diff --git a/scripts/debclean.sh b/scripts/debclean.sh
index a239d20..0503cf9 100755
--- a/scripts/debclean.sh
+++ b/scripts/debclean.sh
@@ -160,7 +160,14 @@ fi
 # Script to clean up debian directories
 
 OPWD="`pwd`"
-for i in `find . -type d -name "debian"`; do
+
+if [ -d debian/changelog ]; then
+  directories=./debian
+else
+  directories=$(find . -type d -name "debian")
+fi
+
+for i in $directories; do
     (  # subshell to not lose where we are
     DIR=${i%/debian}
     echo "Cleaning in directory $DIR"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list