{"thread":{"id":"3159","subject":"5c7d3c95 broke 026351a","startedAt":"2006-01-26T13:45:22Z","lastAt":"2006-01-26T16:39:27Z","messageCount":2,"participants":["Uwe Zeisberger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"15150","messageId":"20060126134521.GA11570@informatik.uni-freiburg.de","threadId":"3159","inReplyTo":null,"subject":"5c7d3c95 broke 026351a","fromName":"Uwe Zeisberger","fromEmail":"zeisberg@informatik.uni-freiburg.de","sentAt":"2006-01-26T13:45:22Z","receivedAt":"2006-01-26T13:45:22Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\n\nzeisberger@io:~$ VN=$(nonexistentcmd) || echo lala\nbash: nonexistentcmd: command not found\nlala\n\nuzeisberger@io:~$ VN=$(nonexistentcmd | sed 's/-/./g') || echo lala\nbash: nonexistentcmd: command not found\n\nThe reason is (from bash(1)):\n\n\tThe return status of a pipeline is the exit status of the last\n\tcommand, unless the pipefail option is enabled.\n\nand the sed command is fine.\n\npipefail is not portable, i.e. Solaris' sh doesn't support it.\n\nI'd suggest:\n\n\tif VN=$(git-describe --abbrev=4 HEAD 2>/dev/null); then\n\t\tVN=$(echo \"$VN\" | sed 's/-/./g');\n\telse\n\t\tVN=$(cat version) || VN=\"$DEF_VER\";\n\tfi\n\nThis works with Solaris' sh and bash.\n\nBest regards\nUwe\n\n-- \nUwe Zeisberger\n\nexit vi, lesson V:\no : q ! CTRL-V <CR> <Esc> \" d d d @ d\n"},{"id":"15154","messageId":"1138293567831-git-send-email-Uwe_Zeisberger@digi.com","threadId":"3159","inReplyTo":"20060126134521.GA11570@informatik.uni-freiburg.de","subject":"[PATCH] Make GIT-VERSION-GEN tolerate missing git describe command again","fromName":"Uwe Zeisberger","fromEmail":"uwe_zeisberger@digi.com","sentAt":"2006-01-26T16:39:27Z","receivedAt":"2006-01-26T16:39:27Z","isPatch":true,"sender":{"key":"uwe_zeisberger@digi.com","avatar":null},"body":"Commit 5c7d3c95 broke that by making the git-describe command part of\na pipe.\n\nSigned-off-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>\n\n---\n\n GIT-VERSION-GEN |    8 +++++---\n 1 files changed, 5 insertions(+), 3 deletions(-)\n\nb5763601050151e944cb58b3b0fe6f4aee88b47f\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex e3cd9fa..72201be 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -5,9 +5,11 @@ DEF_VER=v1.1.GIT\n \n # First try git-describe, then see if there is a version file\n # (included in release tarballs), then default\n-VN=$(git-describe --abbrev=4 HEAD 2>/dev/null | sed -e 's/-/./g') ||\n-VN=$(cat version) ||\n-VN=\"$DEF_VER\"\n+if VN=$(git-describe --abbrev=4 HEAD 2>/dev/null); then\n+\tVN=$(echo \"$VN\" | sed -e 's/-/./g');\n+else\n+\tVN=$(cat version) || VN=\"$DEF_VER\"\n+fi\n \n VN=$(expr \"$VN\" : v*'\\(.*\\)')\n \n-- \n1.1.4-g9acfd\n"}]}