summaryrefslogtreecommitdiff
path: root/source3/script/installmsg.sh
diff options
context:
space:
mode:
authorLars Müller <lmuelle@samba.org>2006-02-24 00:30:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:10:21 -0500
commit9169edfeb4ea4358dbaf948372847542fb57464e (patch)
tree8d7e90e42d7bb6ec37a12f8c9885038720bf4025 /source3/script/installmsg.sh
parente18349b2bb6f4df9c6d08a3d62cfbf012f7f3660 (diff)
downloadsamba-9169edfeb4ea4358dbaf948372847542fb57464e.tar.gz
samba-9169edfeb4ea4358dbaf948372847542fb57464e.tar.bz2
samba-9169edfeb4ea4358dbaf948372847542fb57464e.zip
r13663: make uninstall DESTDIR=/somewhere no longer leaves files. This is done
with the new rules: uninstallservers uninstalldat, uninstallswat (calles uninstallmsg), uninstallmodules, uninstallclientlib, and uninstalllibmsrpc. We still leave directories. We might try to remove the dirs we created in reverse order. The new uninstall scripts are sym links to the respective install scripts. Inside we set mode to install or uninstall. installservers is now used to install the servers. These are no longer installed with installbin. (This used to be commit 43549301b937c060742840054017b31bf3781e04)
Diffstat (limited to 'source3/script/installmsg.sh')
-rw-r--r--source3/script/installmsg.sh64
1 files changed, 53 insertions, 11 deletions
diff --git a/source3/script/installmsg.sh b/source3/script/installmsg.sh
index 5a41fe1ca8..3bfa3ee772 100644
--- a/source3/script/installmsg.sh
+++ b/source3/script/installmsg.sh
@@ -2,22 +2,64 @@
# first version (Sept 2003) written by Shiro Yamada <shiro@miraclelinux.com>
# based on the first verion (March 2002) of installdat.sh written by Herb Lewis
-MSGDIR=`echo $1 | sed 's/\/\//\//g'`
-SRCDIR=$2/
+DESTDIR=$1
+MSGDIR=`echo $2 | sed 's/\/\//\//g'`
+SRCDIR=$3/
+shift
+shift
+shift
-echo Installing msg files in $MSGDIR
+case $0 in
+ *uninstall*)
+ if test ! -d "$DESTDIR/$MSGDIR"; then
+ echo "Directory $DESTDIR/$MSGDIR does not exist! "
+ echo "Do a "make installmsg" or "make install" first. "
+ exit 1
+ fi
+ mode='uninstall'
+ ;;
+ *) mode='install' ;;
+esac
-for f in $SRCDIR/po/*.msg; do
- FNAME=$MSGDIR/`basename $f`
- echo $FNAME
- cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges?
- chmod 0644 $FNAME
+for f in $@; do
+ FNAME="$DESTDIR/$MSGDIR/$f.msg"
+ if test "$mode" = 'install'; then
+ echo "Installing $f.msg as $FNAME "
+ cp "$SRCDIR/po/$f.msg" "$FNAME"
+ if test ! -e "$FNAME"; then
+ echo "Cannot install $FNAME. Does $USER have privileges? "
+ exit 1
+ fi
+ chmod 0644 $FNAME
+ elif test "$mode" = 'uninstall'; then
+ echo "Removing $FNAME "
+ rm -f "$FNAME"
+ if test -e "$FNAME"; then
+ echo "Cannot remove $FNAME. Does $USER have privileges? "
+ exit 1
+ fi
+ else
+ echo "Unknown mode, $mode. Script called as $0 "
+ exit 1
+ fi
done
-cat << EOF
-======================================================================
-The msg files have been installed.
+if test "$mode" = 'install'; then
+ cat << EOF
+==============================================================================
+The SWAT msg files have been installed. You may uninstall the msg files using
+the command "make uninstallmsg" or "make uninstall" to uninstall binaries, man
+pages, msg files, and shell scripts.
+==============================================================================
+EOF
+else
+ cat << EOF
+=============================================================================
+The SWAT msg files have been removed. You may restore these files using the
+command "make installmsg" or "make install" to install binaries, man pages,
+modules, msg files, and shell scripts.
======================================================================
EOF
+fi
exit 0