Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #828349

Bug#864611: config-package-dev: transform: let users pick local files as source

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Luca Boccassi <luca.boccassi@gmail.com>
Newsgroups linux.debian.bugs.dist
Subject Bug#864611: config-package-dev: transform: let users pick local files as source
Date Sun, 11 Jun 2017 17:50:01 +0200
Message-ID <tRdhL-6O2-1@gated-at.bofh.it> (permalink)
X-Mailbox-Line From debian-bugs-dist-request@lists.debian.org Sun Jun 11 15:45:10 2017
Old-Return-Path <debbugs@buxtehude.debian.org>
X-Spam-Flag NO
X-Spam-Score -2.989
Reply-To Luca Boccassi <luca.boccassi@gmail.com>, 864611@bugs.debian.org
Resent-To debian-bugs-dist@lists.debian.org
Resent-Cc Debathena Project <debathena@mit.edu>
X-Debian-Pr-Message report 864611
X-Debian-Pr-Package config-package-dev
X-Debian-Pr-Keywords patch
X-Debian-Pr-Source config-package-dev
X-Spam-Bayes score:0.0000 Tokens: new, 34; hammy, 149; neutral, 102; spammy, 1. spammytokens:0.993-1--Hx-spam-relays-external:2345 hammytokens:0.000-+--H*c:pgp-sha512, 0.000-+--H*c:pgp-signature, 0.000-+--H*RU:22b, 0.000-+--Hx-spam-relays-external:22b, 0.000-+--H*c:protocol
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:mime-version; bh=S/JcJjKEwUV/vOrio6wCkwd36NrshWMhtqs9jDeK7IY=; b=biHmfN3xAfOBnKoVbSpz6Ord+7bnNMUp+oFdSbwmisMIbWiTsgYR7y2cCBd8XLh0vq WHtaZTFLp2rRyCWijo0uS+TIVOTVfoHFRS6FwOIXuxn4Y0snjH8V1DDZ4cHROvEgYj8s cY0te7TNDT2/lNO27OnlAl09SkvWwzJxjCzAmzzoAxBmGiYqNUfn/uf832cLLFU7iFwH kx/m03zEzHuVNKEZ6bo2N1hFQcDdMYLkQCRkAWBPB3s+CtLXzPWX8DzXhqx79O2/Mv/x 40fgB+BPGQWeKF3wmTkTv/ut8//VccJ2kY3Qg9m9wtu9YzsW1CJeNeErE4P20zdxbW+B Q7eg==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:mime-version; bh=S/JcJjKEwUV/vOrio6wCkwd36NrshWMhtqs9jDeK7IY=; b=YJwrEr0/7fw6xLhXXM06k6oHTGkkwq0PKoNOuDWWvWxwaK53v49RR71x3Phu/4R1L3 I/3DULm/j5Kty89Xuuhlma86sq07UMjknuXCOsvwHEb17NHAN0tEiNLes7/RCH0mP1Gx IrRAatJArf6hUaJ2e1bJ4PZnspXwlfQsuWdDKA+zdMS6qAaCYBZw8yNsdrlWbUrFCfYx ikr7dz4kJ7Nbdr9PsIg07GTGkEQ1O5ANLkaJ69KCVUoVAanizKp4Erpc9flKuASR0HBN zLewzgO42LZE5ieOjF5msbmnGgmVWR9OMnMWD9eRHCRVjbY3uHH5h7GyRsUXiSssKG6Z jL9Q==
X-Gm-Message-State AODbwcAE0/QnTSGkIZNI0n33ezOSpZk0NimWoMizFz7m5+bb3apbNve2 jykKwOfaFCb2VZ7t18Y=
X-Received by 10.223.163.208 with SMTP id m16mr5003773wrb.61.1497195642786; Sun, 11 Jun 2017 08:40:42 -0700 (PDT)
Content-Type multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-XuzjWrCtx5XhMvbjxTlM"
X-Mailer Evolution 3.22.6-1
MIME-Version 1.0
X-Debian-Message from BTS
X-Mailing-List <debian-bugs-dist@lists.debian.org> archive/latest/1379196
List-ID <debian-bugs-dist.lists.debian.org>
List-URL <https://lists.debian.org/debian-bugs-dist/>
Approved robomod@news.nic.it
Lines 66
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Sun, 11 Jun 2017 16:40:40 +0100
X-Original-Message-ID <1497195640.22626.4.camel@gmail.com>
Xref csiph.com linux.debian.bugs.dist:828349

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Package: config-package-dev
Version: 5.1.2
Severity: wishlist
Tags: patch

Dear Maintainer,

I have a use case where I would like to transform and displace a file
shipped from the same upstream source, so that 2 binary packages (that
conflict with each other) can be built from the same repository without
having to keep local copies.

The first check, dpkg-divert --truename, immediately fails if the path
is not absolute. A simple patch is inlined.

Kind regards,
Luca Boccassi


From 15864748b3170217ed0665e3cc2716c1fdf6754c Mon Sep 17 00:00:00 2001
From: Luca Boccassi <luca.boccassi@gmail.com>
Date: Sun, 11 Jun 2017 16:29:49 +0100
Subject: [PATCH] transform: let users pick local files as source

In some case it's desirable to use a local file as the source of the
transform operation. For example, an upstream file from the same
repository that could be sourced at built time.
Skip dpkg checks on the source file if it does not start with /
---
 dh_configpackage | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/dh_configpackage b/dh_configpackage
index 942766f..e76048c 100755
--- a/dh_configpackage
+++ b/dh_configpackage
@@ -369,9 +369,13 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
         my $file = shift @$line;
         $file =~ s|^/?|/|;
         my $source;
+        my $source_is_local = 0;
         if (@$line[0] =~ /^</) {
             $source = shift @$line;
             $source =~ s/^<//;
+            if ($source !~ m!^/!) {
+                $source_is_local = 1;
+            }
         } else {
             $source = displace_files_replace_name($package, $file, "");
             if ($source eq $file) {
@@ -386,7 +390,10 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
         #    chmod 0755, $rest;
         #}
 
-        $source = check_file($source);
+        # Let users use local files as input
+        if (! $source_is_local) {
+            $source = check_file($source);
+        }
         my $destdir = dirname("$tmp/$file");
         if (! -d $destdir) {
             doit("install", "-d", $destdir);
-- 
2.11.0

Back to linux.debian.bugs.dist | Previous | Next | Find similar | Unroll thread


Thread

Bug#864611: config-package-dev: transform: let users pick local files as source Luca Boccassi <luca.boccassi@gmail.com> - 2017-06-11 17:50 +0200

csiph-web