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 9de71baaaa37282a0fbae44a2582dfd4d1cc7e8d 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

Reply via email to