Package: svn-buildpackage Version: 0.6.16 Severity: wishlist Tags: patch Here is patch (against SVN r2262) to fix the "perl -cw" warning. The listing was:
Name "main::secname" used only once: possible typo at ./doc/man2debiandoc.pl line 12. ./doc/man2debiandoc.pl syntax OK Name "SDCommon::version" used only once: possible typo at ./testcom.pl line 6. Name "main::tagsUrl" used only once: possible typo at ./testcom.pl line 3. Name "main::package" used only once: possible typo at ./testcom.pl line 8. ./testcom.pl syntax OK Name "SDCommon::opt_verbose" used only once: possible typo at ./svn-inject line 88. ./svn-inject syntax OK Name "SDCommon::opt_verbose" used only once: possible typo at ./svn-upgrade line 105. Name "SDCommon::version" used only once: possible typo at ./svn-upgrade line 104. ./svn-upgrade syntax OK Unquoted string "diffin" may clash with future reserved word at ./svn-buildpackage line 451. Unquoted string "diffin" may clash with future reserved word at ./svn-buildpackage line 454. Unquoted string "diffout" may clash with future reserved word at ./svn-buildpackage line 456. Unquoted string "diffout" may clash with future reserved word at ./svn-buildpackage line 464. Unquoted string "diffin" may clash with future reserved word at ./svn-buildpackage line 466. Unquoted string "diffout" may clash with future reserved word at ./svn-buildpackage line 467. Name "SDCommon::opt_verbose" used only once: possible typo at ./svn-buildpackage line 172. Name "SDCommon::opt_noninteractive" used only once: possible typo at ./svn-buildpackage line 174. Name "SDCommon::version" used only once: possible typo at ./svn-buildpackage line 131. Name "main::upsVersUrl" used only once: possible typo at ./svn-buildpackage line 303. ./svn-buildpackage syntax OK ./uclean syntax OK Name "SDCommon::nosave" used only once: possible typo at SDCommon.pm.orig line 250. Name "SDCommon::force_debian" used only once: possible typo at SDCommon.pm.orig line 289. Name "SDCommon::prop" used only once: possible typo at SDCommon.pm.orig line 322. Name "SDCommon::epoch" used only once: possible typo at SDCommon.pm.orig line 287. Name "SDCommon::URl" used only once: possible typo at SDCommon.pm.orig line 137. Changelog entry for the change: [Jari Aalto] * svn-buildpackage, svn-upgrade, svn-inject, SDCommon.pm: perl -cw "only once: possible typo" etc. warnings corrected. -- System Information: Debian Release: 4.0 APT prefers unstable APT policy: (500, 'unstable'), (500, 'stable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/dash Kernel: Linux 2.6.18-3-686 Locale: LANG=C, LC_CTYPE=C (charmap=ISO-8859-1) (ignored: LC_ALL set to en_US) Versions of packages svn-buildpackage depends on: ii devscripts 2.9.27 Scripts to make the life of a Debi ii file 4.19-1 Determines file type using "magic" ii libsvn-perl 1.4.2dfsg1-2 Perl bindings for Subversion ii perl 5.8.8-7 Larry Wall's Practical Extraction ii subversion 1.4.2dfsg1-2 Advanced version control system ii wget 1.10.2-2 retrieves files from the web svn-buildpackage recommends no packages. -- no debconf information
=== modified file 'SDCommon.pm' --- SDCommon.pm 2007-01-28 11:34:02 +0000 +++ SDCommon.pm 2007-01-28 16:55:31 +0000 @@ -1,8 +1,12 @@ package SDCommon; use base qw/ Exporter /; -our @EXPORT = qw(writeCfg withecho withechoNoPrompt needs_upsTagUrl -needs_upsCurrentUrl needs_tagsUrl url insvn long_path oldSvnDirsCheck load_dirs set_statusref); +our @EXPORT = qw +( + writeCfg withecho withechoNoPrompt needs_upsTagUrl + needs_upsCurrentUrl needs_tagsUrl url insvn long_path oldSvnDirsCheck load_dirs set_statusref +); + #### common #### # @@ -10,11 +14,21 @@ use SVN::Client; #use strict; -my $opt_quiet; -my $opt_verbose; -my $opt_noninteractive; - -my $version; +# package globals +our $opt_quiet; +our $opt_verbose; +our $opt_noninteractive; + +our $package; +our $upVersion; +our $epoch; +our $tagVersion; +our $force_debian; +our $nosave; +our $prop; +our $URl; + +our $version; # to be replaced during the package creation $version=0.5; @@ -82,7 +96,7 @@ return 1; } -## +## # Same as withecho but does not show the control prompt on errors # returns on success sub withechoNoPrompt { @@ -116,7 +130,7 @@ exit 1; } } - + # gets the url of specified local (checkout) directory sub url { @@ -128,8 +142,8 @@ $testpath=long_path($_[0]); return $cacheUrl{$testpath} if($cacheUrl{$testpath}); open($info, "svn info $testpath 2>/dev/null |"); - while(<$info>) { - $URL=$1 if(/^Url\s*:\W*(.+)\n/i); + while(<$info>) { + $URL=$1 if(/^Url\s*:\W*(.+)\n/i); $PATH=$1 if(/^Path\s*:\s*(.+)\n/i); }; if($URL && close($info)) { @@ -146,7 +160,7 @@ $url =~ /(.*:\/\/)(.*)/; $proto=$1; $url=$2; - while( $url =~ /\.\./) { + while( $url =~ /\.\./) { $url =~ s/\/\//\//g; $url =~ s/[^\/]+\/\.\.//g; $url =~ s/\/\//\//g; @@ -168,7 +182,7 @@ # helper to automate lookup for variables # does not change defined var, but looks for useful path if not defined sub such { - + my @testloc; my @testsvn; our($pre, $suf, $var, $basedir) = @_; @@ -180,14 +194,14 @@ # $basedir #"; # if basedir contains :// -> svn lookup; - # args: + # args: # prefix: like branches # suffix: like upstream # var: name of the variable we work on in %c config hash # basedir: starting directory. If ommited, `pwd` is used return if (defined($c{$var})); - + $basedir=Cwd::getcwd if(!$basedir); if($basedir=~/:\/\//) { # huch, URL was specified as $basedir? print "W: $var not specified anywhere, looking in the local repository...\n"; @@ -207,7 +221,7 @@ } for (@testsvn) { print "Looking in SVN for: @testsvn\n"; - if ($_ && insvn($_)) { + if ($_ && insvn($_)) { print "I: adding the URLs to the $cfgFile to skip the check later.\n"; $c{$var}=insvn($_); return; @@ -276,7 +290,7 @@ if( (-f "debian/changelog" && `head -n1 debian/changelog` =~ /^(\S+)\s*\(((\d+):)?(.+)\)/ ) - || + || (-f "../debian/changelog" && chdir ".." && `head -n1 debian/changelog` =~ /^(\S+)\s*\(((\d+):)?(.+)\)/ ) @@ -292,7 +306,7 @@ } print STDERR "I: Got package name and version from debian/changelog.\n" if $opt_verbose; } - else { + else { exwerror "E: Not started from the trunk/PACKAGE directory (debian/changelog garbled?).\n"; } print " @@ -331,7 +345,7 @@ print "Autodetecting remaining properties... \n"; } } - + if(-r $fromFile) { open($cfg, "<$fromFile"); while(<$cfg>) { @@ -460,7 +474,7 @@ my $curdir=Cwd::getcwd; chdir $tmpdir; - + my %tmp; my $ctx = new SVN::Client; $statusref=\%tmp; @@ -469,7 +483,7 @@ for(@src) { chdir $_; for(`find`) { - chomp; + chomp; substr($_,0,2,""); # make it svn-like paths, just trailing / is missing delete $tmp{$_}; delete $tmp{"$_/"}; === modified file 'doc/man2debiandoc.pl' (properties changed) --- doc/man2debiandoc.pl 2006-12-01 12:04:44 +0000 +++ doc/man2debiandoc.pl 2007-01-28 16:22:12 +0000 @@ -9,7 +9,7 @@ exit if /SEE ALSO/; s/^\.TH.*//; if(s/\.SH (.*)/<sect1>$1\n<p>/) { - $secname=$1; + my $secname=$1; if($sect1_open) { $_="</sect1>\n$_"; $sect1_open=0; === modified file 'svn-buildpackage' --- svn-buildpackage 2007-01-28 11:34:02 +0000 +++ svn-buildpackage 2007-01-28 17:43:03 +0000 @@ -9,9 +9,15 @@ use Cwd; #use diagnostics; -$startdir=getcwd; +# Mentioning these variables merely to quiet the +# 'used only once' warning +() = ($SDCommon::version, + $SDCommon::opt_verbose, + $SDCommon::opt_noninteractive ); + +our $startdir=getcwd; chomp($tmpfile=`mktemp`); -$scriptname="[svn-buildpackage]"; +our $scriptname="[svn-buildpackage]"; sub help { print " @@ -190,7 +196,7 @@ # no -d switch is there and no prebuild hook is set { if( (!grep {$_ eq "-d"} @ARGV) - && (! withechoNoPrompt("dpkg-checkbuilddeps")) + && (! withechoNoPrompt("dpkg-checkbuilddeps")) && ! $opt_prebuild ) @@ -300,7 +306,7 @@ return 0; } needs_upsCurrentUrl; - $upsVersUrl=$$c{"upsTagUrl"}."/$upVersion"; + my $upsVersUrl=$$c{"upsTagUrl"}."/$upVersion"; defined($$c{"upsCurrentUrl"}) || print STDERR "upsCurrentUrl not set and not located, expect problems...\n"; withecho("rm", "-rf", "$bdir.orig"); withecho "svn", "export",$$c{"upsCurrentUrl"},"$bdir.orig"; @@ -435,6 +441,8 @@ } } +local (*DIFF_IN, *DIFF_OUT); + # a cludge... if($opt_pass_diff) { $dirname="$package-$upVersion"; @@ -448,23 +456,23 @@ withecho "svn diff ".$$c{"upsCurrentUrl"}." ".$$c{"trunkUrl"}." > $afile"; withecho "cd ".$$c{"trunkDir"}." ; svn diff > $bfile"; withecho "combinediff $afile $bfile > $cfile"; - open(diffin, "cat $cfile |"); + open(DIFF_IN, "cat $cfile |"); } else { - open(diffin, "svn diff ".$$c{"upsCurrentUrl"}." ".$$c{"trunkUrl"}." |"); + open(DIFF_IN, "svn diff ".$$c{"upsCurrentUrl"}." ".$$c{"trunkUrl"}." |"); } - open(diffout,">$tmpfile"); + open(DIFF_OUT,">$tmpfile"); # fix some diff junk $invalid=1; - while(<diffin>) { + while(<DIFF_IN>) { s!^--- (\S+).*!--- $dirname.orig/$1!; s!^\+\+\+ (\S+).*!+++ $dirname/$1!; $invalid=0 if(/^---/); $invalid=1 if( (!$invalid) && /^[^+\-\t\ @]/); - $invalid || print diffout $_; + $invalid || print DIFF_OUT $_; } - close(diffin); - close(diffout); + close(DIFF_IN); + close(DIFF_OUT); $ENV{"DIFFSRC"}=$tmpfile; } === modified file 'svn-inject' --- svn-inject 2007-01-28 11:34:02 +0000 +++ svn-inject 2007-01-28 17:28:31 +0000 @@ -11,7 +11,12 @@ use lib "/usr/share/svn-buildpackage"; use SDCommon; -$ENV{"SVN_BUILDPACKAGE"} = $SDCommon::version; + +# Mentioning these variables merely to quiet the +# 'used only once' warning +() = ($SDCommon::version, $SDCommon::opt_verbose); + +$ENV{SVN_BUILDPACKAGE} = $SDCommon::version; my $basedir=getcwd; my $scriptname="[svn-inject]"; @@ -82,10 +87,7 @@ &help if ($opt_help); &help if $#ARGV < 0; -use lib "/usr/share/svn-buildpackage"; -use SDCommon; -$ENV{"SVN_BUILDPACKAGE"} = $SDCommon::version; -$SDCommon::opt_verbose=$opt_verbose; +$SDCommon::opt_verbose = $opt_verbose; my $opt_dsc=$ARGV[0]; my $use_this_repo; @@ -224,7 +226,7 @@ mkdir "current"; } withecho("mv",@filesInside, "current"); - + if($opt_onlychanged) { chdir "current" || die "Internal operation error, unable to create local import directory\n"; # code 42, stop before unlinking anything del_unreferenced(".", %ourfiles); @@ -262,7 +264,7 @@ #withecho "svn $opt_svnquiet import -m\"$scriptname Installing original source of $package\" $package $opt_svnurl/$package"; - withecho ("svn", $opt_svnquiet, "import", "-m", "$scriptname Installing original source of $package", + withecho ("svn", $opt_svnquiet, "import", "-m", "$scriptname Installing original source of $package", ($opt_layout==2) ? (".", $opt_svnurl) : ($package, "$opt_svnurl/$package")); } @@ -309,7 +311,7 @@ withecho "fakeroot debian/rules clean || debian/rules clean"; del_unreferenced(".", %ourfiles) if $opt_onlychanged; load_dirs( - ($opt_layout==1 ? "$opt_svnurl/$package/trunk" : "$opt_svnurl/trunk/$package") , + ($opt_layout==1 ? "$opt_svnurl/$package/trunk" : "$opt_svnurl/trunk/$package") , "$tempdir/trunk", "$tempdir/unpdir/$dirname"); if ($opt_onlychanged) { === modified file 'svn-upgrade' --- svn-upgrade 2007-01-28 11:34:02 +0000 +++ svn-upgrade 2007-01-28 17:31:40 +0000 @@ -8,6 +8,13 @@ use Cwd; #use diagnostics; +use lib "/usr/share/svn-buildpackage"; +use SDCommon; + +# Mentioning these variables merely to quiet the +# 'used only once' warning +() = ($SDCommon::version, $SDCommon::opt_verbose); + $startdir=getcwd; $scriptname="[svn-upgrade]"; @@ -99,15 +106,14 @@ undef($quiet) if ($verbose); -use lib "/usr/share/svn-buildpackage"; -use SDCommon; -$ENV{"SVN_BUILDPACKAGE"} = $SDCommon::version; +$ENV{SVN_BUILDPACKAGE} = $SDCommon::version; $SDCommon::opt_verbose=$verbose; SDCommon::configure; #$tagVersion=$SDCommon::tagVersion; $upVersion=$SDCommon::upVersion; $package =$SDCommon::package; $epoch =$SDCommon::epoch; + needs_tagsUrl; needs_upsTagUrl if !$mergemode; needs_upsCurrentUrl if !$mergemode; === modified file 'testcom.pl' (properties changed) --- testcom.pl 2007-01-28 11:34:02 +0000 +++ testcom.pl 2007-01-28 16:25:13 +0000 @@ -3,9 +3,11 @@ print "Test: $tagsUrl\n"; use lib "."; use SDCommon; -$ENV{"SVN_BUILDPACKAGE"} = $SDCommon::version; - -$package="svn-devscripts"; +use vars '$SDCommon::version'; + +$ENV{SVN_BUILDPACKAGE} = $SDCommon::version; + +my $package="svn-devscripts"; my $bla; print "\nURL: ".url(".")."