[devscripts] 03/05: uscan: backup old uscan.log

Osamu Aoki osamu at moszumanska.debian.org
Sun Oct 18 15:16:33 UTC 2015


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

osamu pushed a commit to branch multitar
in repository devscripts.

commit 55df5c0d2554fee4559f74361db1733470b01b43
Author: Osamu Aoki <osamu at debian.org>
Date:   Sun Oct 18 16:44:00 2015 +0900

    uscan: backup old uscan.log
    
    Some watch file has 2 upstream sites listed for a package.
    
    So making a single backup is enough to make some workaround
    for such an awkward watch file situation.
---
 scripts/uscan.pl | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/uscan.pl b/scripts/uscan.pl
index 4fb89d7..314fe32 100755
--- a/scripts/uscan.pl
+++ b/scripts/uscan.pl
@@ -3391,8 +3391,13 @@ EOF
     # Check pkg-ver.tar.gz and pkg_ver.orig.tar.gz
     if (! defined $uscanlog) {
 	$uscanlog = "../${pkg}_${common_mangled_newversion}.uscan.log";
+	if (-e "$uscanlog.old") {
+	    unlink "$uscanlog.old" or uscan_die "Can\'t remove old backup log $uscanlog.old: $!";
+	    uscan_msg "Old backup uscan log found.  Remove: $uscanlog.old\n";
+	}
 	if (-e $uscanlog) {
-	    uscan_warn "??? STRANGE ??? uscan log file already exists: $uscanlog (appending)\n";
+	    move($uscanlog, "$uscanlog.old");
+	    uscan_msg "Old uscan log found.  Moved to: $uscanlog.old\n";
 	}
 	open(USCANLOG, ">> $uscanlog") or uscan_die "$progname: could not open $uscanlog for append: $!\n";
 	print USCANLOG "# uscan log\n";

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