Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jul 2007 18:37:16 GMT
From:      "Constantine A. Murenin" <cnst@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 123027 for review
Message-ID:  <200707061837.l66IbGSN049491@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=123027

Change 123027 by cnst@dale on 2007/07/06 18:37:09

	Improved the script, now it creates the dev/lm directory if it doesn't exist, and renames the files if they already exist, so that the new files can be linked. (Previously, it was just giving errors in these circumstances.)

Affected files ...

.. //depot/projects/soc2007/cnst-sensors/sensors.ln.sh#2 edit

Differences ...

==== //depot/projects/soc2007/cnst-sensors/sensors.ln.sh#2 (text+ko) ====

@@ -1,12 +1,24 @@
 #!/bin/sh
-# $P4: //depot/projects/soc2007/cnst-sensors/sensors.ln.sh#1 $
+# $P4: //depot/projects/soc2007/cnst-sensors/sensors.ln.sh#2 $
 # Author: Constantine A. Murenin, 2007-07
 
 # This file creates symbolic links for GSoC2007 cnst_sensors project
 
 SPREFIX=`pwd`		#source prefix, i.e. this directory	XXX
 TPREFIX=${@:-/usr/src}	#target prefix, i.e. /usr/src
-#echo "Target prefix: $PREFIX"
+#echo "Source prefix: $SPREFIX;	Target prefix: $TPREFIX"
+
+#create some directories that are specific for this project,
+#if they don't exist already
+for i in "sys/dev/lm"
+do
+	DIR2C=$TPREFIX/$i	#directory to create
+	if [ ! -d $DIR2C ]
+	then
+		mkdir $DIR2C && \
+			echo "Created $DIR2C"
+	fi
+done
 
 for i in `find ./ -name "*.*" -type d`
 do
@@ -23,6 +35,10 @@
 		then
 #			echo "Removing $TFILE" && ls -l $TFILE
 			rm $TFILE
+		elif [ -f $TFILE ]
+		then
+			mv $TFILE $TFILE.orig.`date +%Y-%m-%dT%H%M%S%z` && \
+				echo "File $TFILE renamed"
 		fi
 		ln -sh $SFILE $TFILE || \
 			echo "File $FILEINDIR not copied to $TDIR, file already exists"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707061837.l66IbGSN049491>