From 2bd035374fbe2af98326553452707e2461ed7d3c Mon Sep 17 00:00:00 2001 From: hjp Date: Sun, 13 Feb 2000 18:41:05 +0000 Subject: [PATCH] Added configure --- lspath/GNUmakefile | 25 +++++++++++++++++++++++++ lspath/configure | 34 ++++++++++++++++++++++++++++++++++ lspath/lspath.pl | 14 ++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 lspath/GNUmakefile create mode 100644 lspath/configure create mode 100755 lspath/lspath.pl diff --git a/lspath/GNUmakefile b/lspath/GNUmakefile new file mode 100644 index 0000000..e6e348f --- /dev/null +++ b/lspath/GNUmakefile @@ -0,0 +1,25 @@ +include GNUmakevars + +all: lspath + +clean: + rm lspath customize + +install: $(BINDIR) $(BINDIR)/lspath + +%: %.pl customize + sh ./customize < $< > $@ + chmod +x $@ + +%: %.sh customize + sh ./customize < $< > $@ + chmod +x $@ + +customize: configure + sh ./configure + +$(BINDIR): + mkdir -p $@ + +include GNUmakerules + diff --git a/lspath/configure b/lspath/configure new file mode 100644 index 0000000..6fea68e --- /dev/null +++ b/lspath/configure @@ -0,0 +1,34 @@ +#!/bin/sh +# +echo "#!/bin/sh" > customize.$$ +echo "sed \\" > customize.$$ +chmod +x customize.$$ + +################################################################ +# find a working perl: +# +for i in /usr/bin/perl /usr/local/bin/perl /usr/bin/perl5 /usr/local/bin/perl5 +do + if $i -e 'exit ($] < 5.000)' + then + echo $i works + perl="$i" + break + fi +done +if [ -z "$perl" ] +then + could not find a working perl command, sorry. + exit 1 +fi +echo " -e 's,@@@perl@@@,$perl,g' \\" >> customize.$$ + + +################################################################ +# finish +# Add trailing newline and rename temp file to final name +# +echo >> customize.$$ + +mv customize.$$ customize + diff --git a/lspath/lspath.pl b/lspath/lspath.pl new file mode 100755 index 0000000..7b0442f --- /dev/null +++ b/lspath/lspath.pl @@ -0,0 +1,14 @@ +#!@@@perl@@@ -w +use strict; + + +for my $p (@ARGV) { + + my @p = split (/\//, $p); + for (my $i = 0; $i < scalar(@p); $i++) { + my $pp = join("/", @p[0..$i]); + $pp = "/" if $pp eq ""; + + system("/bin/ls", "-ld", $pp); + } +}