diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/syncqt | 39 |
1 files changed, 25 insertions, 14 deletions
@@ -62,6 +62,7 @@ my %moduleheaders = ( # restrict the module headers to those found in relative p # global variables (modified by options) my $module = 0; my $showonly = 0; +my $quiet = 0; my $remove_stale = 1; my $force_win = 0; my $force_relative = 0; @@ -92,6 +93,7 @@ sub showUsage print " -windows Force platform to Windows (default: " . ($force_win ? "yes" : "no") . ")\n"; print " -showonly Show action but not perform (default: " . ($showonly ? "yes" : "no") . ")\n"; print " -outdir <PATH> Specify output directory for sync (default: $out_basedir)\n"; + print " -quiet Only report problems, not activity (default: " . ($quiet ? "yes" : "no") . ")\n"; print " -separate-module <NAME>:<PROFILEDIR>:<HEADERDIR> Create headers for <NAME> with original headers in <HEADERDIR> relative to <PROFILEDIR> \n"; print " -help This help\n"; exit 0; @@ -322,7 +324,7 @@ sub syncHeader { unless(-e "$header") { my $header_dir = dirname($header); - mkpath $header_dir, 0777; + mkpath $header_dir, !$quiet; #write it my $iheader_out = fixPaths($iheader, $header_dir); @@ -462,7 +464,7 @@ sub copyFile if ( $knowdiff || ($filecontents ne $ifilecontents) ) { if ( $copy > 0 ) { my $file_dir = dirname($file); - mkpath $file_dir, 0777 unless(-e "$file_dir"); + mkpath $file_dir, !$quiet unless(-e "$file_dir"); open(O, "> " . $file) || die "Could not open $file for writing (no write permission?)"; local $/; binmode O; @@ -471,7 +473,7 @@ sub copyFile return 1; } elsif ( $copy < 0 ) { my $ifile_dir = dirname($ifile); - mkpath $ifile_dir, 0777 unless(-e "$ifile_dir"); + mkpath $ifile_dir, !$quiet unless(-e "$ifile_dir"); open(O, "> " . $ifile) || die "Could not open $ifile for writing (no write permission?)"; local $/; binmode O; @@ -497,7 +499,7 @@ sub symlinkFile my ($file,$ifile) = @_; if ($isunix) { - print "symlink created for $file "; + print "symlink created for $file " unless $quiet; if ( $force_relative && ($ifile =~ /^$basedir/)) { my $t = getcwd(); my $c = -1; @@ -505,9 +507,9 @@ sub symlinkFile $t =~ s-^$basedir/--; $p .= "../" while( ($c = index( $t, "/", $c + 1)) != -1 ); $file =~ s-^$basedir/-$p-; - print " ($file)\n"; + print " ($file)\n" unless $quiet; } - print "\n"; + print "\n" unless $quiet; return symlink($file, $ifile); } return copyFile($file, $ifile); @@ -591,6 +593,9 @@ while ( @ARGV ) { } elsif("$arg" eq "-show") { $var = "showonly"; $val = "yes"; + } elsif("$arg" eq "-quiet") { + $var = "quiet"; + $val = "yes"; } elsif("$arg" eq "-base-dir") { # skip, it's been dealt with at the top of the file shift @ARGV; @@ -613,6 +618,12 @@ while ( @ARGV ) { } elsif($showonly) { $showonly--; } + } elsif ("$var" eq "quiet") { + if("$val" eq "yes") { + $quiet++; + } elsif($quiet) { + $quiet--; + } } elsif ("$var" eq "check-includes") { if("$val" eq "yes") { $check_includes++; @@ -638,7 +649,7 @@ while ( @ARGV ) { $force_relative--; } } elsif ("$var" eq "module") { - print "module :$val:\n"; + print "module :$val:\n" unless $quiet; die "No such module: $val" unless(defined $modules{$val}); push @modules_to_sync, $val; } elsif ("$var" eq "separate-module") { @@ -666,7 +677,7 @@ while ( @ARGV ) { $isunix = checkUnix; #cache checkUnix # create path -mkpath "$out_basedir/include", 0777; +mkpath "$out_basedir/include", !$quiet; my @ignore_headers = (); my $class_lib_map_contents = ""; @@ -869,7 +880,7 @@ foreach (@modules_to_sync) { $pri_install_pfiles.= "$pri_install_iheader ";; } } - print "header created for $iheader ($header_copies)\n" if($header_copies > 0); + print "header created for $iheader ($header_copies)\n" if($header_copies > 0 && !$quiet); } } } @@ -896,8 +907,8 @@ foreach (@modules_to_sync) { } if($master_include && $master_contents) { my $master_dir = dirname($master_include); - mkpath $master_dir, 0777; - print "header (master) created for $lib\n"; + mkpath $master_dir, !$quiet; + print "header (master) created for $lib\n" unless $quiet; open MASTERINCLUDE, ">$master_include"; print MASTERINCLUDE "$master_contents"; close MASTERINCLUDE; @@ -921,8 +932,8 @@ foreach (@modules_to_sync) { } if($headers_pri_file && $master_contents) { my $headers_pri_dir = dirname($headers_pri_file); - mkpath $headers_pri_dir, 0777; - print "headers.pri file created for $lib\n"; + mkpath $headers_pri_dir, !$quiet; + print "headers.pri file created for $lib\n" unless $quiet; open HEADERS_PRI_FILE, ">$headers_pri_file"; print HEADERS_PRI_FILE "$headers_pri_contents"; close HEADERS_PRI_FILE; @@ -942,7 +953,7 @@ unless($showonly || !$create_uic_class_map) { } if($class_lib_map) { my $class_lib_map_dir = dirname($class_lib_map); - mkpath $class_lib_map_dir, 0777; + mkpath $class_lib_map_dir, !$quiet; open CLASS_LIB_MAP, ">$class_lib_map"; print CLASS_LIB_MAP "$class_lib_map_contents"; close CLASS_LIB_MAP; |