[Rear-users] SF.net SVN: rear:[745] trunk/usr/share/rear/build/GNU/Linux/ 09_create_lib_directories_and_symlinks.sh

dag- at users.sourceforge.net dag- at users.sourceforge.net
Fri Dec 2 14:54:19 CET 2011


Revision: 745
          http://rear.svn.sourceforge.net/rear/?rev=745&view=rev
Author:   dag-
Date:     2011-12-02 13:54:19 +0000 (Fri, 02 Dec 2011)
Log Message:
-----------
- Improved logic in case /lib* lists files

Modified Paths:
--------------
    trunk/usr/share/rear/build/GNU/Linux/09_create_lib_directories_and_symlinks.sh

Modified: trunk/usr/share/rear/build/GNU/Linux/09_create_lib_directories_and_symlinks.sh
===================================================================
--- trunk/usr/share/rear/build/GNU/Linux/09_create_lib_directories_and_symlinks.sh	2011-12-01 10:30:18 UTC (rev 744)
+++ trunk/usr/share/rear/build/GNU/Linux/09_create_lib_directories_and_symlinks.sh	2011-12-02 13:54:19 UTC (rev 745)
@@ -1,8 +1,8 @@
 # Create lib directories
 for libdir in /lib* ; do
 	# $libdir always contains a leading / !
-	if [ -L $libdir ] ; then
-		[ ! -d $ROOTFS_DIR$libdir ]
+	if [[ -L $libdir ]]; then
+		[[ ! -d $ROOTFS_DIR$libdir ]]
 		BugIfError "Cannot create symlink $libdir instead of directory"
 
 		linktarget=$(readlink -f $libdir)
@@ -13,15 +13,18 @@
 
 		ln -s $v "$linktarget" $ROOTFS_DIR$libdir >&2
 		StopIfError "Could not create symlink '$ROOTFS_DIR$libdir'"
-	elif [ -d $libdir ] ; then
-		[ ! -L $ROOTFS_DIR$libdir ]
+	elif [[ -d $libdir ]]; then
+		[[ ! -L $ROOTFS_DIR$libdir ]]
 		BugIfError "Cannot create directory $libdir instead of symlink"
 
 		mkdir -p $v $ROOTFS_DIR$libdir >&2
 		StopIfError "Could not create directory '$ROOTFS_DIR$libdir'"
+	elif [[ -f $libdir ]]; then
+		Debug "WARNING: unexpected file '$libdir' found, ignoring"
 	else
-		BugError "I never should get here."
+		BugError "Unknown file '$libdir' found, uncertain what to do"
 	fi
+
 	# add relative symlinks under /usr so that a later copy into those symlinks will put the files into the
 	# rescue system and not into the origin system.
 	ln -s $v ..$libdir $ROOTFS_DIR/usr$libdir >&2

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rear-users mailing list