Last change
on this file since 1075 was 414, checked in by Herwig Bauernfeind, 15 years ago |
Samba 3.5.0: Initial import
|
File size:
1.0 KB
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 |
|
---|
3 | INSTALLPERMS=$1
|
---|
4 | DESTDIR=$2
|
---|
5 | prefix=`echo $3 | sed 's/\/\//\//g'`
|
---|
6 | LIBDIR=`echo $4 | sed 's/\/\//\//g'`
|
---|
7 | shift
|
---|
8 | shift
|
---|
9 | shift
|
---|
10 | shift
|
---|
11 |
|
---|
12 | for d in $prefix $LIBDIR; do
|
---|
13 | if [ ! -d $DESTDIR/$d ]; then
|
---|
14 | mkdir $DESTDIR/$d
|
---|
15 | if [ ! -d $DESTDIR/$d ]; then
|
---|
16 | echo Failed to make directory $DESTDIR/$d
|
---|
17 | exit 1
|
---|
18 | fi
|
---|
19 | fi
|
---|
20 | done
|
---|
21 |
|
---|
22 | # We expect the last component of LIBDIR to be the module type, eg. idmap,
|
---|
23 | # pdb. By stripping this from the installation name, you can have multiple
|
---|
24 | # modules of the same name but different types by creating eg. idmap_foo
|
---|
25 | # and pdb_foo. This makes the most sense for idmap and pdb module, where
|
---|
26 | # they need to be consistent.
|
---|
27 | mtype=`basename $LIBDIR`
|
---|
28 |
|
---|
29 | for p in $*; do
|
---|
30 | p2=`basename $p`
|
---|
31 | name=`echo $p2 | sed -es/${mtype}_//`
|
---|
32 | echo Preserving old module as $DESTDIR/$LIBDIR/$name.old
|
---|
33 | if [ -f $DESTDIR/$LIBDIR/$name ]; then
|
---|
34 | rm -f $DESTDIR/$LIBDIR/$name.old
|
---|
35 | mv $DESTDIR/$LIBDIR/$name $DESTDIR/$LIBDIR/$name.old
|
---|
36 | fi
|
---|
37 | echo Installing $p as $DESTDIR/$LIBDIR/$name
|
---|
38 | cp -f $p $DESTDIR/$LIBDIR/$name
|
---|
39 | chmod $INSTALLPERMS $DESTDIR/$LIBDIR/$name
|
---|
40 | done
|
---|
41 |
|
---|
42 | exit 0
|
---|
Note:
See
TracBrowser
for help on using the repository browser.