Package: pbuilder
Version: 0.187
Severity: wishlist

Hi,

I thought it would be nice if pbuilder-satisfydepends-aptitude gives a relevant 
name to the dummy package. It could be pbuilder-satisfydepends-dummy-$PACKAGE 
instead of pbuilder-satisfydepends-dummy. Moreover, giving it a relevant version
would be nice too.

This can be useful when using pbuilder-satisfydepends-aptitude for several
packages. Having a relevant version, allow us to know when we created the 
dummy package.

Attached a patch that implements that.

Cheers,

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to fr_FR.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages pbuilder depends on:
ii  cdebootstrap                0.5.4        Bootstrap a Debian system
ii  coreutils                   7.3-1        The GNU core utilities
ii  debconf [debconf-2.0]       1.5.26       Debian configuration management sy
ii  debianutils                 3.1.3        Miscellaneous utilities specific t
ii  debootstrap                 1.0.10lenny1 Bootstrap a basic Debian system
ii  wget                        1.11.4-2     retrieves files from the web

Versions of packages pbuilder recommends:
ii  devscripts                    2.10.49    scripts to make the life of a Debi
ii  fakeroot                      1.12.2     Gives a fake root environment
ii  sudo                          1.7.0-1    Provide limited super user privile

Versions of packages pbuilder suggests:
ii  cowdancer             0.55               Copy-on-write directory tree utili
ii  gdebi                 0.3.11debian1+nmu1 Simple tool to install deb files
pn  pbuilder-uml          <none>             (no description available)

-- debconf information:
  pbuilder/mirrorsite: http://ftp.fr.debian.org/debian/
  pbuilder/nomirror:
  pbuilder/rewrite: false
>From 5c553feaf815a29e01e572afb87aaeced68844b7 Mon Sep 17 00:00:00 2001
From: Mehdi Dogguy <dog...@pps.jussieu.fr>
Date: Thu, 14 May 2009 20:58:47 +0200
Subject: [PATCH] Name the dummy package according to the source package

---
 debian/changelog                 |    8 ++++++++
 pbuilder-satisfydepends-aptitude |   22 ++++++++++++----------
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 95ac335..931f6ba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+pbuilder (0.187+nmu1) unstable; urgency=low
+
+  * Make pbuilder-satisfydepends-aptitude and pbuilder-satisfydepends
+    install pbuilder-satisfydepends-dummy-$PACKAGE instead of
+    pbuilder-satisfydepends-dummy.
+
+ -- Mehdi Dogguy <dog...@pps.jussieu.fr>  Thu, 14 May 2009 20:25:19 +0200
+
 pbuilder (0.187) unstable; urgency=low
 
   [ Junichi Uekawa ]
diff --git a/pbuilder-satisfydepends-aptitude b/pbuilder-satisfydepends-aptitude
index dafdc4f..ba2fc27 100755
--- a/pbuilder-satisfydepends-aptitude
+++ b/pbuilder-satisfydepends-aptitude
@@ -61,19 +61,21 @@ function checkbuilddep_internal () {
     local BUILD_DEP_DEB_CONTROL
     local DEPENDS
     local CONFLICTS
+    local PKG_NAME="pbuilder-satisfydepends-dummy-$(sed -n 's/Source: //p' debian/control)"
+    local PKG_VERSION="$(head -n1 debian/changelog | sed -n 's/.\+(\([^ ]\+\)).\+/\1/p')" || "0.invalid.0"
     echo " -> Attempting to satisfy build-dependencies"
     DEPENDS="$(get_control_re "$DEBIAN_CONTROL" "$BD_REGEXP" | filter_arch_deps "$ARCH")"
     CONFLICTS="$(get_control_re "$DEBIAN_CONTROL" "$BC_REGEXP" | filter_arch_deps "$ARCH")"
-    echo " -> Creating pbuilder-satisfydepends-dummy package"
+    echo " -> Creating $PKG_NAME package"
     BUILD_DEP_DEB_DIR="/tmp/satisfydepends-aptitude"
-    BUILD_DEP_DEB_CONTROL="$BUILD_DEP_DEB_DIR/pbuilder-satisfydepends-dummy/DEBIAN/control"
-    $CHROOTEXEC mkdir -p "$BUILD_DEP_DEB_DIR/pbuilder-satisfydepends-dummy/DEBIAN/"
+    BUILD_DEP_DEB_CONTROL="$BUILD_DEP_DEB_DIR/$PKG_NAME/DEBIAN/control"
+    $CHROOTEXEC mkdir -p "$BUILD_DEP_DEB_DIR/$PKG_NAME/DEBIAN/"
     $CHROOTEXEC sh -c "cat >\"$BUILD_DEP_DEB_CONTROL\"" <<EOF
-Package: pbuilder-satisfydepends-dummy
-Version: 0.invalid.0
+Package: $PKG_NAME
+Version: $PKG_VERSION
 Architecture: $ARCH
 Maintainer: Debian Pbuilder Team <pbuilder-ma...@lists.alioth.debian.org>
-Description: Dummy package to satisfy dependencies with aptitude - created by pbuilder
+Description: Dummy package to satisfy dependencies of $PKG_NAME with aptitude - created by pbuilder
  This package was created automatically by pbuilder and should
 EOF
     if [ -n "$DEPENDS" ]; then
@@ -83,12 +85,12 @@ EOF
         $CHROOTEXEC sh -c "echo \"Conflicts: $CONFLICTS\" >>\"$BUILD_DEP_DEB_CONTROL\""
     fi
     $CHROOTEXEC sh -c "cat \"$BUILD_DEP_DEB_CONTROL\""
-    $CHROOTEXEC sh -c "dpkg-deb -b \"$BUILD_DEP_DEB_DIR/pbuilder-satisfydepends-dummy\""
+    $CHROOTEXEC sh -c "dpkg-deb -b \"$BUILD_DEP_DEB_DIR/$PKG_NAME\""
     $CHROOTEXEC apt-get -y --force-yes install aptitude
-    $CHROOTEXEC dpkg -i "$BUILD_DEP_DEB_DIR/pbuilder-satisfydepends-dummy.deb" || true
-    $CHROOTEXEC aptitude -y --without-recommends -o APT::Install-Recommends=false -o Aptitude::CmdLine::Ignore-Trust-Violations=true -o Aptitude::ProblemResolver::StepScore=100 install pbuilder-satisfydepends-dummy
+    $CHROOTEXEC dpkg -i "$BUILD_DEP_DEB_DIR/$PKG_NAME.deb" || true
+    $CHROOTEXEC aptitude -y --without-recommends -o APT::Install-Recommends=false -o Aptitude::CmdLine::Ignore-Trust-Violations=true -o Aptitude::ProblemResolver::StepScore=100 install $PKG_NAME
     # check whether the aptitude's resolver kept the package
-    if ! $CHROOTEXEC dpkg -l pbuilder-satisfydepends-dummy 2>/dev/null | grep -q ^ii; then
+    if ! $CHROOTEXEC dpkg -l $PKG_NAME 2>/dev/null | grep -q ^ii; then
         echo "Aptitude couldn't satisfy the build dependencies"
         exit 1
     fi
-- 
1.6.2.4

Reply via email to