samba-cvs.cvs
[Top] [All Lists]

svn commit: samba r13642 - branches/SAMBA_3_0/source branches/SAMBA_3_0/

Subject: svn commit: samba r13642 - branches/SAMBA_3_0/source branches/SAMBA_3_0/source/script trunk/source trunk/source/script
From:
Date: Wed, 22 Feb 2006 21:41:15 +0000 GMT
Author: lmuelle
Date: 2006-02-22 21:41:14 +0000 (Wed, 22 Feb 2006)
New Revision: 13642

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13642

Log:
Fix install* scripts to use DESTDIR.

Always pass the INSTALLPERMS and DESTDIR as first and second arg to the
scripts.

No longer prepend DESTDIR to the remaining args.

To fix bug #3282 it is important _not_ to prepend DESTDIR to the source
of the sym link pointing to smbmount.

Modified:
   branches/SAMBA_3_0/source/Makefile.in
   branches/SAMBA_3_0/source/script/installbin.sh
   branches/SAMBA_3_0/source/script/installdirs.sh
   branches/SAMBA_3_0/source/script/installmodules.sh
   trunk/source/Makefile.in
   trunk/source/script/installbin.sh
   trunk/source/script/installdirs.sh
   trunk/source/script/installmodules.sh


Changeset:
Modified: branches/SAMBA_3_0/source/Makefile.in
===================================================================
--- branches/SAMBA_3_0/source/Makefile.in       2006-02-22 21:18:23 UTC (rev 
13641)
+++ branches/SAMBA_3_0/source/Makefile.in       2006-02-22 21:41:14 UTC (rev 
13642)
@@ -1382,25 +1382,25 @@
 # is not used
 
 installdirs:
-       @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) 
$(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) 
$(DESTDIR)$(VARDIR) $(DESTDIR)$(PRIVATEDIR) $(DESTDIR)$(PIDDIR) 
$(DESTDIR)$(LOCKDIR) $(DESTDIR)$(MANDIR)
+       @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(BINDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(PRIVATEDIR) $(PIDDIR) 
$(LOCKDIR) $(MANDIR)
 
 installservers: all installdirs
-       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) 
$(DESTDIR)$(VARDIR) $(SBIN_PROGS)
+       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(SBIN_PROGS)
 
 installbin: all installdirs
-       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) 
$(DESTDIR)$(VARDIR) $(SBIN_PROGS)
-       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) 
$(DESTDIR)$(VARDIR) $(BIN_PROGS)
+       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(SBIN_PROGS)
+       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(BINDIR) $(LIBDIR) $(VARDIR) $(BIN_PROGS)
 
 
 # Some symlinks are required for the 'probing' of modules. 
 # This mechanism should go at some point..
 installmodules: modules installdirs
-       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(VFSLIBDIR) $(VFS_MODULES)
-       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(PDBLIBDIR) $(PDB_MODULES)
-       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(RPCLIBDIR) $(RPC_MODULES)
-       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(IDMAPLIBDIR) $(IDMAP_MODULES)
-       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSETLIBDIR) $(CHARSET_MODULES)
-       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(AUTHLIBDIR) $(AUTH_MODULES)
+       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(VFSLIBDIR) $(VFS_MODULES)
+       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(PDBLIBDIR) $(PDB_MODULES)
+       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(RPCLIBDIR) $(RPC_MODULES)
+       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(IDMAPLIBDIR) $(IDMAP_MODULES)
+       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(CHARSETLIBDIR) $(CHARSET_MODULES)
+       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(AUTHLIBDIR) $(AUTH_MODULES)
        @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(PDBLIBDIR) 
ldapsam.@SHLIBEXT@ ldapsam_compat.@SHLIBEXT@
        @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) 
rhosts.@SHLIBEXT@ hostsequiv.@SHLIBEXT@
        @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) 
sam.@SHLIBEXT@ sam_ignoredomain.@SHLIBEXT@

Modified: branches/SAMBA_3_0/source/script/installbin.sh
===================================================================
--- branches/SAMBA_3_0/source/script/installbin.sh      2006-02-22 21:18:23 UTC 
(rev 13641)
+++ branches/SAMBA_3_0/source/script/installbin.sh      2006-02-22 21:41:14 UTC 
(rev 13642)
@@ -15,13 +15,13 @@
 
 for p in $*; do
  p2=`basename $p`
- echo Installing $p as $BINDIR/$p2
- if [ -f $BINDIR/$p2 ]; then
-   rm -f $BINDIR/$p2.old
-   mv $BINDIR/$p2 $BINDIR/$p2.old
+ echo Installing $p as $DESTDIR/$BINDIR/$p2
+ if [ -f $DESTDIR/$BINDIR/$p2 ]; then
+   rm -f $DESTDIR/$BINDIR/$p2.old
+   mv $DESTDIR/$BINDIR/$p2 $DESTDIR/$BINDIR/$p2.old
  fi
- cp $p $BINDIR/
- chmod $INSTALLPERMS $BINDIR/$p2
+ cp $p $DESTDIR/$BINDIR/
+ chmod $INSTALLPERMS $DESTDIR/$BINDIR/$p2
 
  # this is a special case, mount needs this in a specific location
  if [ $p2 = smbmount ]; then

Modified: branches/SAMBA_3_0/source/script/installdirs.sh
===================================================================
--- branches/SAMBA_3_0/source/script/installdirs.sh     2006-02-22 21:18:23 UTC 
(rev 13641)
+++ branches/SAMBA_3_0/source/script/installdirs.sh     2006-02-22 21:41:14 UTC 
(rev 13642)
@@ -1,14 +1,18 @@
 #!/bin/sh
 
-while ( test -n "$1" ); do
+INSTALLPERMS=$1
+DESTDIR=`echo $2 | sed 's/\/\//\//g'`
+shift
+shift
 
-       DIRNAME=`echo $1 | sed 's/\/\//\//g'`
-       if [ ! -d $DIRNAME ]; then
-               mkdir -p $DIRNAME
+for dir in $@; do
+       DIRNAME=`echo $dir | sed 's/\/\//\//g'`
+       if [ ! -d $DESTDIR/$DIRNAME ]; then
+               mkdir -m $INSTALLPERMS -p $DESTDIR/$DIRNAME
        fi
 
-       if [ ! -d $DIRNAME ]; then
-               echo Failed to make directory $1
+       if [ ! -d $DESTDIR/$DIRNAME ]; then
+               echo "Failed to make directory $DESTDIR/$DIRNAME "
                exit 1
        fi
 

Modified: branches/SAMBA_3_0/source/script/installmodules.sh
===================================================================
--- branches/SAMBA_3_0/source/script/installmodules.sh  2006-02-22 21:18:23 UTC 
(rev 13641)
+++ branches/SAMBA_3_0/source/script/installmodules.sh  2006-02-22 21:41:14 UTC 
(rev 13642)
@@ -1,17 +1,19 @@
 #!/bin/sh
 
 INSTALLPERMS=$1
-BASEDIR=`echo $2 | sed 's/\/\//\//g'`
-LIBDIR=`echo $3 | sed 's/\/\//\//g'`
+DESTDIR=`echo $2 | sed 's/\/\//\//g'`
+BASEDIR=`echo $3 | sed 's/\/\//\//g'`
+LIBDIR=`echo $4 | sed 's/\/\//\//g'`
 shift
 shift
 shift
+shift
 
 for d in $BASEDIR $LIBDIR; do
-if [ ! -d $d ]; then
-mkdir $d
-if [ ! -d $d ]; then
-  echo Failed to make directory $d
+if [ ! -d $DESTDIR/$d ]; then
+mkdir $DESTDIR/$d
+if [ ! -d $DESTDIR/$d ]; then
+  echo Failed to make directory $DESTDIR/$d
   exit 1
 fi
 fi
@@ -19,9 +21,9 @@
 
 for p in $*; do
  p2=`basename $p`
- echo Installing $p as $LIBDIR/$p2
- cp -f $p $LIBDIR/
- chmod $INSTALLPERMS $LIBDIR/$p2
+ echo Installing $p as $DESTDIR/$LIBDIR/$p2
+ cp -f $p $DESTDIR/$LIBDIR/
+ chmod $INSTALLPERMS $DESTDIR/$LIBDIR/$p2
 done
 
 exit 0

Modified: trunk/source/Makefile.in
===================================================================
--- trunk/source/Makefile.in    2006-02-22 21:18:23 UTC (rev 13641)
+++ trunk/source/Makefile.in    2006-02-22 21:41:14 UTC (rev 13642)
@@ -1411,25 +1411,25 @@
 # is not used
 
 installdirs:
-       @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) 
$(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) 
$(DESTDIR)$(VARDIR) $(DESTDIR)$(PRIVATEDIR) $(DESTDIR)$(PIDDIR) 
$(DESTDIR)$(LOCKDIR) $(DESTDIR)$(MANDIR)
+       @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(BINDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(PRIVATEDIR) $(PIDDIR) 
$(LOCKDIR) $(MANDIR)
 
 installservers: all installdirs
-       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) 
$(DESTDIR)$(VARDIR) $(SBIN_PROGS)
+       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(SBIN_PROGS)
 
 installbin: all installdirs
-       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) 
$(DESTDIR)$(VARDIR) $(SBIN_PROGS)
-       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) 
$(DESTDIR)$(VARDIR) $(BIN_PROGS)
+       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(SBIN_PROGS)
+       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(BINDIR) $(LIBDIR) $(VARDIR) $(BIN_PROGS)
 
 
 # Some symlinks are required for the 'probing' of modules. 
 # This mechanism should go at some point..
 installmodules: modules installdirs
-       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(VFSLIBDIR) $(VFS_MODULES)
-       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(PDBLIBDIR) $(PDB_MODULES)
-       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(RPCLIBDIR) $(RPC_MODULES)
-       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(IDMAPLIBDIR) $(IDMAP_MODULES)
-       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSETLIBDIR) $(CHARSET_MODULES)
-       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) 
$(DESTDIR)$(BASEDIR) $(DESTDIR)$(AUTHLIBDIR) $(AUTH_MODULES)
+       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(VFSLIBDIR) $(VFS_MODULES)
+       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(PDBLIBDIR) $(PDB_MODULES)
+       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(RPCLIBDIR) $(RPC_MODULES)
+       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(IDMAPLIBDIR) $(IDMAP_MODULES)
+       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(CHARSETLIBDIR) $(CHARSET_MODULES)
+       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR) 
$(BASEDIR) $(AUTHLIBDIR) $(AUTH_MODULES)
        @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(PDBLIBDIR) 
ldapsam.@SHLIBEXT@ ldapsam_compat.@SHLIBEXT@
        @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) 
rhosts.@SHLIBEXT@ hostsequiv.@SHLIBEXT@
        @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) 
sam.@SHLIBEXT@ sam_ignoredomain.@SHLIBEXT@

Modified: trunk/source/script/installbin.sh
===================================================================
--- trunk/source/script/installbin.sh   2006-02-22 21:18:23 UTC (rev 13641)
+++ trunk/source/script/installbin.sh   2006-02-22 21:41:14 UTC (rev 13642)
@@ -15,13 +15,13 @@
 
 for p in $*; do
  p2=`basename $p`
- echo Installing $p as $BINDIR/$p2
- if [ -f $BINDIR/$p2 ]; then
-   rm -f $BINDIR/$p2.old
-   mv $BINDIR/$p2 $BINDIR/$p2.old
+ echo Installing $p as $DESTDIR/$BINDIR/$p2
+ if [ -f $DESTDIR/$BINDIR/$p2 ]; then
+   rm -f $DESTDIR/$BINDIR/$p2.old
+   mv $DESTDIR/$BINDIR/$p2 $DESTDIR/$BINDIR/$p2.old
  fi
- cp $p $BINDIR/
- chmod $INSTALLPERMS $BINDIR/$p2
+ cp $p $DESTDIR/$BINDIR/
+ chmod $INSTALLPERMS $DESTDIR/$BINDIR/$p2
 
  # this is a special case, mount needs this in a specific location
  if [ $p2 = smbmount ]; then

Modified: trunk/source/script/installdirs.sh
===================================================================
--- trunk/source/script/installdirs.sh  2006-02-22 21:18:23 UTC (rev 13641)
+++ trunk/source/script/installdirs.sh  2006-02-22 21:41:14 UTC (rev 13642)
@@ -1,14 +1,18 @@
 #!/bin/sh
 
-while ( test -n "$1" ); do
+INSTALLPERMS=$1
+DESTDIR=`echo $2 | sed 's/\/\//\//g'`
+shift
+shift
 
-       DIRNAME=`echo $1 | sed 's/\/\//\//g'`
-       if [ ! -d $DIRNAME ]; then
-               mkdir -p $DIRNAME
+for dir in $@; do
+       DIRNAME=`echo $dir | sed 's/\/\//\//g'`
+       if [ ! -d $DESTDIR/$DIRNAME ]; then
+               mkdir -m $INSTALLPERMS -p $DESTDIR/$DIRNAME
        fi
 
-       if [ ! -d $DIRNAME ]; then
-               echo Failed to make directory $1
+       if [ ! -d $DESTDIR/$DIRNAME ]; then
+               echo "Failed to make directory $DESTDIR/$DIRNAME "
                exit 1
        fi
 

Modified: trunk/source/script/installmodules.sh
===================================================================
--- trunk/source/script/installmodules.sh       2006-02-22 21:18:23 UTC (rev 
13641)
+++ trunk/source/script/installmodules.sh       2006-02-22 21:41:14 UTC (rev 
13642)
@@ -1,17 +1,19 @@
 #!/bin/sh
 
 INSTALLPERMS=$1
-BASEDIR=`echo $2 | sed 's/\/\//\//g'`
-LIBDIR=`echo $3 | sed 's/\/\//\//g'`
+DESTDIR=`echo $2 | sed 's/\/\//\//g'`
+BASEDIR=`echo $3 | sed 's/\/\//\//g'`
+LIBDIR=`echo $4 | sed 's/\/\//\//g'`
 shift
 shift
 shift
+shift
 
 for d in $BASEDIR $LIBDIR; do
-if [ ! -d $d ]; then
-mkdir $d
-if [ ! -d $d ]; then
-  echo Failed to make directory $d
+if [ ! -d $DESTDIR/$d ]; then
+mkdir $DESTDIR/$d
+if [ ! -d $DESTDIR/$d ]; then
+  echo Failed to make directory $DESTDIR/$d
   exit 1
 fi
 fi
@@ -19,9 +21,9 @@
 
 for p in $*; do
  p2=`basename $p`
- echo Installing $p as $LIBDIR/$p2
- cp -f $p $LIBDIR/
- chmod $INSTALLPERMS $LIBDIR/$p2
+ echo Installing $p as $DESTDIR/$LIBDIR/$p2
+ cp -f $p $DESTDIR/$LIBDIR/
+ chmod $INSTALLPERMS $DESTDIR/$LIBDIR/$p2
 done
 
 exit 0

<Prev in Thread] Current Thread [Next in Thread>
  • svn commit: samba r13642 - branches/SAMBA_3_0/source branches/SAMBA_3_0/source/script trunk/source trunk/source/script, lmuelle <=