This routine was "use"ing File::Basename. This commit removes that

"use" and replaces it with equivalent inline code. The reason is that
Perl has some very nasty circular dependancies, and I am trying to
get the System Perl upgraded by one maintenance level.

The basic rule, until I can find a way to solve this, is that
the build tools MAY NOT use any library code; it must all be inline.
This commit is contained in:
Mark Murray 1999-05-02 08:55:27 +00:00
parent 3de29bbf70
commit a8af2bd86b
1 changed files with 30 additions and 2 deletions

View File

@ -34,6 +34,8 @@
# From @(#)vnode_if.sh 8.1 (Berkeley) 6/10/93
# From @(#)makedevops.sh 1.1 1998/06/14 13:53:12 dfr Exp $
# From @(#)makedevops.sh ?.? 1998/10/05
#
# $Id$
#
# Script to produce device front-end sugar.
@ -47,8 +49,6 @@ $keepcurrentdir = 1;
$line_width = 80;
use File::Basename;
# Process the command line
#
while ( $arg = shift @ARGV ) {
@ -395,3 +395,31 @@ sub format_line {
return $rline . $line;
}
# This routine is a crude replacement for one in File::Basename. We
# cannot use any library code because it fouls up the Perl bootstrap
# when we update a perl version. MarkM
sub fileparse {
my ($filename, @suffix) = @_;
my ($dir, $name, $type, $i);
$type = '';
foreach $i (@suffix) {
if ($filename =~ m|$i$|) {
$filename =~ s|$i$||;
$type = $i;
}
}
if ($filename =~ m|/|) {
$filename =~ m|([^/]*)$|;
$name = $1;
$dir = $filename;
$dir =~ s|$name$||;
}
else {
$dir = '';
$name = $filename;
}
($name, $dir, $type);
}