[pbuilder] 01/01: create/update: move the code picking extra packages to install for optional features in a common function in modules

Mattia Rizzolo mattia at debian.org
Wed May 25 17:17:53 UTC 2016


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

mattia pushed a commit to branch master
in repository pbuilder.

commit b49616f5f1a3facf9089add606693804550e233e
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Wed May 25 17:15:19 2016 +0000

    create/update: move the code picking extra packages to install for optional features in a common function in modules
---
 pbuilder-createbuildenv | 23 +----------------------
 pbuilder-modules        | 32 ++++++++++++++++++++++++++++++++
 pbuilder-updatebuildenv | 31 +------------------------------
 3 files changed, 34 insertions(+), 52 deletions(-)

diff --git a/pbuilder-createbuildenv b/pbuilder-createbuildenv
index aef4cb9..f12d8b4 100755
--- a/pbuilder-createbuildenv
+++ b/pbuilder-createbuildenv
@@ -96,28 +96,7 @@ mountproc
 $TRAP umountproc_cleanbuildplace_trap exit sighup
 $CHROOTEXEC apt-get -q "${APTGETOPT[@]}" update
 
-case "$(readlink -e "$PBUILDERSATISFYDEPENDSCMD")" in
-  *-aptitude)
-    EXTRAPACKAGES="$EXTRAPACKAGES aptitude"
-  ;;
-  *)
-    REMOVEPACKAGES="$REMOVEPACKAGES aptitude"
-  ;;
-esac
-
-if [ -n "$CCACHEDIR" ]; then
-    EXTRAPACKAGES="$EXTRAPACKAGES ccache"
-else
-    REMOVEPACKAGES="$REMOVEPACKAGES ccache"
-fi
-if [ "$EATMYDATA" = "yes" ]; then
-    # the eatmydata binary is going nowhere anytime soon, while the libeatmydata1
-    # binary is shaped like a shared library, so the name might change, etc.
-    # Install this package instead, it's cheap enough.
-    EXTRAPACKAGES="$EXTRAPACKAGES eatmydata"
-else
-    REMOVEPACKAGES="$REMOVEPACKAGES eatmydata"
-fi
+install_packages_for_optional_features
 
 if [ -n "$REMOVEPACKAGES" ]; then remove_packages $REMOVEPACKAGES ; fi
 recover_aptcache
diff --git a/pbuilder-modules b/pbuilder-modules
index 6be096c..54ef55f 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -728,6 +728,38 @@ function add_additional_aptkeyrings() {
     done
 }
 
+function install_packages_for_optional_features() {
+    # automatically add packages needed for optional features to the chroot
+    # and remove them when that feature is disabled
+    case "$(readlink -e "$PBUILDERSATISFYDEPENDSCMD")" in
+        *-aptitude)
+            EXTRAPACKAGES="$EXTRAPACKAGES aptitude"
+        ;;
+        *)
+            REMOVEPACKAGES="$REMOVEPACKAGES aptitude"
+        ;;
+    esac
+    if [ -n "$CCACHEDIR" ]; then
+        EXTRAPACKAGES="$EXTRAPACKAGES ccache"
+    else
+        REMOVEPACKAGES="$REMOVEPACKAGES ccache"
+    fi
+
+    if [ "$EATMYDATA" = "yes" ]; then
+        # the eatmydata binary is going nowhere anytime soon, while the libeatmydata1
+        # binary is shaped like a shared library, so the name might change, etc.
+        # Install this package instead, it's cheap enough.
+        EXTRAPACKAGES="$EXTRAPACKAGES eatmydata"
+    else
+        REMOVEPACKAGES="$REMOVEPACKAGES eatmydata"
+    fi
+
+    if [ "$DEBDELTA" = "yes" ]; then
+        EXTRAPACKAGES="$EXTRAPACKAGES debdelta python-apt xdelta3"
+    else
+        REMOVEPACKAGES="$REMOVEPACKAGES debdelta"
+    fi
+}
 
 #==========================================================================
 # hooks stuff
diff --git a/pbuilder-updatebuildenv b/pbuilder-updatebuildenv
index 8718c14..799fd43 100755
--- a/pbuilder-updatebuildenv
+++ b/pbuilder-updatebuildenv
@@ -42,36 +42,7 @@ log.i "upgrading packages"
 $CHROOTEXEC apt-get -q "${APTGETOPT[@]}" update
 
 
-# automatically add packages needed for optional features to the chroot
-case "$(readlink -e "$PBUILDERSATISFYDEPENDSCMD")" in
-  *-aptitude)
-    EXTRAPACKAGES="$EXTRAPACKAGES aptitude"
-  ;;
-  *)
-    REMOVEPACKAGES="$REMOVEPACKAGES aptitude"
-  ;;
-esac
-
-if [ -n "$CCACHEDIR" ]; then
-    EXTRAPACKAGES="$EXTRAPACKAGES ccache"
-else
-    REMOVEPACKAGES="$REMOVEPACKAGES ccache"
-fi
-
-if [ "$EATMYDATA" = "yes" ]; then
-    # the eatmydata binary is going nowhere anytime soon, while the libeatmydata1
-    # binary is shaped like a shared library, so the name might change, etc.
-    # Install this package instead, it's cheap enough.
-    EXTRAPACKAGES="$EXTRAPACKAGES eatmydata"
-else
-    REMOVEPACKAGES="$REMOVEPACKAGES eatmydata"
-fi
-
-if [ "$DEBDELTA" = "yes" ]; then
-    EXTRAPACKAGES="$EXTRAPACKAGES debdelta python-apt xdelta3"
-else
-    REMOVEPACKAGES="$REMOVEPACKAGES debdelta"
-fi
+install_packages_for_optional_features
 
 if [ -n "$REMOVEPACKAGES" ]; then remove_packages $REMOVEPACKAGES ; fi
 

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



More information about the Pbuilder-maint mailing list