Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "Implement $*USER and $*GROUP (not yet specced)"
There is something wrong with my understanding of how either Proxy.new works,
or matching, or whatever, but if your user name / group contains non \w
characters, you will get 4 warnings everytime you start up.  And I don't have
time to look at why exactly now.
  • Loading branch information
lizmat committed Jun 2, 2014
1 parent 57555c8 commit f146fec
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions src/core/Process.pm
Expand Up @@ -22,42 +22,6 @@
PROCESS::<$PROGRAM_NAME> = $PROGRAM_NAME;

PROCESS::<$TMPDIR> = IO::Spec.tmpdir().path;

class IdName {
has Int $.id;
has Str $.name;

method Numeric { $!id }
method Str { $!name }
method gist { "$!name ($!id)" }
}

# probably needs some nqp::op, LHF for someone?
my $on_demand_fetch = Proxy.new(
FETCH => {
if try qx/id/ -> $id {
$id ~~ m/^
[ uid "=" $<uid>=(\d+) ]
[ "(" $<user>=(\w+) ")" ]
\s+
[ gid "=" $<gid>=(\d+) ]
[ "(" $<group>=(\w+) ")" ]
/;

PROCESS::<$USER> := IdName.new( :id(+$<uid>), :name(~$<user>) );
PROCESS::<$GROUP> := IdName.new( :id(+$<gid>), :name(~$<group>) );
}

# alas, no support yet
else {
PROCESS::<$USER> := Nil;
PROCESS::<$GROUP> := Nil;
}
}
);

PROCESS::<$USER> //= $on_demand_fetch;
PROCESS::<$GROUP> //= $on_demand_fetch;
}

# vim: ft=perl6 expandtab sw=4

0 comments on commit f146fec

Please sign in to comment.