diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-11-06 19:26:42 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-11-06 19:26:42 +0000 |
commit | d44fef1e11e3d5a6327fd29062b694b267d20adb (patch) | |
tree | 6efc5906db4e0b6288a9df39af1b0636fdc76aa2 /lib/sbin/checkout.pl | |
parent | 97f79ba48f1a669d259038756577571de1d02605 (diff) |
Get home directory from environment variable rather than password file
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1143 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/checkout.pl')
-rw-r--r-- | lib/sbin/checkout.pl | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/sbin/checkout.pl b/lib/sbin/checkout.pl index 2e6af592..d08be118 100644 --- a/lib/sbin/checkout.pl +++ b/lib/sbin/checkout.pl @@ -365,7 +365,8 @@ sub CheckOut sub choose_repository { my($login) = @_; - my($repository,$dowhat); + my $repository,$dowhat; + my $home; open(IN,"<CVS/Root") || die "No file CVS/Root"; $rep[1] = <IN>; @@ -374,12 +375,15 @@ sub choose_repository $rep[2] = "Custom repository"; # Get home directory from password file - @dirs = getpwuid($<); - $file = "@dirs[7]/.cvspass"; - - if (open(CVSPASS,"<$file")) + $home = $ENV{"HOME"}; + if ($home =~ /^$/) + { + print " Set \$HOME environment variable to home directory\n"; + die; + } + if (open(CVSPASS,"<$home/.cvspass")) { - $numinpass=2; + $numinpass = 2; while (<CVSPASS>) { $numinpass++; @@ -387,7 +391,7 @@ sub choose_repository $rep[$numinpass] = $1; } } - else + else { print "Could not find $file/.cvspass containing CVS logins\n"; print "Perhaps you need to login on this machine? Type \"help\"\n"; |