Hi. The following script:
# run this script from build/ subdirectory, so vmVersionInfo.h will be placed in build dir
URL=`git config --get remote.origin.url` COMMIT=`git show HEAD --pretty="Commit: %H Date: %ci By: %cn <%cE>" | head -n 1`
echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h test -n "${BUILD_NUMBER}" && echo -n "Jenkins build #${BUILD_NUMBER}" >> vmVersionInfo.h || echo echo """ >> vmVersionInfo.h
fails in 10.6.8 because the result is:
-n #define REVISION_STRING "git://gitorious.org/cogvm/blessed.git Commit: e0c448cf8de6377605d8831ae20f72565c1922ca Date: 2012-11-14 15:34:11 +0100 By: Esteban Lorenzano estebanlm@gmail.com
" (notice the -n at the beginning)
This -n is the one that is in the first echo: echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h
What is weird is that script works in Lion....
So, any workaround that could work in all OS?
On 17 November 2012 07:24, Mariano Martinez Peck marianopeck@gmail.com wrote:
Hi. The following script:
# run this script from build/ subdirectory, so vmVersionInfo.h will be placed in build dir
URL=`git config --get remote.origin.url` COMMIT=`git show HEAD --pretty="Commit: %H Date: %ci By: %cn <%cE>" | head -n 1`
echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h test -n "${BUILD_NUMBER}" && echo -n "Jenkins build #${BUILD_NUMBER}" >> vmVersionInfo.h || echo echo """ >> vmVersionInfo.h
fails in 10.6.8 because the result is:
-n #define REVISION_STRING "git://gitorious.org/cogvm/blessed.git Commit: e0c448cf8de6377605d8831ae20f72565c1922ca Date: 2012-11-14 15:34:11 +0100 By: Esteban Lorenzano estebanlm@gmail.com
"
(notice the -n at the beginning)
This -n is the one that is in the first echo: echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h
What is weird is that script works in Lion....
So, any workaround that could work in all OS?
what shell you using?
-- Mariano http://marianopeck.wordpress.com
zsh but Luc is not (I think) and he got the same problem. Do you think this can be the problem?
On Sat, Nov 17, 2012 at 12:58 PM, Igor Stasenko siguctua@gmail.com wrote:
On 17 November 2012 07:24, Mariano Martinez Peck marianopeck@gmail.com wrote:
Hi. The following script:
# run this script from build/ subdirectory, so vmVersionInfo.h will be
placed in build dir
URL=`git config --get remote.origin.url` COMMIT=`git show HEAD --pretty="Commit: %H Date: %ci By: %cn <%cE>" |
head -n 1`
echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h test -n "${BUILD_NUMBER}" && echo -n "Jenkins build #${BUILD_NUMBER}" >>
vmVersionInfo.h || echo
echo """ >> vmVersionInfo.h
fails in 10.6.8 because the result is:
-n #define REVISION_STRING "git://gitorious.org/cogvm/blessed.gitCommit: e0c448cf8de6377605d8831ae20f72565c1922ca Date: 2012-11-14 15:34:11
+0100 By: Esteban Lorenzano estebanlm@gmail.com
"
(notice the -n at the beginning)
This -n is the one that is in the first echo: echo -n "#define
REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h
What is weird is that script works in Lion....
So, any workaround that could work in all OS?
what shell you using?
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko.
On 17 November 2012 09:00, Mariano Martinez Peck marianopeck@gmail.com wrote:
zsh but Luc is not (I think) and he got the same problem. Do you think this can be the problem?
sure. because echo is builtin shell command
On Sat, Nov 17, 2012 at 12:58 PM, Igor Stasenko siguctua@gmail.com wrote:
On 17 November 2012 07:24, Mariano Martinez Peck marianopeck@gmail.com wrote:
Hi. The following script:
# run this script from build/ subdirectory, so vmVersionInfo.h will be placed in build dir
URL=`git config --get remote.origin.url` COMMIT=`git show HEAD --pretty="Commit: %H Date: %ci By: %cn <%cE>" | head -n 1`
echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h test -n "${BUILD_NUMBER}" && echo -n "Jenkins build #${BUILD_NUMBER}" >> vmVersionInfo.h || echo echo """ >> vmVersionInfo.h
fails in 10.6.8 because the result is:
-n #define REVISION_STRING "git://gitorious.org/cogvm/blessed.git Commit: e0c448cf8de6377605d8831ae20f72565c1922ca Date: 2012-11-14 15:34:11 +0100 By: Esteban Lorenzano estebanlm@gmail.com
"
(notice the -n at the beginning)
This -n is the one that is in the first echo: echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h
What is weird is that script works in Lion....
So, any workaround that could work in all OS?
what shell you using?
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko.
-- Mariano http://marianopeck.wordpress.com
On Sat, Nov 17, 2012 at 1:49 PM, Igor Stasenko siguctua@gmail.com wrote:
On 17 November 2012 09:00, Mariano Martinez Peck marianopeck@gmail.com wrote:
zsh but Luc is not (I think) and he got the same problem. Do you think this can be the problem?
sure. because echo is builtin shell command
With the following I get the same results:
sh ../codegen-scripts/extract-commit-info.sh
On Sat, Nov 17, 2012 at 12:58 PM, Igor Stasenko siguctua@gmail.com wrote:
On 17 November 2012 07:24, Mariano Martinez Peck marianopeck@gmail.com
wrote:
Hi. The following script:
# run this script from build/ subdirectory, so vmVersionInfo.h will
be placed in build dir
URL=`git config --get remote.origin.url` COMMIT=`git show HEAD --pretty="Commit: %H Date: %ci By: %cn <%cE>" |
head -n 1`
echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h test -n "${BUILD_NUMBER}" && echo -n "Jenkins build #${BUILD_NUMBER}"
vmVersionInfo.h || echo
echo """ >> vmVersionInfo.h
fails in 10.6.8 because the result is:
-n #define REVISION_STRING "git://gitorious.org/cogvm/blessed.gitCommit: e0c448cf8de6377605d8831ae20f72565c1922ca Date: 2012-11-14 15:34:11
+0100 By: Esteban Lorenzano estebanlm@gmail.com
"
(notice the -n at the beginning)
This -n is the one that is in the first echo: echo -n "#define
REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h
What is weird is that script works in Lion....
So, any workaround that could work in all OS?
what shell you using?
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko.
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko.
On Sat, Nov 17, 2012 at 2:29 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
On Sat, Nov 17, 2012 at 1:49 PM, Igor Stasenko siguctua@gmail.com wrote:
On 17 November 2012 09:00, Mariano Martinez Peck marianopeck@gmail.com wrote:
zsh but Luc is not (I think) and he got the same problem. Do you think this can be the problem?
sure. because echo is builtin shell command
With the following I get the same results:
sh ../codegen-scripts/extract-commit-info.sh
Adding #!/bin/bash at the beginning of the file woks of course. Can I commit that?
On Sat, Nov 17, 2012 at 12:58 PM, Igor Stasenko siguctua@gmail.com wrote:
On 17 November 2012 07:24, Mariano Martinez Peck <
marianopeck@gmail.com> wrote:
Hi. The following script:
# run this script from build/ subdirectory, so vmVersionInfo.h will
be placed in build dir
URL=`git config --get remote.origin.url` COMMIT=`git show HEAD --pretty="Commit: %H Date: %ci By: %cn <%cE>"
| head -n 1`
echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h test -n "${BUILD_NUMBER}" && echo -n "Jenkins build
#${BUILD_NUMBER}" >> vmVersionInfo.h || echo
echo """ >> vmVersionInfo.h
fails in 10.6.8 because the result is:
-n #define REVISION_STRING "git://gitorious.org/cogvm/blessed.gitCommit: e0c448cf8de6377605d8831ae20f72565c1922ca Date: 2012-11-14 15:34:11
+0100 By: Esteban Lorenzano estebanlm@gmail.com
"
(notice the -n at the beginning)
This -n is the one that is in the first echo: echo -n "#define
REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h
What is weird is that script works in Lion....
So, any workaround that could work in all OS?
what shell you using?
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko.
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko.
-- Mariano http://marianopeck.wordpress.com
On 17 November 2012 10:31, Mariano Martinez Peck marianopeck@gmail.com wrote:
On Sat, Nov 17, 2012 at 2:29 PM, Mariano Martinez Peck marianopeck@gmail.com wrote:
On Sat, Nov 17, 2012 at 1:49 PM, Igor Stasenko siguctua@gmail.com wrote:
On 17 November 2012 09:00, Mariano Martinez Peck marianopeck@gmail.com wrote:
zsh but Luc is not (I think) and he got the same problem. Do you think this can be the problem?
sure. because echo is builtin shell command
With the following I get the same results:
sh ../codegen-scripts/extract-commit-info.sh
Adding #!/bin/bash at the beginning of the file woks of course. Can I commit that?
yes, please.
On Sat, Nov 17, 2012 at 12:58 PM, Igor Stasenko siguctua@gmail.com wrote:
On 17 November 2012 07:24, Mariano Martinez Peck marianopeck@gmail.com wrote:
Hi. The following script:
# run this script from build/ subdirectory, so vmVersionInfo.h will be placed in build dir
URL=`git config --get remote.origin.url` COMMIT=`git show HEAD --pretty="Commit: %H Date: %ci By: %cn <%cE>" | head -n 1`
echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h test -n "${BUILD_NUMBER}" && echo -n "Jenkins build #${BUILD_NUMBER}" >> vmVersionInfo.h || echo echo """ >> vmVersionInfo.h
fails in 10.6.8 because the result is:
-n #define REVISION_STRING "git://gitorious.org/cogvm/blessed.git Commit: e0c448cf8de6377605d8831ae20f72565c1922ca Date: 2012-11-14 15:34:11 +0100 By: Esteban Lorenzano estebanlm@gmail.com
"
(notice the -n at the beginning)
This -n is the one that is in the first echo: echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h
What is weird is that script works in Lion....
So, any workaround that could work in all OS?
what shell you using?
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko.
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko.
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
On Sat, Nov 17, 2012 at 09:49:32AM -0300, Igor Stasenko wrote:
On 17 November 2012 09:00, Mariano Martinez Peck marianopeck@gmail.com wrote:
zsh but Luc is not (I think) and he got the same problem. Do you think this can be the problem?
sure. because echo is builtin shell command
Also there is /bin/echo which may be more portable.
Dave
vm-dev@lists.squeakfoundation.org