summaryrefslogtreecommitdiff
path: root/source4/script/installmisc.sh
diff options
context:
space:
mode:
authorNadezhda Ivanova <nadezhda.ivanova@postpath.com>2010-01-04 11:24:10 +0200
committerNadezhda Ivanova <nadezhda.ivanova@postpath.com>2010-01-04 11:24:10 +0200
commitfb5383c69ee52fb5e6d066a43451dc8c806cc795 (patch)
tree45b72e03f68ab6d212755c524f8e8a60a3b4373a /source4/script/installmisc.sh
parent60d8ab3b7b0bd2c9b633f0380d1fdf5bcf5e2621 (diff)
parenta06e5cdb99ddf7abf16486d3837105ec4e0da9ee (diff)
downloadsamba-fb5383c69ee52fb5e6d066a43451dc8c806cc795.tar.gz
samba-fb5383c69ee52fb5e6d066a43451dc8c806cc795.tar.bz2
samba-fb5383c69ee52fb5e6d066a43451dc8c806cc795.zip
Merge branch 'master' of git://git.samba.org/samba
Diffstat (limited to 'source4/script/installmisc.sh')
-rwxr-xr-xsource4/script/installmisc.sh42
1 files changed, 28 insertions, 14 deletions
diff --git a/source4/script/installmisc.sh b/source4/script/installmisc.sh
index cb618628b0..15fc64544c 100755
--- a/source4/script/installmisc.sh
+++ b/source4/script/installmisc.sh
@@ -1,28 +1,42 @@
#!/bin/sh
# install miscellaneous files
-[ $# -eq 5 ] || {
- echo "Usage: installmisc.sh SRCDIR SETUPDIR BINDDIR SBINDDIR PYTHONDIR"
+[ $# -eq 7 ] || {
+ echo "Usage: installmisc.sh DESTDIR SRCDIR SETUPDIR BINDDIR SBINDDIR PYTHONDIR PYTHON"
exit 1
}
-SRCDIR="$1"
-SETUPDIR="$2"
-BINDIR="$3"
-SBINDIR="$4"
-PYTHONDIR="$5"
+DESTDIR="$1"
+SRCDIR="$2"
+SETUPDIR="$3"
+BINDIR="$4"
+SBINDIR="$5"
+PYTHONDIR="$6"
+PYTHON="$7"
cd $SRCDIR || exit 1
+if $PYTHON -c "import sys; sys.exit('$PYTHONDIR' in sys.path)"; then
+ PYTHON_PATH_NEEDS_FIXING=yes
+ echo "sys.path in python scripts will be updated to include $PYTHONDIR"
+else
+ PYTHON_PATH_NEEDS_FIXING=no
+fi
+
# fixup a python script to use the right path
fix_python_path() {
f="$1"
- egrep 'sys.path.insert.*bin/python' $f > /dev/null && {
- # old systems don't have sed -i :-(
- sed "s|\(sys.path.insert.*\)bin/python\(.*\)$|\1$PYTHONDIR\2|g" < $f > $f.$$ || exit 1
- mv -f $f.$$ $f || exit 1
- chmod +x $f
- }
+ if egrep 'sys.path.insert.*bin/python' $f > /dev/null; then
+ if [ "$PYTHON_PATH_NEEDS_FIXING" = "yes" ]; then
+ # old systems don't have sed -i :-(
+ sed "s|\(sys.path.insert.*\)bin/python\(.*\)$|\1$PYTHONDIR\2|g" < $f > $f.$$ || exit 1
+ else
+ # old systems don't have sed -i :-(
+ sed "s|\(sys.path.insert.*\)bin/python\(.*\)$||g" < $f > $f.$$ || exit 1
+ fi
+ mv -f $f.$$ $f || exit 1
+ chmod +x $f
+ fi
}
echo "Installing setup templates"
@@ -35,7 +49,7 @@ cp setup/ad-schema/*.txt $SETUPDIR/ad-schema || exit 1
cp setup/display-specifiers/*.txt $SETUPDIR/display-specifiers || exit 1
echo "Installing sbin scripts from setup/*"
-for p in domainlevel enableaccount newuser provision setexpiry setpassword pwsettings
+for p in provision
do
cp setup/$p $SBINDIR || exit 1
chmod a+x $SBINDIR/$p