summaryrefslogtreecommitdiffstats
path: root/sys/kern/makedevops.pl
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>1999-05-02 08:55:27 +0000
committermarkm <markm@FreeBSD.org>1999-05-02 08:55:27 +0000
commitc853b12c9a66380ea28e4fe00f811906e8326687 (patch)
tree583545cd666c82346f6fa526e2c6a908a9fcb82c /sys/kern/makedevops.pl
parent743ae62c5f40942f2e50252336689bb87419f59a (diff)
downloadFreeBSD-src-c853b12c9a66380ea28e4fe00f811906e8326687.zip
FreeBSD-src-c853b12c9a66380ea28e4fe00f811906e8326687.tar.gz
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.
Diffstat (limited to 'sys/kern/makedevops.pl')
-rw-r--r--sys/kern/makedevops.pl32
1 files changed, 30 insertions, 2 deletions
diff --git a/sys/kern/makedevops.pl b/sys/kern/makedevops.pl
index ce428e5..8b991b7 100644
--- a/sys/kern/makedevops.pl
+++ b/sys/kern/makedevops.pl
@@ -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);
+}
OpenPOWER on IntegriCloud