From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Kg58o-0002L9-MQ for garchives@archives.gentoo.org; Wed, 17 Sep 2008 22:04:54 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BB5A0E0574; Wed, 17 Sep 2008 22:04:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 98948E0574 for ; Wed, 17 Sep 2008 22:04:54 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 87505B4CB0 for ; Wed, 17 Sep 2008 22:04:53 +0000 (UTC) Received: from robbat2 by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1Kg58m-0003ic-B8 for gentoo-commits@lists.gentoo.org; Wed, 17 Sep 2008 22:04:52 +0000 From: "Robin H. Johnson (robbat2)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, robbat2@gentoo.org Subject: [gentoo-commits] CVSROOT commit in /: checkgroup.pl X-VCS-Repository: CVSROOT X-VCS-Files: checkgroup.pl X-VCS-Directories: / X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson Content-Type: text/plain; charset=utf8 Message-Id: Sender: "Robin H. Johnson" Date: Wed, 17 Sep 2008 22:04:52 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 76c4dcf7-c950-4d70-8e5d-2d8fa5ae3622 X-Archives-Hash: 1c75485a1f363461b4d28024deaca038 robbat2 08/09/17 22:04:52 Modified: checkgroup.pl Log: Add Debug support. Revision Changes Path 1.5 checkgroup.pl file : http://sources.gentoo.org/viewcvs.py/CVSROOT/checkgroup.pl?rev=3D1= .5&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/CVSROOT/checkgroup.pl?rev=3D1= .5&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewcvs.py/CVSROOT/checkgroup.pl?r1=3D1.= 4&r2=3D1.5 Index: checkgroup.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/CVSROOT/checkgroup.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -p -w -b -B -u -u -r1.4 -r1.5 --- checkgroup.pl 17 Sep 2008 22:00:20 -0000 1.4 +++ checkgroup.pl 17 Sep 2008 22:04:51 -0000 1.5 @@ -8,27 +8,28 @@ my $cvsroot =3D shift @ARGV; my $repo =3D shift @ARGV; my $path =3D shift @ARGV; my $user =3D $ENV{USER}; +my $DEBUG =3D (exists $ENV{DEBUG}); =20 my $ret =3D 0; =20 foreach(@ARGV) { my $localfilepath =3D File::Spec->catfile($repo, $path, $_); my $filepath =3D File::Spec->catfile($cvsroot, $localfilepath); - #print STDERR $filepath."\n"; + print STDERR $filepath."\n" if $DEBUG; #-f $filepath or die "$filepath does not exist."; -f $filepath or next; my $sb =3D stat($filepath); my ($groupname,$grouppasswd,$groupgid,$groupmembers) =3D getgrgid($sb->= gid); my @groupmembers =3D split /,/,$groupmembers; - #print 'groupmembers ('.join(',', @groupmembers).")\n"; + print 'groupmembers ('.join(',', @groupmembers).")\n" if $DEBUG; my @valid =3D grep /^$user$/, @groupmembers; - #print '@valid ('.join(',', @valid).")\n"; + print '@valid ('.join(',', @valid).")\n" if $DEBUG; my $valid =3D (scalar @valid) > 0; - #print 'array ('.join(',', @valid).") $valid\n"; + print 'array ('.join(',', @valid).") $valid\n" if $DEBUG; if($valid) { $valid =3D $valid[0] eq $user; } - #printf "File is %s, size is %s, perm %04o, mtime %s, group %s, valid f= or $user %d\n", - # $filepath, $sb->size, $sb->mode & 07777, - # scalar localtime $sb->mtime, $groupname, $valid; + printf "File is %s, size is %s, perm %04o, mtime %s, group %s, valid fo= r $user %d\n", + $filepath, $sb->size, $sb->mode & 07777, + scalar localtime $sb->mtime, $groupname, $valid if $DEBUG; if(!$valid) { printf STDERR "You do not have permissions to commit to %s\n", $localf= ilepath; $ret =3D 1;