Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142115422
D53981.id167644.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D53981.id167644.diff
View Options
diff --git a/tools/tools/locale/tools/finalize b/tools/tools/locale/tools/finalize
--- a/tools/tools/locale/tools/finalize
+++ b/tools/tools/locale/tools/finalize
@@ -69,64 +69,69 @@
while ( getline line < \"${TEMP4}\" ) {print line} } \
!/## / { print \$0 }"
-# Rename the sources with 3 components name into the POSIX version of the name using @modifier
-mkdir -p $old $new
-cd $old
-pwd
-for i in *_*_*.*.src; do
- if [ "$i" = "*_*_*.*.src" ]; then
- break
- fi
- oldname=${i%.*}
- nname=`echo $oldname | awk '{ split($0, a, "_"); print a[1]"_"a[3]"@"a[2];} '`
- mv -f ${oldname}.src ${nname}.src
- sed -i '' -e "s/${oldname}/${nname}/g" Makefile
-done
-
-# For variable without @modifier ambiguity do not keep the @modifier
-for i in *@*.src; do
- if [ "$i" = "*@*.src" ]; then
- break
- fi
- oldname=${i%.*}
- shortname=${oldname%@*}
- if [ $(ls ${shortname}@* | wc -l) -eq 1 ] ; then
- mv -f $i ${shortname}.src
- sed -i '' -e "s/${oldname}/${shortname}/g" Makefile
- fi
-done
-
-# Rename the modifiers into non abbreviated version
-for i in *@Latn.src; do
- if [ "$i" = "*@Latn.src" ]; then
- break
- fi
- mv -f ${i} ${i%@*}@latin.src
- sed -i '' -e "s/${i%.*}/${i%@*}@latin/g" Makefile
-done
-
-for i in *@Cyrl.src; do
- if [ "$i" = "*@Cyrl.src" ]; then
- break
- fi
- mv -f ${i} ${i%@*}@cyrillic.src
- sed -i '' -e "s/${i%.*}/${i%@*}@cyrillic/g" Makefile
-done
-
-# On locales with multiple modifiers rename the "default" version without the @modifier
-default_locales="sr_RS@cyrillic"
-for i in ${default_locales}; do
- localename=${i%@*}
- mod=${i#*@}
- for l in ${localename}.*@${mod}.src; do
- if [ "$l" = "${localename}.*@${mod}.src" ]; then
+if ! find "$old" -name "*_*_*.*.src" -type f -print -quit | grep -q .; then
+ exit
+fi
+
+mkdir -p $new
+(
+ cd $old
+
+ # Rename the sources with 3 components name into the POSIX version of the name using @modifier
+ for i in *_*_*.*.src; do
+ if [ "$i" = "*_*_*.*.src" ]; then
+ break
+ fi
+ oldname=${i%.*}
+ nname=`echo $oldname | awk '{ split($0, a, "_"); print a[1]"_"a[3]"@"a[2];} '`
+ mv -f ${oldname}.src ${nname}.src
+ sed -i '' -e "s/${oldname}/${nname}/g" Makefile
+ done
+
+ # For variable without @modifier ambiguity do not keep the @modifier
+ for i in *@*.src; do
+ if [ "$i" = "*@*.src" ]; then
+ break
+ fi
+ oldname=${i%.*}
+ shortname=${oldname%@*}
+ if [ $(ls ${shortname}@* | wc -l) -eq 1 ] ; then
+ mv -f $i ${shortname}.src
+ sed -i '' -e "s/${oldname}/${shortname}/g" Makefile
+ fi
+ done
+
+ # Rename the modifiers into non abbreviated version
+ for i in *@Latn.src; do
+ if [ "$i" = "*@Latn.src" ]; then
break
fi
- mv -f ${l} ${l%@*}.src
- sed -i '' -e "s/${l%.*}/${l%@*}/g" Makefile
+ mv -f ${i} ${i%@*}@latin.src
+ sed -i '' -e "s/${i%.*}/${i%@*}@latin/g" Makefile
+ done
+
+ for i in *@Cyrl.src; do
+ if [ "$i" = "*@Cyrl.src" ]; then
+ break
+ fi
+ mv -f ${i} ${i%@*}@cyrillic.src
+ sed -i '' -e "s/${i%.*}/${i%@*}@cyrillic/g" Makefile
+ done
+
+ # On locales with multiple modifiers rename the "default" version without the @modifier
+ default_locales="sr_RS@cyrillic"
+ for i in ${default_locales}; do
+ localename=${i%@*}
+ mod=${i#*@}
+ for l in ${localename}.*@${mod}.src; do
+ if [ "$l" = "${localename}.*@${mod}.src" ]; then
+ break
+ fi
+ mv -f ${l} ${l%@*}.src
+ sed -i '' -e "s/${l%.*}/${l%@*}/g" Makefile
+ done
done
-done
-cd -
+)
grep '^LOCALES+' ${old}/Makefile > ${TEMP}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 17, 3:57 AM (13 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26367919
Default Alt Text
D53981.id167644.diff (3 KB)
Attached To
Mode
D53981: locale: tools: Make finalize idempotent
Attached
Detach File
Event Timeline
Log In to Comment