From: Anton Berezin Date: Tue, 12 Dec 2006 19:59:38 +0000 (+0100) Subject: t/op/groups.t: prevent failure on modern FreeBSDs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b75a55b6ed321d45dd8a2bb65f2bb2a846904d2;p=p5sagit%2Fp5-mst-13.2.git t/op/groups.t: prevent failure on modern FreeBSDs Message-ID: <20061212185938.GB49084@heechee.tobez.org> p4raw-id: //depot/perl@29546 --- diff --git a/t/op/groups.t b/t/op/groups.t index faaf7dd..f682f61 100755 --- a/t/op/groups.t +++ b/t/op/groups.t @@ -56,6 +56,8 @@ GROUPS: { if (($groups = `id -a 2>/dev/null`) ne '') { # $groups is of the form: # uid=39957(gsar) gid=22(users) groups=33536,39181,22(users),0(root),1067(dev) + # FreeBSD since 6.2 has a fake id -a: + # uid=1001(tobez) gid=20(staff) groups=20(staff), 0(wheel), 68(dialer) last GROUPS if $groups =~ /groups=/; } if (($groups = `id -Gn 2>/dev/null`) ne '') { @@ -90,7 +92,7 @@ print "# groups = $groups\n"; # That is: do not \w, do not \S. if ($groups =~ /groups=(.+)( [ug]id=|$)/) { my $gr = $1; - my @g0 = split /,/, $gr; + my @g0 = split /, ?/, $gr; my @g1; # prefer names over numbers for (@g0) {