Restore d/control via sed rather than control.orig 55/2655/1
authorLuca Boccassi <luca.boccassi@gmail.com>
Tue, 6 Sep 2016 10:50:57 +0000 (11:50 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 6 Sep 2016 10:50:57 +0000 (11:50 +0100)
When the binary kernel module build is enabled, a new package is
autogenerated. This requires adding it to the debian/control file,
and then cleaning it up.
Doing this via a backup debian/control.orig file that is gitignored
is error prone and can lead to changes being inadvertently and
silently overwritten.
Use a sed expression to remove the exact autogenerated snippet
instead to avoid this issue.

Change-Id: If04c25d2b267f654475567b78a36fd1de8318d76
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
debian/.gitignore
debian/control
debian/control.modules.in
debian/rules

index 4c32c18..269a9fb 100644 (file)
@@ -6,7 +6,6 @@
 *.dkms.debhelper
 build/
 control.modules
-control.orig
 dpdk-dev/
 dpdk-doc/
 dpdk-igb-uio-dkms/
index 2b59fed..e77cece 100644 (file)
@@ -714,3 +714,4 @@ Description: Data Plane Development Kit (librte_pdump runtime library)
  DPDK is a set of libraries for fast packet processing. Applications run
  in user-space and communicate directly with dedicated network interfaces.
  This package contains the runtime libraries for librte_pdump
+
index 93148b6..28ace96 100644 (file)
@@ -1,4 +1,3 @@
-
 Package: dpdk-modules-#KVERS#
 Section: kernel
 Architecture: amd64 arm64 i386
index b982b24..d4b09df 100755 (executable)
@@ -81,8 +81,7 @@ build:
            exit 1; \
        fi
        sh debian/prep-modules $(KSRC)
-       test -f debian/control.orig || cp -v debian/control debian/control.orig
-       cat debian/control.orig debian/control.modules > debian/control
+       cat debian/control.modules >> debian/control
        dh $@ --with python2,dkms
 endif
 
@@ -92,7 +91,7 @@ endif
 override_dh_auto_clean:
        rm -rf debian/build debian/tmp debian/dpdk-modules-* \
                debian/control.modules debian/VERSION
-       mv debian/control.orig debian/control || true
+       sed -i '/Package: dpdk-modules-/,/`tail -n1 debian/control.modules.in`/d' debian/control
 
 override_dh_auto_configure:
        # report dpkg-buildflags status to build log