Improved overlay_apply() to support D_foodir usage in the name of the overlay files
[opensde-nopast.git] / scripts / Create-Links
blobba73f1f90a3a57d5a9764c4953a0ae7544677809
1 #!/bin/bash
2 # --- SDE-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
5 # Filename: scripts/Create-Links
6 # Copyright (C) 2006 - 2008 The OpenSDE Project
7 # Copyright (C) 2004 - 2006 The T2 SDE Project
8 # Copyright (C) 1998 - 2003 Clifford Wolf
10 # More information can be found in the files COPYING and README.
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; version 2 of the License. A copy of the
15 # GNU General Public License can be found in the file COPYING.
16 # --- SDE-COPYRIGHT-NOTE-END ---
18 sderootdirs="scripts bin etc lib misc doc src package architecture target"
20 linkconfig=
21 linkbuild=
23 while [ "$1" ] ; do
24 case "$1" in
25 -config)
26 linkconfig=config ; shift ;;
27 -build)
28 linkbuild=build ; shift ;;
29 -*)
30 echo
31 echo "Usage: ./scripts/Create-Links [ -config ] [ -build ] target-dir"
32 echo
33 exit 1 ;;
35 break ;;
36 esac
37 done
39 if [ -z "$1" -o "$#" != 1 -o ! -d "$1" ] ; then
40 exec $0 --help
43 for x in $sderootdirs download $linkconfig $linkbuild; do
44 [ -e $x ] || mkdir $x
45 [ -e $1/$x ] || ln -vs `pwd`/$x $1/$x
46 done
48 if [ ! -e $1/backup -a -e `pwd`/backup ] ; then
49 ln -vs `pwd`/backup $1/backup