tools/create_links.sh
author Andrzej Szeszo <aszeszo@gmail.com>
Sun, 17 Apr 2011 01:38:03 +0100
changeset 566 262d41059e9b
parent 328 51a0d4541f3c
permissions -rwxr-xr-x
Added tag oi148b for changeset 459f0c0bc498
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     1
#!/bin/bash
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     2
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     3
# CDDL HEADER START
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     4
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").  
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     8
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     9
# You can obtain a copy of the license at src/OPENSOLARIS.LICENSE
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    11
# See the License for the specific language governing permissions
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    12
# and limitations under the License.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    13
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    15
# file and include the License file at src/OPENSOLARIS.LICENSE.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    19
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    20
# CDDL HEADER END
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    21
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    22
# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    23
# Use is subject to license terms.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    24
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    25
# a small script to recreate a full locale structure in the $SRC/proto dir by recreating the file permissions
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    26
# and links in the prototype files. 
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    27
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    28
# usage: ./create_links.sh <locale> <path_to_fileroot> 
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    29
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    30
ALL_LOCALES="ar en_US.UTF-8 iso_8859_1 iso_8859_13 iso_8859_15 iso_8859_2 iso_8859_5 iso_8859_7 iso_8859_9 common \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    31
 ar_EG.UTF-8 ar_SA.UTF-8 bg_BG bg_BG.ISO8859-5 bg_BG.UTF-8 ca_ES.ISO8859-1 ca ca_ES  ca_ES.ISO8859-15 \
328
51a0d4541f3c 6309693: cz locale : should be cs [PSARC 2008/528]
hnhn
parents: 0
diff changeset
    32
ca_ES.ISO8859-15@euro ca_ES.UTF-8 cs_CZ cs_CZ.ISO8859-2 cs_CZ.UTF-8 cs_CZ.UTF-8@euro cs da_DK.ISO8859-1 da da.ISO8859-15 da_DK \
0
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    33
da_DK.ISO8859-15 da_DK.ISO8859-15@euro da_DK.UTF-8 de_DE.ISO8859-1 de.UTF-8 de de.ISO8859-15 de_DE.UTF-8 de_AT de_AT.ISO8859-1 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    34
de_AT.ISO8859-15 de_AT.ISO8859-15@euro de_AT.UTF-8 de_CH de_CH.ISO8859-1 de_CH.UTF-8 de_DE  de_DE.ISO8859-15 de_DE.ISO8859-15@euro \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    35
de_DE.UTF-8@euro de_LU.UTF-8 el_GR.ISO8859-7 el el.UTF-8 el_CY.UTF-8 el_GR  el_GR.ISO8859-7@euro el_GR.UTF-8 en.UTF-8 en_AU.ISO8859-1 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    36
en_AU  en_AU.UTF-8 en_CA en_CA.ISO8859-1 en_CA.UTF-8 en_GB.ISO8859-1 en_GB en_GB.ISO8859-15 en_GB.ISO8859-15@euro en_GB.UTF-8 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    37
en_IE.ISO8859-1 en_IE en_IE.ISO8859-15 en_IE.ISO8859-15@euro en_IE.UTF-8 en_MT.UTF-8 en_NZ.ISO8859-1 en_NZ en_NZ.UTF-8 en_US.ISO8859-1 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    38
en_US en_US.ISO8859-15 en_US.ISO8859-15@euro es_ES.ISO8859-1 es.UTF-8 es es.ISO8859-15 es_ES.UTF-8 es_AR es_AR.ISO8859-1 es_AR.UTF-8 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    39
es_BO.ISO8859-1 es_BO es_BO.UTF-8 es_CL.ISO8859-1 es_CL es_CL.UTF-8 es_CO.ISO8859-1 es_CO es_CO.UTF-8 es_CR.ISO8859-1 es_CR es_CR.UTF-8 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    40
es_EC.ISO8859-1 es_EC es_EC.UTF-8 es_ES es_ES.ISO8859-15 es_ES.ISO8859-15@euro es_ES.UTF-8@euro es_GT.ISO8859-1 es_GT es_GT.UTF-8 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    41
es_MX.ISO8859-1 es_MX es_MX.UTF-8 es_NI.ISO8859-1 es_NI es_NI.UTF-8 es_PA.ISO8859-1 es_PA es_PA.UTF-8 es_PE.ISO8859-1 es_PE \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    42
es_PE.UTF-8 es_PY.ISO8859-1 es_PY es_PY.UTF-8 es_SV.ISO8859-1 es_SV es_SV.UTF-8 es_UY.ISO8859-1 es_UY es_UY.UTF-8 es_VE.ISO8859-1 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    43
es_VE es_VE.UTF-8 et_EE.ISO8859-15 et et_EE et_EE.UTF-8 fi_FI.ISO8859-1 fi fi.ISO8859-15 fi_FI fi_FI.ISO8859-15 fi_FI.ISO8859-15@euro \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    44
fi_FI.UTF-8 fr_FR.ISO8859-1 fr.UTF-8 fr fr.ISO8859-15 fr_FR.UTF-8 fr_BE fr_BE.ISO8859-1 fr_BE.ISO8859-15 fr_BE.ISO8859-15@euro \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    45
fr_BE.UTF-8 fr_BE.UTF-8@euro fr_CA fr_CA.ISO8859-1 fr_CA.UTF-8 fr_CH fr_CH.ISO8859-1 fr_CH.UTF-8 fr_FR fr_FR.ISO8859-15 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    46
fr_FR.ISO8859-15@euro fr_FR.UTF-8@euro fr_LU.UTF-8 he he_IL he_IL.UTF-8 hi_IN.UTF-8 hr_HR.ISO8859-2 hr_HR hr_HR.UTF-8 hu_HU.ISO8859-2 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    47
hu hu_HU hu_HU.UTF-8 is_IS.ISO8859-1 is_IS is_IS.UTF-8  \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    48
it_IT.ISO8859-1 it_IT.ISO8859-15 it.UTF-8 it it.ISO8859-15 it_IT.UTF-8 it_IT it_IT.ISO8859-15@euro it_IT.UTF-8@euro ja_JP.PCK \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    49
ja_JP.UTF-8 ja_JP.eucJP ja ko_KR.UTF-8 ko.UTF-8 ko_KR.EUC ko_KR.EUC@dict ko_KR.UTF-8@dict ko lt_LT.ISO8859-13 lt lt_LT lt_LT.UTF-8 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    50
lv_LV.ISO8859-13 lv lv_LV lv_LV.UTF-8 mk_MK.ISO8859-5 mk_MK mk_MK.UTF-8 mt_MT.UTF-8 nb_NO.UTF-8 nl.ISO8859-15 nl_NL.ISO8859-1 nl \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    51
nl_BE.ISO8859-1 nl_BE nl_BE.ISO8859-15 nl_BE.ISO8859-15@euro nl_BE.UTF-8 nl_NL nl_NL.ISO8859-15 nl_NL.ISO8859-15@euro nl_NL.UTF-8 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    52
nn_NO.UTF-8 no no_NO no_NO.ISO8859-1@bokmal no_NO.ISO8859-1@nynorsk no_NY nr pl_PL.ISO8859-2 pl_PL.UTF-8 pl pl.UTF-8 pl_PL \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    53
pt_PT.ISO8859-1 pt.ISO8859-15 pt pt_BR.ISO8859-1  pt_BR  pt_BR.UTF-8 pt_PT pt_PT.ISO8859-15 pt_PT.ISO8859-15@euro pt_PT.UTF-8 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    54
ro_RO.ISO8859-2 ro_RO ro_RO.UTF-8 ru_RU.ISO8859-5 ru_RU.UTF-8 ru ru.UTF-8 ru.koi8-r ru_RU ru_RU.ANSI1251 ru_RU.KOI8-R \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    55
sh_BA.ISO8859-2@bosnia sh_BA.UTF-8 sh_BA sk_SK.ISO8859-2 sk_SK sk_SK.UTF-8 sl_SI.ISO8859-2 sl_SI.UTF-8 sl_SI sq_AL.ISO8859-2 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    56
sq_AL.UTF-8 sq_AL sr_CS.UTF-8 sr_CS sr_SP sr_YU.ISO8859-5 sr_YU sv_SE.ISO8859-1 sv.UTF-8 sv sv.ISO8859-15 sv_SE.UTF-8 sv_SE \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    57
sv_SE.ISO8859-15 sv_SE.ISO8859-15@euro sv_SE.UTF-8@euro th_TH.ISO8859-11 th th_TH th_TH.TIS620 th_TH.UTF-8 tr_TR.ISO8859-9 tr \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    58
tr_TR tr_TR.UTF-8 zh.GBK zh_CN.UTF-8 zh zh.UTF-8 zh_CN.EUC zh_CN.EUC@pinyin zh_CN.EUC@radical zh_CN.EUC@stroke zh_CN.GB18030 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    59
zh_CN.GB18030@pinyin zh_CN.GB18030@radical zh_CN.GB18030@stroke zh_CN.GBK zh_CN.GBK@pinyin \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    60
zh_CN.GBK@radical zh_CN.GBK@stroke zh_CN.UTF-8@pinyin zh_CN.UTF-8@radical zh_CN.UTF-8@stroke zh_HK.BIG5HK \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    61
zh_HK.BIG5HK@radical zh_HK.BIG5HK@stroke zh_HK.UTF-8 zh_HK.UTF-8@radical zh_HK.UTF-8@stroke zh_TW zh_TW.BIG5 \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    62
zh_TW.BIG5@pinyin zh_TW.BIG5@radical zh_TW.BIG5@stroke zh_TW.BIG5@zhuyin zh_TW.EUC zh_TW.EUC@pinyin zh_TW.EUC@radical \
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    63
zh_TW.EUC@stroke zh_TW.EUC@zhuyin zh_TW.UTF-8 zh_TW.UTF-8@pinyin zh_TW.UTF-8@radical zh_TW.UTF-8@stroke zh_TW.UTF-8@zhuyin iconv" 
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    64
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    65
FILEROOT=$2
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    66
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    67
ARCH=`uname -p`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    68
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    69
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    70
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    71
create_file()
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    72
{
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    73
	file=$1
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    74
	echo
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    75
	echo "line: $file"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    76
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    77
	# if the file is a symlink it will be in as "file=link" rather than just "file "
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    78
	echo "$file" | /usr/xpg4/bin/grep -q "="
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    79
	if [ $? -eq 0 ];then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    80
	   SPACE='$'
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    81
	   echo "symlink"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    82
	   ##
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    83
	   ## use 'grep /$locale/' to avoid special case, e.g.:
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    84
	   ## $file=usr/lib/locale/es_MX/es_MX.so.3=../es_MX.ISO8859-1/es_MX.ISO8859-1.so.3
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    85
	   ##
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    86
	   echo "$file" | awk -F"=" '{print $2}' | /usr/xpg4/bin/grep /$locale/
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    87
	   if [ $? -eq 0 ] #if the link is on the left of the symlink then we don't want it
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    88
	   then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    89
		echo "$locale is on left side of link - ignoring"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    90
		# set the space to somethign you'll never actually see
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    91
		SPACE='&'
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    92
	   fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    93
	else
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    94
	    echo "regular file"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    95
	    SPACE=' '
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    96
	fi 
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    97
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    98
	line=`egrep -h "$file${SPACE}" $SRC/pkgmaps/prototype.* | egrep -v "^#" | sort -u`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    99
	echo "full line is $line"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   100
	FILETYPE=`echo $line | awk '{print $1}'`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   101
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   102
	if [ "$FILETYPE" != "s" ];then	
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   103
	    FILE=`echo $line | awk '{print $3}'`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   104
	    PERMS=`echo $line | awk '{print $4}'`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   105
	    OWNER=`echo $line | awk '{print $5}'`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   106
	    GROUP=`echo $line | awk '{print $6}'`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   107
	else
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   108
	    FILE=`echo $line | awk '{print $3}'| awk -F"=" '{print $1}'`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   109
	    LINKTO=`echo $line | awk '{print $3}'| awk -F"=" '{print $2}'`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   110
	fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   111
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   112
	echo "Filetype: $FILETYPE"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   113
	echo "File: $FILE"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   114
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   115
	DIR=`dirname $FILE`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   116
	if [ ! -d $FILEROOT/$DIR ];then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   117
	    install -d $FILEROOT/$DIR
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   118
	fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   119
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   120
	if [[ "$FILETYPE" == "d" || "$FILETYPE" == "f" ]];then	
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   121
	    #echo "Permissions: $PERMS"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   122
	    #echo "UID: $OWNER"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   123
	    #echo "GID: $GROUP"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   124
	    #echo
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   125
	    echo "changing $FILEROOT/$FILE to $PERMS, $OWNER:$GROUP"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   126
	    if [ "$FILETYPE" == "d" ];then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   127
		if [ ! -d $FILEROOT/$FILE ];then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   128
		    install -d $FILEROOT/$FILE
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   129
		fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   130
	    fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   131
	    chmod $PERMS $FILEROOT/$FILE
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   132
	    chown $OWNER:$GROUP $FILEROOT/$FILE
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   133
	elif [ "$FILETYPE" == "s" ];then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   134
	    ##
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   135
	    ## check before creating the symbol links
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   136
	    ##
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   137
	    if [ -e $FILEROOT/$FILE ]; then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   138
	        echo "Error: $FILEROOT/$FILE existed!"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   139
	    else
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   140
	        #echo "Links to: $LINKTO"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   141
	        LINKFROM=`basename $FILE`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   142
	        echo "linking  $FILEROOT/$DIR/$LINKFROM to $LINKTO"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   143
	        cd $FILEROOT/$DIR; rm -f $LINKFROM; ln -s $LINKTO $LINKFROM 2>/dev/null
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   144
	    fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   145
	else
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   146
	    echo
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   147
	   # do nothing - just ignoring the
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   148
	fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   149
}
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   150
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   151
if [ "$1" != "all" ]; then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   152
    LOCALES=$1
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   153
else
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   154
    LOCALES=${ALL_LOCALES}
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   155
fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   156
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   157
# we don't want the 64-bit files from the "other" arch! i.e if we're on sparc, we don't care about amd64
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   158
if [ "$ARCH" == "sparc" ]; then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   159
    NOARCH=amd64
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   160
else
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   161
    NOARCH=sparcv9
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   162
fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   163
echo "/$NOARCH/d" > $FILEROOT/sedscr
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   164
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   165
# We need to make sure that we have both openwin and usr/openwin available from $FILEROOT
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   166
if [ ! -L $FILEROOT/openwin ]; then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   167
    ln -s $FILEROOT/usr/openwin $FILEROOT/openwin
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   168
fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   169
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   170
if [ ! -L $FILEROOT/lib ]; then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   171
    ln -s $FILEROOT/usr/lib $FILEROOT/lib
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   172
fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   173
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   174
if [ ! -L $FILEROOT/share ]; then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   175
    ln -s $FILEROOT/usr/share $FILEROOT/share
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   176
fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   177
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   178
if [ ! -L $FILEROOT/include ]; then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   179
    ln -s $FILEROOT/usr/include $FILEROOT/include
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   180
fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   181
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   182
for locale in $LOCALES; do
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   183
    echo "---"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   184
    echo " looking at $locale"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   185
    echo "---"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   186
    # very hacky way of getting the first symlink for the locale
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   187
    #LINK1=`egrep -h "/$locale[/ ]+" $SRC/pkgmaps/prototype.* | egrep "^s" | awk '{print $3}' | awk -F"=" '{print $1}' | head -1`
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   188
    #if [ -L $FILEROOT/$LINK1 ] # if the link is already there, then we don't have to go on
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   189
    #then
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   190
    #	echo "$locale already has links created"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   191
    #else
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   192
	for i in `egrep -h "/$locale[/ ]+" $SRC/pkgmaps/prototype.* | egrep -v "^#" | awk '{print $3}' | sed -f $FILEROOT/sedscr `; do
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   193
	    create_file ${i}
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   194
    done
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   195
    #fi
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   196
done    
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   197
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   198
rm $FILEROOT/sedscr