[mb2md] 22/30: Patch to make path expansion behave more like users expect it

Axel Beckert abe at deuxchevaux.org
Wed Oct 16 21:56:29 UTC 2013


This is an automated email from the git hooks/post-receive script.

abe pushed a commit to branch master
in repository mb2md.

commit 947942c113111e3896e6ffc10ff07598574b4ee5
Author: Axel Beckert <abe at deuxchevaux.org>
Date:   Wed Oct 16 16:59:25 2013 +0200

    Patch to make path expansion behave more like users expect it
    
    Closes: #594049
---
 debian/changelog                        |    2 ++
 debian/patches/fix-path-expansion.patch |   45 +++++++++++++++++++++++++++++++
 debian/patches/series                   |    1 +
 3 files changed, 48 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 5241e15..7576b25 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,8 @@ mb2md (3.20-5) UNRELEASED; urgency=low
     + Finally switch to a dh7 style debian/rules file.
   * Fix further lintian warnings:
     + description-possibly-contains-homepage and no-homepage-field
+  * Add patch to make source and destination path expansion behave more
+    like most users expect it. (Closes: #594049)
 
  -- Axel Beckert <abe at debian.org>  Wed, 16 Oct 2013 14:44:56 +0200
 
diff --git a/debian/patches/fix-path-expansion.patch b/debian/patches/fix-path-expansion.patch
new file mode 100644
index 0000000..7bd66a5
--- /dev/null
+++ b/debian/patches/fix-path-expansion.patch
@@ -0,0 +1,45 @@
+Index: mb2md/mb2md-3.20.pl
+===================================================================
+--- mb2md.orig/mb2md-3.20.pl	2013-10-16 14:41:39.000000000 +0200
++++ mb2md/mb2md-3.20.pl	2013-10-16 16:52:21.000000000 +0200
+@@ -411,6 +411,7 @@
+ my $dest = undef;
+ my $strip_ext = undef;
+ my $use_cl = undef;	# defines whether we use the Content-Length: header if present
++my $pwd = `pwd`; chomp($pwd);
+ 
+ # if option "-c" is given, we use the Content-Length: header if present
+ # dangerous! may be unreliable, as the whole CL stuff is a bad idea
+@@ -443,7 +444,7 @@
+ 	# it is a subdir of the users $home
+ 	# if it does start with a "/" then
+ 	# let's take $mbroot as a absolut path
+-	$opts{s} = "$homedir/$opts{s}" if ($opts{s} !~ /^\//); 
++	$opts{s} = "$homedir/$opts{s}" if ($opts{s} !~ m(^[/.]));
+ 
+ 	# check if the given source is a mbox file
+ 	if (-f $opts{s})
+@@ -493,13 +494,13 @@
+ 
+ # if the destination is relative to the home dir,
+ # check that the home dir exists
+-die("Fatal: home dir $homedir doesn't exist.\n") if ($dest !~ /^\// &&  ! -e $homedir);
++die("Fatal: home dir $homedir doesn't exist.\n") if ($dest !~ m(^[/.]) &&  ! -e $homedir);
+ 
+ #
+ # form the destination value
+ # slap the home dir on the front of the dest if the dest does not begin
+ # with a '/'
+-$dest = "$homedir/$dest" if ($dest !~ /^\//);
++$dest = "$homedir/$dest" if ($dest !~ m(^[/.]));
+ # get rid of trailing /'s
+ $dest =~ s/\/$//;
+ 
+@@ -754,6 +755,7 @@
+         # Change to the target mailbox directory.
+ 
+         chdir "$maildir" ;
++        $mbox = "$pwd/$mbox";
+ 
+          	    # Converts a Mbox to multiple files
+                     # in a Maildir.
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..363de90
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix-path-expansion.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/mb2md.git



More information about the Pkg-perl-cvs-commits mailing list