[devscripts] 01/03: mk-origtargz: Proper message when final file was passed as an argument

Joachim Breitner nomeata at moszumanska.debian.org
Tue Apr 15 15:10:51 UTC 2014


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

nomeata pushed a commit to branch master
in repository devscripts.

commit f88c4e9a9f17ea3d4b99de9c4ea5643fb75da469
Author: Joachim Breitner <nomeata at debian.org>
Date:   Tue Apr 15 16:58:36 2014 +0200

    mk-origtargz: Proper message when final file was passed as an argument
---
 scripts/mk-origtargz.pl | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/scripts/mk-origtargz.pl b/scripts/mk-origtargz.pl
index fc19ab3..1ec054a 100755
--- a/scripts/mk-origtargz.pl
+++ b/scripts/mk-origtargz.pl
@@ -439,8 +439,9 @@ if ($do_repack || $deletecount) {
 
 # Final step: symlink, copy or rename.
 
-my $same_name = abs_path($destfile) eq abs_path($curfile);
-if ($same_name) {
+my $same_name = abs_path($destfile) eq abs_path($upstream);
+my $nothing_todo = abs_path($destfile) eq abs_path($curfile);
+if ($nothing_todo) {
 	# we were asked to rename, but had to repack. Remove
 	# the original upstream (unless it is the destfile)
 	if ($mode eq "rename" and not (abs_path($upstream) eq abs_path($destfile))) {
@@ -462,16 +463,20 @@ if ($same_name) {
 my $upstream_nice = File::Spec->canonpath($upstream);
 my $destfile_nice = File::Spec->canonpath($destfile);
 
-if ($is_zipfile or $do_repack or $deletecount) {
-	print "Successfully repacked $upstream_nice as $destfile_nice";
-} elsif ($mode eq "symlink") {
-	print "Successfully symlinked $upstream_nice to $destfile_nice";
-} elsif ($mode eq "copy") {
-	print "Successfully copied $upstream_nice to $destfile_nice";
-} elsif ($mode eq "rename") {
-	print "Successfully renamed $upstream_nice to $destfile_nice";
+if ($same_name) {
+	print "Leaving $destfile_nice where it is";
 } else {
-	die "Unknown mode $mode."
+	if ($is_zipfile or $do_repack or $deletecount) {
+		print "Successfully repacked $upstream_nice as $destfile_nice";
+	} elsif ($mode eq "symlink") {
+		print "Successfully symlinked $upstream_nice to $destfile_nice";
+	} elsif ($mode eq "copy") {
+		print "Successfully copied $upstream_nice to $destfile_nice";
+	} elsif ($mode eq "rename") {
+		print "Successfully renamed $upstream_nice to $destfile_nice";
+	} else {
+		die "Unknown mode $mode."
+	}
 }
 
 if ($deletecount) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list