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

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 2017-06-11 17:50 +0200
Message-ID <tRdhL-6O2-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | 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