3 # update-all-config.pl - Update all out-of-date config
8 BEGIN {*VERSION = \'2.1'}
16 eval 'require Pod::Text::Termcap; 1;' and
17 @Pod::Usage
::ISA
= (qw( Pod::Text::Termcap ));
18 defined($ENV{PERLDOC
}) && $ENV{PERLDOC
} ne "" or
19 $ENV{PERLDOC
} = "-oterm -oman";
21 use lib
"__BASEDIR__";
29 $shbin = $Girocco::Config
::posix_sh_bin
;
30 defined($shbin) && $shbin ne "" or $shbin = "/bin/sh";
33 exit(&main
(@ARGV)||0);
35 my ($dryrun, $force, $quiet);
38 pod2usage
(-exitval
=> 2);
42 pod2usage
(-verbose
=> 2, -exitval
=> 0);
46 print basename
($0), " version ", $VERSION, "\n";
50 my ($dmode, $dperm, $drwxmode, $fmode, $fmodeoct, $fperm, $wall);
54 $drwxmode='ug+rwx,o+rx';
62 my $htmlcache_owning_group_id;
63 my $ctags_owning_group_id;
66 sub pwarn
{ $progress->warn(@_) }
73 close(DATA
) if fileno(DATA
);
74 Getopt
::Long
::Configure
('bundling');
76 'help|h' => sub {do_help
},
77 'version|V' => sub {do_version
},
78 'dry-run|n' => \
$dryrun,
82 $dryrun and $quiet = 0;
84 -f jailed_file
("/etc/group") or
85 die "Girocco group file not found: " . jailed_file
("/etc/group") . "\n";
87 if (!defined($Girocco::Config
::owning_group
) || $Girocco::Config
::owning_group
eq "") {
88 die "\$Girocco::Config::owning_group unset, refusing to run without --force\n" unless $force;
96 warn "Mode 666 in effect\n" unless $quiet;
97 } elsif (($owning_group_id = scalar(getgrnam($Girocco::Config
::owning_group
))) !~ /^\d+$/) {
98 die "\$Girocco::Config::owning_group invalid ($Girocco::Config::owning_group), refusing to run\n";
100 if (defined($owning_group_id) && $Girocco::Config
::htmlcache_owning_group
) {
101 die "\$Girocco::Config::htmlcache_owning_group invalid ($Girocco::Config::htmlcache_owning_group), refusing to run\n"
102 unless ($htmlcache_owning_group_id = scalar(getgrnam($Girocco::Config
::htmlcache_owning_group
))) =~ /^\d+$/;
104 if (defined($owning_group_id) && $Girocco::Config
::ctags_owning_group
) {
105 die "\$Girocco::Config::ctags_owning_group invalid ($Girocco::Config::ctags_owning_group), refusing to run\n"
106 unless ($ctags_owning_group_id = scalar(getgrnam($Girocco::Config
::ctags_owning_group
))) =~ /^\d+$/;
109 my @allprojs = Girocco
::Project
::get_full_list
;
112 my $root = $Girocco::Config
::reporoot
;
113 $root or die "\$Girocco::Config::reporoot is invalid\n";
115 $root ne "" or $root = "/";
116 $root = realpath
($root);
117 $root = $1 if $root =~ m
|^(/.+)$|;
119 my %projnames = map {($_ => 1)} @allprojs;
123 -d
$_ and $_ = realpath
($_);
124 $_ = $1 if $_ =~ m
|^(.+)$|;
127 if (!exists($projnames{$_})) {
128 warn "$_: unknown to Girocco (not in etc/group)\n"
135 @projects = sort {lc($a) cmp lc($b) || $a cmp $b} @allprojs;
140 $progress = Girocco
::CLIUtil
::Progress
->new(scalar(@projects),
141 "Updating config files");
142 foreach (@projects) {
143 my $projdir = "$root/$_.git";
145 pwarn
"$_: does not exist -- skipping\n" unless $quiet;
148 if (!is_git_dir
($projdir)) {
149 pwarn
"$_: is not a .git directory -- skipping\n" unless $quiet;
152 if (-e
"$projdir/.noconfig") {
153 pwarn
"$_: found .noconfig -- skipping\n" unless $quiet;
156 if (!chdir($projdir)) {
157 pwarn
"$_: chdir to project directory failed: $!\n" unless $quiet;
160 process_one_project
($_) or $bad = 1;
161 } continue {$progress->update}
167 my (@mkdirs, @mkfiles);
168 my (@fixdpermsdirs, @fixdpermsrwx, @fixfpermsfiles, @fixfpermsdirs);
170 @mkdirs = qw(refs info hooks ctags htmlcache bundles reflogs objects objects/info);
171 @mkfiles = qw(config info/lastactivity);
172 @fixdpermsdirs = qw(. refs info ctags htmlcache bundles reflogs objects objects/info);
173 @fixdpermsrwx = qw(refs objects);
174 @fixfpermsfiles = qw(HEAD config description packed-refs README.html info/lastactivity
175 info/alternates info/http-alternates info/packs);
176 @fixfpermsdirs = qw(ctags);
179 my (@boolvars, @falsevars, @false0vars, @truevars);
181 @boolvars = qw(gitweb.statusupdates);
182 @falsevars = qw(core.ignorecase receive.denynonfastforwards);
183 @false0vars = qw(receive.autogc);
184 @truevars = qw(receive.fsckobjects receive.updateserverinfo repack.writebitmaps transfer.fsckobjects);
190 return defined($_[0]) ?
$_[0] : $_[1];
197 open $duperr, '>&2' or last;
198 my $errfd = POSIX
::open(File
::Spec
->devnull, &POSIX
::O_RDWR
);
199 defined($errfd) or close($duperr), $duperr = undef, last;
200 POSIX
::dup2
($errfd, 2) or close($duperr), $duperr = undef;
201 POSIX
::close($errfd);
204 my $ans = open $fd, '-|', "find", @_;
205 if ($noe && defined($duperr) && defined(fileno($duperr))) {
206 POSIX
::dup2
(fileno($duperr), 2);
209 $ans or die "\nfind failed: $!\n";
213 sub openfind
{ return openfind_
(0, @_); }
214 sub openfindne
{ return openfind_
(1, @_); }
220 my ($i,$r) = (index($_,"."),rindex($_,"."));
221 substr($_,$i+1,$r-$i-1);
222 } grep(/^remote\.[^.].*\.url$/i, keys(%$config)));
225 sub has_default_fetch_spec
228 my $default = $config->{'remotes.default'};
229 my @remotes = defined($default) ?
split(' ', $default) : all_remotes
($config);
231 defval
($config->{"remote.$_.url"},"") ne "" or next;
232 !defined($default) && git_bool
($config->{"remote.$_.skipdefaultupdate"}) and next;
233 defval
($config->{"remote.$_.fetch"},"") ne "" and return 1;
238 sub is_native_git_mirror_url
241 defined($bu) && $bu ne "" or return 0;
242 # All current or former natively supported by Git URLs return true:
243 # 1. rsync: (removed in 2.8.0, also recognize rsync+ and rsync::)
244 # 2. ftp:/ftps: (strongly discouraged)
246 # 4. http:/https: (smart and non-smart)
248 # 6. scp-like ssh syntax [user@]host:[^:/]
255 (?
:[^\s
:\@
]+\@
)?
[^\s
:\@
+]+:(?
!\
/\/)[^\s
:\\]
262 return lc($v) =~ /^(?:false|true|umask|group|all|world|everybody|0|1|2|0[0-7]{1,3})$/
267 local $_ = lc(shift);
268 /^(?:false|umask|00*)$/ and return 0;
269 /^(?:true|group|1|00*1)$/ and return 1;
270 /^(?:all|world|everybody|2|00*2)$/ and return 2;
271 /^0[0-7]*$/ and return oct($_);
275 sub process_one_project
284 pwarn
"$proj: bypassing project, exists but not directory: $_\n" unless $quiet;
285 $reallybad = $bad = 1;
288 my $grpid = $owning_group_id;
289 $grpid = $htmlcache_owning_group_id
290 if $htmlcache_owning_group_id && $_ eq "htmlcache";
291 $grpid = $ctags_owning_group_id
292 if $ctags_owning_group_id && $_ eq "ctags";
293 do_mkdir
($proj, $_, $grpid) or $bad = 1, last;
297 return 0 if $reallybad;
300 is_git_dir
("private") or
301 pwarn
"$proj: exists but not a gitdir: private\n" unless $quiet;
305 $result = "created (dryrun)";
307 $result = (system("$Girocco::Config::basedir/bin/create-private-area", $proj) == 0) ?
308 "created" : "creation failed";
310 pmsg
($proj, "private refs area", $result) unless $quiet;
313 -d
$_ && check_dperm
($proj, $_) or $bad = 1 foreach (@fixdpermsdirs);
314 my $fp = openfindne
(@fixdpermsrwx, qw(-xdev -type d ( ! -path objects/?? -o -prune ) ! -perm
), "-$drwxmode", "-print");
317 change_dpermrwx
($proj, $_) or $bad = 1;
319 close($fp) or $bad = 1;
320 $fp = openfind
(qw(. -xdev -type d ( ! -path ./objects/?? -o -prune ) ! -perm
-a
+rx
-print));
323 change_dpermrx
($proj, $_) or $bad = 1;
325 close($fp) or $bad = 1;
330 pwarn
"$proj: bypassing project, exists but not file: $_\n" unless $quiet;
331 $reallybad = $bad = 1;
335 my $result = "(dryrun)";
339 open($tf, '>', $_) && close ($tf) or $result = "FAILED", $bad = 1;
341 pmsg
($proj, "$_: created", $result) unless $quiet;
344 return 0 if $reallybad;
346 $dryrun || check_fperm
($proj, "config") or $bad = 1;
347 my $config = read_config_file_hash
("config", !$quiet);
348 if (!defined($config)) {
349 pwarn
"$proj: could not read config file -- skipping\n" unless $quiet;
353 my $do_config = sub {
354 my ($item, $val) = @_;
355 my $oldval = defval
($config->{$item},"");
356 my $result = "(dryrun)";
359 system($Girocco::Config
::git_bin
, "config", "--file", "config", "--replace-all", $item, $val) == 0 or
360 $result = "FAILED", $bad = 1;
362 if (!exists($config->{$item})) {
363 pmsg
($proj, "config $item: created \"$val\"", $result) unless $quiet;
365 pmsg
($proj, "config $item: \"$oldval\" -> \"$val\"", $result) unless $quiet;
368 my $do_config_unset = sub {
369 my ($item, $msg) = @_;
370 defined($msg) or $msg = "";
371 $msg eq "" or $msg = " " . $msg;
372 my $oldval = defval
($config->{$item},"");
373 my $result = "(dryrun)";
376 system($Girocco::Config
::git_bin
, "config", "--file", "config", "--unset-all", $item) == 0 or
377 $result = "FAILED", $bad = 1;
379 pmsg
($proj, "config $item: removed$msg \"$oldval\"", $result) unless $quiet;
382 my $repovers = $config->{'core.repositoryformatversion'};
383 if (!defined($repovers)) {
385 } elsif ($repovers =~ /^[2345]$/) {
386 pmsg
($proj, "WARNING: unknown core.repositoryformatversion value left unchanged: \"$repovers\"")
388 } elsif ($repovers !~ /^[01]$/) {
389 pmsg
($proj, "WARNING: replacing invalid core.repositoryformatversion value: \"$repovers\"")
393 &$do_config('core.repositoryformatversion', 0) if $repovers eq "";
394 my $hookspath = $Girocco::Config
::reporoot
. "/_global/hooks";
395 my $cfghooks = defval
($config->{'core.hookspath'},"");
396 if ($cfghooks ne $hookspath) {
397 my $updatehookspath = 1;
398 $hookspath = $Girocco::Config
::reporoot
. "/$proj.git/hooks" if $Girocco::Config
::localhooks
;
399 if ($cfghooks =~ m{^/[^/]} && -d
$cfghooks && -d
"hooks") {
400 # tolerate this situation provided the realpath of $cfghooks
401 # matches the realpath of the hooks subdirectory and the hooks
402 # subdirectory exists; actually making sure the correct symlinks
403 # are present remains up to update-all-hooks not us
404 if (realpath
($cfghooks) eq realpath
("hooks")) {
405 # we do, however, insist that it be stored exactly
406 # as $reporoot/<project_name>.git/hooks in this case because
407 # that's the only guaranteed version that works in the chroot
408 $hookspath = $Girocco::Config
::reporoot
. "/$proj.git/hooks";
409 $cfghooks eq $hookspath and $updatehookspath = 0;
412 &$do_config('core.hookspath', $hookspath) if $updatehookspath;
414 my $cmplvl = defval
($config->{'core.compression'},"");
415 if ($cmplvl !~ /^-?\d+$/ || $cmplvl < -1 || $cmplvl > 9 || "" . (0 + $cmplvl) ne "" . $cmplvl) {
416 pmsg
($proj, "WARNING: replacing invalid core.compression value: \"$cmplvl\"")
417 unless $cmplvl eq "" || $quiet;
419 } elsif ($cmplvl != 5) {
420 pmsg
($proj, "WARNING: suboptimal core.compression value left unchanged: \"$cmplvl\"") unless $quiet;
422 $cmplvl ne "" or &$do_config('core.compression', 5);
423 my $grpshr = defval
($config->{'core.sharedrepository'},"");
424 if ($grpshr eq "" || (git_valid_shared
($grpshr) &&
425 git_get_shared
($grpshr) != $Girocco::Config
::git_shared_repository_setting
)) {
426 &$do_config('core.sharedrepository', $Girocco::Config
::git_shared_repository_setting
);
427 } elsif (!git_valid_shared
($grpshr)) {
428 pmsg
($proj, "WARNING: odd core.sharedrepository value left unchanged: \"$grpshr\"") unless $quiet;
430 if (git_bool
($config->{'core.bare'})) {
432 my $laru = $config->{'core.logallrefupdates'};
433 if (defined($laru)) {
434 if (valid_bool
($laru)) {
436 if (git_bool
($laru)) {
437 pmsg
($proj, "WARNING: core.logallrefupdates is true (left unchanged)")
438 unless $quiet || -d
"worktrees";
441 pmsg
($proj, "WARNING: replacing non-boolean core.logallrefupdates value") unless $quiet;
444 !$setlaru or &$do_config('core.logallrefupdates', 'false');
446 pmsg
($proj, "WARNING: core.bare is not true (left unchanged)") unless $quiet;
448 my $precious = defval
($config->{'extensions.preciousobjects'},"");
449 valid_bool
($precious) && git_bool
($precious) or &$do_config('extensions.preciousobjects', 'true');
450 defval
($config->{'transfer.unpacklimit'},"") eq "1" or &$do_config('transfer.unpacklimit', 1);
451 lc(defval
($config->{'receive.denydeletecurrent'},"")) eq "warn" or &$do_config('receive.denydeletecurrent', 'warn');
453 !exists($config->{$_}) || valid_bool
(defval
($config->{$_},"")) or &$do_config_unset($_, "(not a boolean)");
454 } foreach (@boolvars);
456 (valid_bool
(defval
($config->{$_},"")) && !git_bool
($config->{$_})) or &$do_config($_, "false");
457 } foreach (@falsevars);
459 (valid_bool
(defval
($config->{$_},"")) && !git_bool
($config->{$_})) or &$do_config($_, 0);
460 } foreach (@false0vars);
462 (valid_bool
(defval
($config->{$_},"")) && git_bool
($config->{$_})) or &$do_config($_, "true");
463 } foreach (@truevars);
465 if (defined($Girocco::Config
::owning_group
) && $Girocco::Config
::owning_group
ne "") {
466 $fp = openfind
(qw(. -xdev ( -type d -o -type f ) ! -group
), $Girocco::Config
::owning_group
, "-print");
469 my $grpid = $owning_group_id;
470 $grpid = $htmlcache_owning_group_id if $htmlcache_owning_group_id && m{^\./htmlcache(?:/|$)}i;
471 $grpid = $ctags_owning_group_id if $ctags_owning_group_id && m{^\./ctags(?:/|$)}i;
472 change_group
($proj, $_, $grpid) or $bad = 1;
474 close($fp) or $bad = 1;
476 foreach (@fixfpermsfiles) {
479 pwarn
"$proj: bypassing project, exists but not file: $_\n" unless $quiet;
480 $reallybad = $bad = 1;
483 check_fperm
($proj, $_) or $bad = 1;
486 return 0 if $reallybad;
488 $fp = openfindne
(@fixfpermsdirs, qw(-xdev -type f ! -perm), $fmodeoct, "-print");
491 check_fperm
($proj, $_) or $bad = 1;
493 close($fp) or $bad = 1;
494 $fp = openfind
(qw(. -xdev -type f ! -perm -a+r -print));
497 check_fpermr
($proj, $_) or $bad = 1;
499 close($fp) or $bad = 1;
500 $fp = openfind
(qw(. -xdev -type d ( -path ./hooks -o -path ./mob/hooks ) -prune
-o
-type f
( -perm
-u
=x
-o
-perm
-g
=x
-o
-perm
-o
=x
) -print));
503 check_fpermnox
($proj, $_) or $bad = 1;
505 close($fp) or $bad = 1;
507 my $bu = defval
($config->{'gitweb.baseurl'},"");
509 $bu eq "" or pmsg
($proj, "WARNING: .nofetch exists but gitweb.baseurl is not empty ($bu)") unless $quiet;
512 if (has_default_fetch_spec
($config)) {
513 pmsg
($proj, "WARNING: gitweb.baseurl is empty and .nofetch does not exist but fetch spec does") unless $quiet;
515 pmsg
($proj, "WARNING: gitweb.baseurl is empty and .nofetch does not exist") unless $quiet;
517 } elsif (is_native_git_mirror_url
($bu) && !has_default_fetch_spec
($config)) {
518 pmsg
($proj, "WARNING: gitweb.baseurl is not empty but fetch spec is") unless $quiet;
527 my ($proj, $subdir, $grpid) = @_;
530 mkdir($subdir) && -d
"$subdir" or $result = "FAILED";
531 if ($grpid && $grpid != $owning_group_id) {
532 my @info = stat($subdir);
533 if (@info < 6 || $info[2] eq "" || $info[4] eq "" || $info[5] eq "") {
535 } elsif ($info[5] != $grpid) {
536 if (!chown($info[4], $grpid, $subdir)) {
538 pwarn
"chgrp: ($proj) $subdir: $!\n" unless $quiet;
539 } elsif (!chmod($info[2] & 07777, $subdir)) {
541 pwarn
"chmod: ($proj) $subdir: $!\n" unless $quiet;
546 $result = "(dryrun)";
548 pmsg
($proj, "$subdir/: created", $result) unless $quiet;
549 return $result ne "FAILED";
553 my ($proj, $subdir) = @_;
554 my $oldmode = (stat($subdir))[2];
555 if (!defined($oldmode) || $oldmode eq "") {
556 pwarn
"chmod: ($proj) $subdir: No such file or directory\n" unless $quiet;
559 my $newmode = ($oldmode & ~07777) | $dmode;
560 $newmode == $oldmode and return 1;
563 if (!chmod($newmode & 07777, $subdir)) {
565 pwarn
"chmod: ($proj) $subdir: $!\n" unless $quiet;
568 $result = "(dryrun)";
570 pmsg
($proj, "$subdir/:", get_mode_perm
($oldmode), '->', get_mode_perm
($newmode), $result) unless $quiet;
571 return $result ne "FAILED";
574 sub change_dpermrwx
{
575 my ($proj, $subdir) = @_;
576 my $oldmode = (stat($subdir))[2];
577 if (!defined($oldmode) || $oldmode eq "") {
578 pwarn
"chmod: ($proj) $subdir: No such file or directory\n" unless $quiet;
581 my $newmode = $oldmode | ($wall ?
0777 : 0775);
582 $newmode == $oldmode and return 1;
585 if (!chmod($newmode & 07777, $subdir)) {
587 pwarn
"chmod: ($proj) $subdir: $!\n" unless $quiet;
590 $result = "(dryrun)";
592 pmsg
($proj, "$subdir/:", get_mode_perm
($oldmode), '->', get_mode_perm
($newmode), $result) unless $quiet;
593 return $result ne "FAILED";
597 my ($proj, $subdir) = @_;
599 my $oldmode = (stat($subdir))[2];
600 if (!defined($oldmode) || $oldmode eq "") {
601 pwarn
"chmod: ($proj) $subdir: No such file or directory\n" unless $quiet;
604 my $newmode = $oldmode | 0555;
605 $newmode == $oldmode and return 1;
608 if (!chmod($newmode & 07777, $subdir)) {
610 pwarn
"chmod: ($proj) $subdir: $!\n" unless $quiet;
613 $result = "(dryrun)";
615 pmsg
($proj, "$subdir/:", get_mode_perm
($oldmode), '->', get_mode_perm
($newmode), $result) unless $quiet;
616 return $result ne "FAILED";
620 my ($proj, $file) = @_;
621 my $oldmode = (stat($file))[2];
622 if (!defined($oldmode) || $oldmode eq "") {
623 pwarn
"chmod: ($proj) $file: No such file or directory\n" unless $quiet;
626 my $newmode = ($oldmode & ~07777) | $fmode;
627 $newmode == $oldmode and return 1;
630 if (!chmod($newmode & 07777, $file)) {
632 pwarn
"chmod: ($proj) $file: $!\n" unless $quiet;
635 $result = "(dryrun)";
637 pmsg
($proj, "$file:", get_mode_perm
($oldmode), '->', get_mode_perm
($newmode), $result) unless $quiet;
638 return $result ne "FAILED";
642 my ($proj, $file) = @_;
644 my $oldmode = (stat($file))[2];
645 if (!defined($oldmode) || $oldmode eq "") {
646 pwarn
"chmod: ($proj) $file: No such file or directory\n" unless $quiet;
649 my $newmode = $oldmode | 0444;
650 $newmode == $oldmode and return 1;
653 if (!chmod($newmode & 07777, $file)) {
655 pwarn
"chmod: ($proj) $file: $!\n" unless $quiet;
658 $result = "(dryrun)";
660 pmsg
($proj, "$file:", get_mode_perm
($oldmode), '->', get_mode_perm
($newmode), $result) unless $quiet;
661 return $result ne "FAILED";
665 my ($proj, $file) = @_;
667 my $oldmode = (stat($file))[2];
668 if (!defined($oldmode) || $oldmode eq "") {
669 pwarn
"chmod: ($proj) $file: No such file or directory\n" unless $quiet;
672 my $newmode = $oldmode & ~0111;
673 $newmode == $oldmode and return 1;
676 if (!chmod($newmode & 07777, $file)) {
678 pwarn
"chmod: ($proj) $file: $!\n" unless $quiet;
681 $result = "(dryrun)";
683 pmsg
($proj, "$file:", get_mode_perm
($oldmode), '->', get_mode_perm
($newmode), $result) unless $quiet;
684 return $result ne "FAILED";
688 my ($proj, $item, $grpid) = @_;
690 my @info = stat($item);
691 if (@info < 6 || $info[2] eq "" || $info[4] eq "" || $info[5] eq "") {
692 pwarn
"chgrp: ($proj) $item: No such file or directory\n" unless $quiet;
695 $info[5] == $grpid and return 1;
698 if (!chown($info[4], $grpid, $item)) {
700 pwarn
"chgrp: ($proj) $item: $!\n" unless $quiet;
701 } elsif (!chmod($info[2] & 07777, $item)) {
703 pwarn
"chmod: ($proj) $item: $!\n" unless $quiet;
706 $result = "(dryrun)";
708 my $isdir = ((($info[2] >> 12) & 017) == 004) ?
'/' : '';
709 pmsg
($proj, "$item$isdir: group", get_grp_nam
($info[5]), '->', get_grp_nam
($grpid), $result) unless $quiet;
710 return $result ne "FAILED";
713 my $wrote; BEGIN {$wrote = ""}
716 my $msg = join(" ", @_);
720 $prefix = $wrote . $proj . ":\n";
723 $progress->emit($prefix . " " . $msg . "\n");
760 my $str = $ftypes{($mode >> 12) & 017} .
761 $fperms{($mode >> 6) & 7} .
762 $fperms{($mode >> 3) & 7} .
764 substr($str,3,1) = ($mode & 0100) ?
's' : 'S' if $mode & 04000;
765 substr($str,6,1) = ($mode & 0010) ?
's' : 'S' if $mode & 02000;
766 substr($str,9,1) = ($mode & 0001) ?
't' : 'T' if $mode & 01000;
771 my $mode = (stat($_[0]))[2];
772 defined($mode) or return '??????????';
773 return get_mode_perm
($mode);
778 defined($grpid) or return '?';
779 my $grpnm = scalar(getgrgid($grpid));
780 return defined($grpnm) && $grpnm ne "" ?
$grpnm : $grpid;
784 my $grp = (stat($_[0]))[5];
785 defined($grp) or return '?';
786 return get_grp_nam
($grp);
793 update-all-config.pl - Update all projects' config settings
797 update-all-config.pl [<options>] [<projname>]...
800 -h | --help detailed instructions
801 -V | --version show version
802 -n | --dry-run show what would be done but don't do it
803 -f | --force run without a Config.pm owning_group
804 -q | --quiet suppress change messages
806 <projname> if given, only operate on these projects
812 =item B<-h>, B<--help>
814 Print the full description of update-all-config.pl's options.
816 =item B<-V>, B<--version>
818 Print the version of update-all-config.pl.
820 =item B<-n>, B<--dry-run>
822 Do not actually make any changes, just show what would be done without
825 =item B<-q>, B<--quiet>
827 Suppress the messages about what's actually being changed. This option
828 is ignored if B<--dry-run> is in effect.
830 The warnings about missing and unknown-to-Girocco projects are also
831 suppressed by this option.
833 =item B<-f>, B<--force>
835 Allow running without a $Girocco::Config::owning_group set. This is not
836 recommended as it results in world-writable items being used (instead of
837 just world-readable).
841 If no project names are specified then I<all> projects are processed.
843 If one or more project names are specified then only those projects are
844 processed. Specifying non-existent projects produces a warning for them,
845 but the rest of the projects specified will still be processed.
847 Each B<projname> may be either a full absolute path starting with
848 $Girocco::Config::reporoot or just the project name part with or without
851 Any explicitly specified projects that do exist but are not known to
852 Girocco will be skipped (with a warning).
858 Inspect the C<config> files of Girocco projects (i.e. $GIT_DIR/config) and
859 look for anomalies and out-of-date settings.
861 Additionally check the existence and permissions on various files and
862 directories in the project.
864 If an explicity specified project is located under $Girocco::Config::reporoot
865 but is not actually known to Girocco (i.e. it's not in the etc/group file)
866 then it will be skipped.
868 By default, any anomalies or out-of-date settings will be corrected with a
869 message to that effect. However using B<--dry-run> will only show the
870 correction(s) which would be made without making them and B<--quiet> will make
871 the correction(s) without any messages.
873 Any projects that have a C<$GIT_DIR/.noconfig> file are always skipped (with a
874 message unless B<--quiet> is used).