chiark / gitweb /
nailing-cargo: Fixes etc.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 6 May 2020 22:05:29 +0000 (23:05 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 6 May 2020 22:05:29 +0000 (23:05 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
nailing-cargo

index afb457db21c3589bcd64c09ceca501f2155ba21a..a094b6058682227b55ac12718526ac61ea129ece 100755 (executable)
@@ -52,7 +52,8 @@ $worksphere =~ s{/[^/]+$}{} or die "$self: cwd \`$worksphere' unsupported!\n";
 our $lockfile = "../.nailing-cargo-sphere.lock";
 
 our @configs;
-our ($verbose,$noact,$dump);
+our $verbose=1;
+our ($noact,$dump);
 
 sub read_or_enoent ($) {
     my ($fn) = @_;
@@ -153,7 +154,7 @@ our %packagemap;
 sub read_manifest ($) {
     my ($subdir) = @_;
     my $manifest = "../$subdir/Cargo.toml";
-    print STDERR "$self: reading $manifest...\n" if $verbose>=3;
+    print STDERR "$self: reading $manifest...\n" if $verbose>=4;
     if (defined $manifests{$manifest}) {
        print STDERR
 "$self: warning: $subdir: specified more than once!\n";
@@ -264,7 +265,7 @@ sub install () {
        }
        rename $use, $mf or die "$self: install nailed $use: $!\n";
        unlink_or_enoent $rm or die "$self: remove old $rm: $!\n";
-       print STDERR "Nailed $mf\n" if $verbose>=2;
+       print STDERR "Nailed $mf\n" if $verbose>=3;
     }
 }
 
@@ -306,6 +307,8 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
        while (m{^-.}) {
            if (s{^-v}{-}) {
                $verbose++;
+           } elsif (s{^-q}{-}) {
+               $verbose=0;
            } elsif (s{^-n}{-}) {
                $noact++;
            } elsif (s{^-D}{-}) {
@@ -339,9 +342,7 @@ install();
 
 my $estatus = invoke();
 
-print STDERR "INVOKED\n";
 uninstall();
-print STDERR "UNINSTALLED\n";
 $want_uninstall = 1;
 
 exit $estatus;