-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path:mksyshead
89 lines (82 loc) · 1.67 KB
/
:mksyshead
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ident "@(#)mk::mksyshead 1.20"
#
# Install UNIX System 'sys' header files
#
SRCDIR=${SRC:-$ROOT/usr/src}/uts
TARGDIR=$ROOT/usr/include
Chmod(){
DIRECTORY=$1
DIRS=`find $DIRECTORY -type d -print`
for MODE in $DIRS
do chmod 755 $MODE
done
FILES=`find $DIRECTORY -type f -print`
for MODE in $FILES
do chmod 664 $MODE
done
# If native build then set owner and group
if [ "$ROOT" = "" ]
then
for OWN_GRP in $FILES $DIRS
do chown bin $OWN_GRP
chgrp bin $OWN_GRP
done
fi
}
if vax
then
MACH=vax
elif pdp11
then
MACH=pdp11
elif u3b
then
MACH=3b
elif u3b2
then
MACH=3b2
elif u3b15
then
MACH=3b15
fi
#
for DIR in sys $MACH/sys \
$MACH/vm \
$MACH/net \
$MACH/netinet \
$MACH/nfs \
$MACH/rpc \
$MACH/fs
do
TARGETBASE=`basename $DIR`
if [ -d $SRCDIR/$DIR ]
then
# Only remove headers from the specific target directory once!
eval "
case $TARGETBASE in
${PATTERN:-"NULL_PATTERN"})
# Already found, do not remove the target dir!
;;
*)
# First time found. Add base directory to the
# PATTERN variable so that it can be skipped
# if found again.
PATTERN=${PATTERN:+\"${PATTERN}|\"}${TARGETBASE}
if [ -d $TARGDIR/${TARGETBASE} ]
then
rm -fr $TARGDIR/${TARGETBASE}/[a-m]*
rm -fr $TARGDIR/${TARGETBASE}/*
else
mkdir $TARGDIR/$TARGETBASE
fi
;;
esac
"
cd $SRCDIR/$DIR
echo "Installing the following files from $SRCDIR/$DIR:";
find ./ -type f -name "*.h" -print | cpio -pduv $TARGDIR/$TARGETBASE
# Set file and directory permissions
Chmod $TARGDIR/$TARGETBASE
fi
done
exit 0