From owner-p4-projects@FreeBSD.ORG Fri Jul 6 18:37:17 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2C2DA16A46B; Fri, 6 Jul 2007 18:37:17 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F12BA16A421 for ; Fri, 6 Jul 2007 18:37:16 +0000 (UTC) (envelope-from cnst@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id E293D13C448 for ; Fri, 6 Jul 2007 18:37:16 +0000 (UTC) (envelope-from cnst@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l66IbGrM049494 for ; Fri, 6 Jul 2007 18:37:16 GMT (envelope-from cnst@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l66IbGSN049491 for perforce@freebsd.org; Fri, 6 Jul 2007 18:37:16 GMT (envelope-from cnst@FreeBSD.org) Date: Fri, 6 Jul 2007 18:37:16 GMT Message-Id: <200707061837.l66IbGSN049491@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cnst@FreeBSD.org using -f From: "Constantine A. Murenin" To: Perforce Change Reviews Cc: Subject: PERFORCE change 123027 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2007 18:37:17 -0000 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"