Openembedded Core Discussions
 help / color / mirror / Atom feed
* deb: allow custom dpkg command
@ 2019-08-08  4:58 Tim Blechmann
  2019-08-08 10:11 ` Alexander Kanavin
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Blechmann @ 2019-08-08  4:58 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

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

[-- Attachment #2: 0001-package_deb-allow-dpkg-deb-to-be-customized-via-DPKG.patch --]
[-- Type: text/plain, Size: 1745 bytes --]

From 62d4930d307d5d07844889001e8a1c3111b72b98 Mon Sep 17 00:00:00 2001
From: Tim Blechmann <tim@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@klingt.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 6f81591653..790b26aef2 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)
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: deb: allow custom dpkg command
  2019-08-08  4:58 deb: allow custom dpkg command Tim Blechmann
@ 2019-08-08 10:11 ` Alexander Kanavin
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Kanavin @ 2019-08-08 10:11 UTC (permalink / raw)
  To: Tim Blechmann; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 782 bytes --]

The patch seems ok, but can you resend it directly (instead of sending
attachments) please? Use 'git send-email'.

Alex

On Thu, 8 Aug 2019 at 07:15, Tim Blechmann <tim@klingt.org> wrote:

> 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
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 1326 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-08 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-08  4:58 deb: allow custom dpkg command Tim Blechmann
2019-08-08 10:11 ` Alexander Kanavin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox