[oe-commits] [openembedded-core] 02/11: deb: allow custom dpkg command

git at git.openembedded.org git at git.openembedded.org
Thu Aug 8 09:27:14 UTC 2019


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

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 4e00ceaf38f2ae338e3b192c3485aaa963f54b99
Author: Tim Blechmann <tim at klingt.org>
AuthorDate: Thu Aug 8 12:58:33 2019 +0800

    deb: allow custom dpkg command
    
    trying to reduce the turnaround times for local builds, i'm trying to
    find a way to inject `-Zgzip -z1` into the dkpg-deb command line.
    
    attached patch introduces a `DPKG_BUILDCMD` variable for this purpose.
    (i'm not very familiar with the whole bitbake infrastructure, so i'm
    wondering: do i have to add it to the `vardeps` of do_package_deb?)
    
    tia,
    tim
    
    >From 62d4930d307d5d07844889001e8a1c3111b72b98 Mon Sep 17 00:00:00 2001
    From: Tim Blechmann <tim at klingt.org>
    Date: Thu, 8 Aug 2019 06:48:54 +0200
    Subject: [PATCH] package_deb: allow dpkg-deb to be customized via
     DPKG_BUILDCMD
    
    the command line to invoke `dpkg-deb` is hardcoded. there are certain use
    cases where we want to tweak how debian packages are compiled: e.g. the
    default uses xz compression, which is rather CPU intensive. for local
    builds one might want to pass `-Zgzip -z1` to favor speed over compression
    ratio.
    
    we therefore introduce a `DPKG_BUILDCMD` variable which allows downstream
    code to customize how dpkg-deb is executed
    
    Signed-off-by: Tim Blechmann <tim at klingt.org>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/package_deb.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 6f81591..790b26a 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -6,6 +6,8 @@ inherit package
 
 IMAGE_PKGTYPE ?= "deb"
 
+DPKG_BUILDCMD ??= "dpkg-deb"
+
 DPKG_ARCH ?= "${@debian_arch_map(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'))}"
 DPKG_ARCH[vardepvalue] = "${DPKG_ARCH}"
 
@@ -269,7 +271,8 @@ def deb_write_pkg(pkg, d):
             conffiles.close()
 
         os.chdir(basedir)
-        subprocess.check_output("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH"), root, pkgoutdir),
+        subprocess.check_output("PATH=\"%s\" %s -b %s %s" % (localdata.getVar("PATH"), localdata.getVar("DPKG_BUILDCMD"),
+                                                             root, pkgoutdir),
                                 stderr=subprocess.STDOUT,
                                 shell=True)
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list