[Pkg-libvirt-commits] [libguestfs] 61/179: Moved package post-processing (appliance-splitting, appliance-specific dependencies) from debian/rules to external shell scripts

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 31 19:08:24 UTC 2014


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

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 017130c3b56904bebb33ac92b5dc15a3728e8e9d
Author: Hilko Bengen <bengen at debian.org>
Date:   Thu Oct 2 22:23:52 2014 +0200

    Moved package post-processing (appliance-splitting, appliance-specific dependencies) from debian/rules to external shell scripts
---
 debian/gen-appliance-depends.sh | 25 +++++++++++++++++++++++++
 debian/rules                    | 30 +++---------------------------
 debian/split-appliance.sh       | 18 ++++++++++++++++++
 3 files changed, 46 insertions(+), 27 deletions(-)

diff --git a/debian/gen-appliance-depends.sh b/debian/gen-appliance-depends.sh
new file mode 100755
index 0000000..33ce60c
--- /dev/null
+++ b/debian/gen-appliance-depends.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+pkglist_to_deps() {
+    echo -n 'appliance:Depends='
+    sed -e 's,^iproute2\?,iproute2 | iproute,' \
+        -e 's,^\(gfs-tools\|gfs2-tools\|gfs2-utils\),gfs2-utils | gfs2-tools | gfs-tools,' \
+        -e 's,^\(kmod\|module-init-tools\),kmod | module-init-tools,' \
+        -e 's,^\(systemd\|sysvinit\),systemd | sysvinit,' \
+        -e 's,^\(libsystemd-[a-z1-9-]*0\),libsystemd0 | \1,' \
+        -e '/^\(bash\|coreutils\|e2fsprogs\|findutils\|grep\|gzip\|libc-bin\|sed\|tar\|util\-linux\)$/d' \
+        | tr '\n' ','
+}
+
+for p in gfs2 hfsplus jfs nilfs reiserfs rescue rsync xfs zfs
+do
+    cat debian/libguestfs-$p/usr/lib/*-*/guestfs/supermin.d/packages-$p \
+        |  pkglist_to_deps \
+        >> debian/libguestfs-$p.substvars
+done
+
+cat debian/libguestfs0/usr/lib/*-*/guestfs/supermin.d/packages \
+    |  pkglist_to_deps \
+    >> debian/libguestfs0.substvars
diff --git a/debian/rules b/debian/rules
index 0d8c9da..fd88323 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,9 +15,6 @@ BUILDS         := $(filter-out $(PYTHON_DEFAULT), $(PYTHONS)) \
 		  $(filter-out $(LUA_DEFAULT), $(LUAS)) \
 		  default
 
-pkglist_to_deps := sed -e 's,iproute2\?,iproute2|iproute,;s,\(gfs-tools\|gfs2-tools\|gfs2-utils\),gfs2-utils|gfs2-tools|gfs-tools,;s,\(kmod\|module-init-tools\),kmod | module-init-tools,;s,\(systemd\|sysvinit,systemd | sysvinit,'
-essential_deps  := grep -v '^\(bash\|coreutils\|e2fsprogs\|findutils\|grep\|gzip\|libc-bin\|sed\|sysvinit\|tar\|util\-linux\)'
-
 QEMU_CPU := $(shell echo $(DEB_HOST_GNU_CPU) \
 		    | sed -r -e 's,i[456]86,i386,;s,sparc,sparc64,;s,powerpc(64.*)?,ppc64,;s,arm.*,arm,')
 
@@ -117,15 +114,7 @@ override_dh_auto_install:
 override_dh_install:
 # Split the supermin appliance packages list into subpackages, so the
 # main libguestfs0 can avoid depending on everything.
-	cd $(CURDIR)/debian/tmp/usr/lib/*-*/guestfs/supermin.d && \
-	cp -n packages packages.orig; \
-	for p in gfs2 hfsplus jfs nilfs reiserfs rsync xfs zfs; do \
-	    sed -i -e "/$$p/d" packages; \
-	    grep -F  "$$p" < packages.orig > packages-$$p; \
-	done ; \
-	sed -i -e "/^\(iputils\|lsof\|openssh-server\|strace\|vim\)/d" packages; \
-	grep "^\(iputils\|lsof\|openssh-server\|strace\|vim\)" \
-	    < packages.orig > packages-rescue
+	debian/split-appliance.sh
 
 	erlang-depends -perlang-guestfs
 
@@ -133,21 +122,8 @@ override_dh_install:
 	    --fail-missing
 
 # Add packages (except essential packages) from appliance packagelist
-# to libguestfs0 dependencies
-	for p in gfs2 hfsplus jfs nilfs reiserfs rescue rsync xfs zfs; \
-	do \
-	    echo -n 'appliance:Depends=' >> debian/libguestfs-$$p.substvars; \
-	    cat debian/libguestfs-$$p/usr/lib/*-*/guestfs/supermin.d/packages-$$p | \
-	    $(pkglist_to_deps) | \
-	    $(essential_deps) | \
-	    tr '\n' ',' >> debian/libguestfs-$$p.substvars; \
-	done
-
-	echo -n 'appliance:Depends=' >> debian/libguestfs0.substvars
-	cat debian/libguestfs0/usr/lib/*-*/guestfs/supermin.d/packages | \
-	$(pkglist_to_deps) | \
-	$(essential_deps) | \
-	tr '\n' ',' >> debian/libguestfs0.substvars; \
+# to libguestfs* dependencies
+	debian/gen-appliance-depends.sh
 
 override_dh_python3:
 	dh_python3 -p python3-guestfs
diff --git a/debian/split-appliance.sh b/debian/split-appliance.sh
new file mode 100755
index 0000000..f327651
--- /dev/null
+++ b/debian/split-appliance.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+cd debian/tmp/usr/lib/*-*/guestfs/supermin.d
+cp -n packages packages.orig
+
+for p in gfs2 hfsplus jfs nilfs reiserfs rsync xfs zfs; do
+    sed -i -e "/$p/d" packages
+    grep -F  "$p" < packages.orig > packages-$p
+done
+
+sed -i -e "/^\(iputils\|lsof\|openssh-server\|strace\|vim\)/d" packages
+
+grep "^\(iputils\|lsof\|openssh-server\|strace\|vim\)" \
+    < packages.orig > packages-rescue
+
+rm -f packages.orig

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



More information about the Pkg-libvirt-commits mailing list