01 #!/usr/local/bin/perl -w
02 use strict;
03 use Log::Log4perl qw(:easy);
04 use File::Basename;
05 use Sysadm::Install qw(mkd);
06 
07 Log::Log4perl->easy_init($DEBUG);
08 
09 my ($home)   = glob "~";
10 my $home_bin = "$home/bin";
11 
12 while (<DATA>) {
13  chomp;
14 
15  my ($linkbase, $src) = split ' ', $_;
16 
17  $src        = "$home/$src";
18  my $binpath = "$home_bin/$linkbase";
19 
20  if (-l $binpath) {
21   DEBUG "$binpath already exists";
22   next;
23  } elsif (-e $binpath) {
24   ERROR "$binpath already exists, ",
25     "but not a link!";
26   next;
27  }
28 
29  INFO "Linking $binpath -> $src";
30 
31  symlink $src, $binpath
32    or LOGDIE
33    "Cannot link $binpath->$src ($!)";
34 }
35 
36 __DATA__
37 logtemp git/articles/temper/eg/logtemp
38 cvs2git git/sandbox/cvs2git/cvs2git