Bug#784130: git-debcherry: trailing slash in -o argument breaks patch series file
Ron r...@debian.org writes: Thanks for this. We can probably do it without needing sed though, something like this: diff --git a/git-debcherry b/git-debcherry index 76032c7..b01e161 100755 --- a/git-debcherry +++ b/git-debcherry @@ -115,7 +115,7 @@ while : ; do shift ;; -o | --output-directory) - patch_dir=$2 + patch_dir=${2%/} case $patch_dir in /*) For whatever reason I had to hand apply the patch against gitpkg 0.26, but it seems to work OK for me. From 48bb8f8dfc7587bc7d63b216390ed35f080abe61 Mon Sep 17 00:00:00 2001 From: David Bremner brem...@debian.org Date: Thu, 21 May 2015 20:28:29 +0200 Subject: [PATCH] debcherry: strip trailing slash from output directory This is a proposed fix for debian bug 784130 --- git-debcherry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-debcherry b/git-debcherry index 76032c7..b01e161 100755 --- a/git-debcherry +++ b/git-debcherry @@ -115,7 +115,7 @@ while : ; do shift ;; -o | --output-directory) - patch_dir=$2 + patch_dir=${2%/} case $patch_dir in /*) ;; -- 2.1.4
Bug#784130: git-debcherry: trailing slash in -o argument breaks patch series file
Hi Niko, On Sun, May 03, 2015 at 01:57:49PM +0300, Niko Tyni wrote: Package: gitpkg Version: 0.26 Severity: minor Tags: patch A trailing slash in the patch directory argument (-o) of git-debcherry silently breaks the patch series file, because the generation unconditionally appends a slash to the value, causing the sed command to fail and leaving absolute pathnames in the series. Proposed patch attached. Thanks for this. We can probably do it without needing sed though, something like this: diff --git a/git-debcherry b/git-debcherry index 76032c7..b01e161 100755 --- a/git-debcherry +++ b/git-debcherry @@ -115,7 +115,7 @@ while : ; do shift ;; -o | --output-directory) - patch_dir=$2 + patch_dir=${2%/} case $patch_dir in /*) ;; I've added David to the CC for this one, please include him in the discussion for any other git-debcherry related changes too, since I'd like his review and ack before pushing any of those (especially for things like #784159 where it's not quite as clear cut as this). [Knowing how these sort of things unfold, I'm kind of anticipating you running into at least one or two other interesting things that haven't come up before now too! ;] Thanks! Ron From 9de71b37282a0fbae44a2582dfd4d1cc7e8d Mon Sep 17 00:00:00 2001 From: Niko Tyni nt...@debian.org Date: Sun, 3 May 2015 13:50:04 +0300 Subject: [PATCH] Strip trailing slash from patch directory A trailing slash in the patch directory argument would silently break the patch series file, because the generation unconditionally appends a slash to the value. --- git-debcherry | 1 + 1 file changed, 1 insertion(+) diff --git a/git-debcherry b/git-debcherry index 76032c7..4766600 100755 --- a/git-debcherry +++ b/git-debcherry @@ -122,6 +122,7 @@ while : ; do *) patch_dir=$(pwd)/$patch_dir esac + patch_dir=$(echo $patch_dir | sed 's,/$,,') shift; shift; ;; -- 2.1.4 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#784130: git-debcherry: trailing slash in -o argument breaks patch series file
Package: gitpkg Version: 0.26 Severity: minor Tags: patch A trailing slash in the patch directory argument (-o) of git-debcherry silently breaks the patch series file, because the generation unconditionally appends a slash to the value, causing the sed command to fail and leaving absolute pathnames in the series. Proposed patch attached. -- System Information: Debian Release: 8.0 APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages gitpkg depends on: ii dpkg-dev 1.17.25 ii git 1:2.1.4-2.1 gitpkg recommends no packages. Versions of packages gitpkg suggests: ii devscripts 2.15.3 -- no debconf information From 9de71b37282a0fbae44a2582dfd4d1cc7e8d Mon Sep 17 00:00:00 2001 From: Niko Tyni nt...@debian.org Date: Sun, 3 May 2015 13:50:04 +0300 Subject: [PATCH] Strip trailing slash from patch directory A trailing slash in the patch directory argument would silently break the patch series file, because the generation unconditionally appends a slash to the value. --- git-debcherry | 1 + 1 file changed, 1 insertion(+) diff --git a/git-debcherry b/git-debcherry index 76032c7..4766600 100755 --- a/git-debcherry +++ b/git-debcherry @@ -122,6 +122,7 @@ while : ; do *) patch_dir=$(pwd)/$patch_dir esac + patch_dir=$(echo $patch_dir | sed 's,/$,,') shift; shift; ;; -- 2.1.4