git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 2/6] update_unicode.sh: remove an unnecessary subshell level

From
Beat Bolli <dev+git@drbeat.li>
Date
Dec 13, 2016, 23:31 UTC
Message-ID
<1481671904-1143-3-git-send-email-dev+git@drbeat.li>
In-Reply-To
<1481671904-1143-1-git-send-email-dev+git@drbeat.li>

After the move into contrib/update-unicode, we no longer create the unicode directory to have a clean working folder. Instead, the directory of the script is used. This means that the subshell can be removed.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
---
 contrib/update-unicode/update_unicode.sh | 53 ++++++++++++++++----------------
 1 file changed, 26 insertions(+), 27 deletions(-)
diff --git a/contrib/update-unicode/update_unicode.sh b/contrib/update-unicode/update_unicode.sh
index 7b90126..ff664ec 100755
--- a/contrib/update-unicode/update_unicode.sh
+++ b/contrib/update-unicode/update_unicode.sh
@@ -7,32 +7,31 @@
 #
 cd "$(dirname "$0")"
 UNICODEWIDTH_H=$(git rev-parse --show-toplevel)/unicode_width.h
+
+if ! test -f UnicodeData.txt; then
+	wget http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
+fi &&
+if ! test -f EastAsianWidth.txt; then
+	wget http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt
+fi &&
+if ! test -d uniset; then
+	git clone https://github.com/depp/uniset.git
+fi &&
 (
-	if ! test -f UnicodeData.txt; then
-		wget http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
+	cd uniset &&
+	if ! test -x uniset; then
+		autoreconf -i &&
+		./configure --enable-warnings=-Werror CFLAGS='-O0 -ggdb'
 	fi &&
-	if ! test -f EastAsianWidth.txt; then
-		wget http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt
-	fi &&
-	if ! test -d uniset; then
-		git clone https://github.com/depp/uniset.git
-	fi &&
-	(
-		cd uniset &&
-		if ! test -x uniset; then
-			autoreconf -i &&
-			./configure --enable-warnings=-Werror CFLAGS='-O0 -ggdb'
-		fi &&
-		make
-	) &&
-	UNICODE_DIR=. && export UNICODE_DIR &&
-	cat >$UNICODEWIDTH_H <<-EOF
-	static const struct interval zero_width[] = {
-		$(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |
-		  grep -v plane)
-	};
-	static const struct interval double_width[] = {
-		$(uniset/uniset --32 eaw:F,W)
-	};
-	EOF
-)
+	make
+) &&
+UNICODE_DIR=. && export UNICODE_DIR &&
+cat >$UNICODEWIDTH_H <<-EOF
+static const struct interval zero_width[] = {
+	$(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |
+	  grep -v plane)
+};
+static const struct interval double_width[] = {
+	$(uniset/uniset --32 eaw:F,W)
+};
+EOF
-- 
2.7.2
Previous: Junio C HamanoNext: Beat Bolli
Message 6 of 12 in “unicode_width.h: update the width tables to Unicode 9.0”
  1. 0/6 unicode_width.h: update the width tables to Unicode 9.0Beat Bolli, Dec 13, 2016
  2. 6/6 unicode_width.h: update the width tables to Unicode 9.0Beat Bolli, Dec 13, 2016
  3. 4/6 update-unicode.sh: automatically download newer definition filesBeat Bolli, Dec 13, 2016
  4. Beat BolliDec 14, 2016
  5. Junio C HamanoDec 14, 2016
  6. 2/6 update_unicode.sh: remove an unnecessary subshell levelBeat Bolli, Dec 13, 2016
  7. 5/6 update_unicode.sh: remove the plane filterBeat Bolli, Dec 13, 2016
  8. 3/6 update_unicode.sh: pin the uniset repo to a known good commitBeat Bolli, Dec 13, 2016
  9. Dennis KaarsemakerDec 15, 2016
  10. Junio C HamanoDec 15, 2016
  11. 1/6 update_unicode.sh: move it into contrib/update-unicodeBeat Bolli, Dec 13, 2016
  12. Junio C HamanoDec 14, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.