Skip to contentSkip to conversation

Add brackets to if condition in tools/setlocalversion

PATCH New Tsi-Chung Liew 3 participants 5 messages Mar 20, 2008 – Mar 24, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add brackets to if condition in tools/setlocalversion

The long condition in the script causes all ColdFire platforms unable to compile correctly. By adding square brackets, all compile without error.

---
 tools/setlocalversion |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/setlocalversion +2 -2
index 9bbdafd..2c27291 100755
@@ -11,8 +11,8 @@ cd "${1:-.}" || usage
 # Check for git and a git repo.
 if head=`git rev-parse --verify HEAD 2>/dev/null`; then
 	# Do we have an untagged version?
-	if git name-rev --tags HEAD | \
-	   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
+	if [git name-rev --tags HEAD | \
+	   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null]; then
 	        git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
 	fi
 
Signature · 1 line
1.5.4.1
#1 lore raw

PATCH 1/1 Add brackets to if condition in tools/setlocalversion

Quoted 14 lines · In message <[email protected]>…

The long condition in the script causes all ColdFire platforms unable to compile correctly. By adding square brackets, all compile without error.

---
 tools/setlocalversion |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/setlocalversion +0 -0
index 9bbdafd..2c27291 100755

tools/setlocalversion cd "${1:-.}" || usage · line 17

Quoted 9 lines
tools/setlocalversion +2 -2
@@ -11,8 +11,8 @@ cd "${1:-.}" || usage
 # Check for git and a git repo.
 if head=`git rev-parse --verify HEAD 2>/dev/null`; then
 	# Do we have an untagged version?
-	if git name-rev --tags HEAD | \
-	   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
+	if [git name-rev --tags HEAD | \
+	   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null]; then
 	        git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
 	fi

Ummm... what exactly has this code, which is running natively in the shell on your development host, to do with a ColdFire cross-compile?

Note that the very same code is used in the Linux kernel.

If this code doesn't work for you, you also cannot compile any recent Linux kernel code?

Also, I don't understand what you do.

Unless you can provide a really good explanation why that should be needed I will reject this patch.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Computers are not intelligent.  They only think they are.
#2 lore raw

PATCH 1/1 Add brackets to if condition in tools/setlocalversion

Wolfgang,

Please ignore "Add brackets to if condition in
tools/setlocalversion" patch.

The u-boot for ColdFire was able to build prior to version
1.3.2. Until, I merged the local with the latest update. Whenever I tried to build a u-boot for any ColdFire platforms, the error message always end up in start.S

*** cpu/mcf5445x/start.s ***
.global version_string
Version_string:

	.ascii U_BOOT_VERSION                           ln 378
	.ascii " (", __DATE__, " - ", __TIME__, ")"     ln 379
	.ascii CONFIG_IDENT_STRING, "\0"                ln 380 (EOF)

*** error message ***
start.S: Assembler messages:
start.S:380 Error: unaligned opcodes detected in executable segment make[1]: *** [start.o] Error 1
make[1]: Leaving directory '...'

I reversed the patches from HEAD and found out it was the change
in tools/setlocalversion. My first assumption was focused on the setlocalversion and by adding brackets to it solved the compiling error. I have not found out the actual cause of the issue yet. For the time being, please leave it be until I provide the update later.

Thanks.

Regards,
TsiChung

-----Original Message-----
From: [email protected] [mailto:wd at denx.de]
Sent: Thursday, March 20, 2008 7:25 PM
To: Liew Tsi Chung
Cc: U-Boot-Users; Rigby John
Subject: Re: [PATCH] Add brackets to if condition in tools/setlocalversion

In message <[email protected]> you

Quoted 16 lines · wrote:

The long condition in the script causes all ColdFire platforms unable to compile correctly. By adding square brackets, all compile without error.

---
 tools/setlocalversion |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/setlocalversion index renamed from tools/setlocalversion +0 -0

9bbdafd..2c27291 100755

tools/setlocalversion +0 -0
@@ -11,8 +11,8 @@ cd "${1:-.}" || usage  # Check for git and a git 

repo.
if head=git rev-parse --verify HEAD 2>/dev/null; then

tools/setlocalversion cd "${1:-.}" || usage

Quoted 3 lines
tools/setlocalversion +0 -2
 	# Do we have an untagged version?
-	if git name-rev --tags HEAD | \
-	   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' >

/dev/null; then

tools/setlocalversion

Quoted 2 lines
tools/setlocalversion +2 -0
+	if [git name-rev --tags HEAD | \
+	   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' >

/dev/null];

tools/setlocalversion

Quoted 2 lines
tools/setlocalversion +1 -0
+then
 	        git describe | awk -F- '{printf("-%05d-%s",

$(NF-1),$(NF))}'

Quoted 1 line

fi

Ummm... what exactly has this code, which is running natively in the shell on your development host, to do with a ColdFire cross-compile?

Note that the very same code is used in the Linux kernel.

If this code doesn't work for you, you also cannot compile any recent Linux kernel code?

Also, I don't understand what you do.

Unless you can provide a really good explanation why that should be needed I will reject this patch.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Computers are not intelligent.  They only think they are.
#3 lore raw

PATCH 1/1 Add brackets to if condition in tools/setlocalversion

What distro are you running? Some use dash for /bin/sh instead of bash. That may be your problem.

Quoted 101 lines · Liew Tsi Chung

Wolfgang,

Please ignore "Add brackets to if condition in
tools/setlocalversion" patch.

The u-boot for ColdFire was able to build prior to version
1.3.2. Until, I merged the local with the latest update. Whenever I tried to build a u-boot for any ColdFire platforms, the error message always end up in start.S

*** cpu/mcf5445x/start.s ***
.global version_string
Version_string:

	.ascii U_BOOT_VERSION                           ln 378
	.ascii " (", __DATE__, " - ", __TIME__, ")"     ln 379
	.ascii CONFIG_IDENT_STRING, "\0"                ln 380 (EOF)

*** error message ***
start.S: Assembler messages:
start.S:380 Error: unaligned opcodes detected in executable segment make[1]: *** [start.o] Error 1
make[1]: Leaving directory '...'

I reversed the patches from HEAD and found out it was the change
in tools/setlocalversion. My first assumption was focused on the setlocalversion and by adding brackets to it solved the compiling error. I have not found out the actual cause of the issue yet. For the time being, please leave it be until I provide the update later.

Thanks.

Regards,
TsiChung

-----Original Message-----
From: wd at denx.de [mailto:wd at denx.de]
Sent: Thursday, March 20, 2008 7:25 PM
To: Liew Tsi Chung
Cc: U-Boot-Users; Rigby John
Subject: Re: [PATCH] Add brackets to if condition in tools/setlocalversion

In message <[email protected]> you

Quoted 17 lines · wrote:

The long condition in the script causes all ColdFire platforms unable to compile correctly. By adding square brackets, all compile without error.

---
 tools/setlocalversion |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/setlocalversion index renamed from tools/setlocalversion +0 -0

9bbdafd..2c27291 100755

tools/setlocalversion +0 -0
@@ -11,8 +11,8 @@ cd "${1:-.}" || usage  # Check for git and a git 

repo.
if head=git rev-parse --verify HEAD 2>/dev/null; then

tools/setlocalversion cd "${1:-.}" || usage

Quoted 3 lines
tools/setlocalversion +0 -2
 	# Do we have an untagged version?
-	if git name-rev --tags HEAD | \
-	   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' >

/dev/null; then

tools/setlocalversion

Quoted 3 lines
tools/setlocalversion +2 -0
+	if [git name-rev --tags HEAD | \
+	   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' >

/dev/null];

tools/setlocalversion

Quoted 3 lines
tools/setlocalversion +1 -0
+then
 	        git describe | awk -F- '{printf("-%05d-%s",

$(NF-1),$(NF))}'

Quoted 2 lines

fi

Ummm... what exactly has this code, which is running natively in the shell on your development host, to do with a ColdFire cross-compile?

Note that the very same code is used in the Linux kernel.

If this code doesn't work for you, you also cannot compile any recent Linux kernel code?

Also, I don't understand what you do.

Unless you can provide a really good explanation why that should be needed I will reject this patch.

Best regards,

Wolfgang Denk

#4 lore raw

PATCH 1/1 Add brackets to if condition in tools/setlocalversion

John,

Fedora 3 and Fedora 8, both are using bash.

Regards,
TsiChung

-----Original Message-----
From: Rigby John
Sent: Monday, March 24, 2008 2:48 PM
To: Liew Tsi Chung
Cc: wd at denx.de; U-Boot-Users
Subject: Re: [PATCH] Add brackets to if condition in tools/setlocalversion

What distro are you running? Some use dash for /bin/sh instead of bash. That may be your problem.

Quoted 3 lines · Liew Tsi Chung

Wolfgang,

Please ignore "Add brackets to if condition in

tools/setlocalversion"

Quoted 3 lines

patch.

The u-boot for ColdFire was able to build prior to version

1.3.2.

Quoted 11 lines

Until, I merged the local with the latest update. Whenever I tried to build a u-boot for any ColdFire platforms, the error message always end up in start.S

*** cpu/mcf5445x/start.s ***
.global version_string
Version_string:

	.ascii U_BOOT_VERSION                           ln 378
	.ascii " (", __DATE__, " - ", __TIME__, ")"     ln 379
	.ascii CONFIG_IDENT_STRING, "\0"                ln 380 (EOF)
Quoted 7 lines

*** error message ***
start.S: Assembler messages:
start.S:380 Error: unaligned opcodes detected in executable segment make[1]: *** [start.o] Error 1
make[1]: Leaving directory '...'

I reversed the patches from HEAD and found out it was the change

in

Quoted 2 lines

tools/setlocalversion. My first assumption was focused on the setlocalversion and by adding brackets to it solved the compiling

error.

Quoted 76 lines

I have not found out the actual cause of the issue yet. For the time being, please leave it be until I provide the update later.

Thanks.

Regards,
TsiChung

-----Original Message-----
From: wd at denx.de [mailto:wd at denx.de]
Sent: Thursday, March 20, 2008 7:25 PM
To: Liew Tsi Chung
Cc: U-Boot-Users; Rigby John
Subject: Re: [PATCH] Add brackets to if condition in tools/setlocalversion

In message <[email protected]> you

Quoted 18 lines · wrote:

The long condition in the script causes all ColdFire platforms unable

to compile correctly. By adding square brackets, all compile without error.

---
 tools/setlocalversion |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/setlocalversion index renamed from tools/setlocalversion +0 -0

9bbdafd..2c27291 100755

tools/setlocalversion +0 -0
@@ -11,8 +11,8 @@ cd "${1:-.}" || usage  # Check for git and a git 

repo.
if head=git rev-parse --verify HEAD 2>/dev/null; then

tools/setlocalversion cd "${1:-.}" || usage

Quoted 3 lines
tools/setlocalversion +0 -2
 	# Do we have an untagged version?
-	if git name-rev --tags HEAD | \
-	   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' >

/dev/null; then

tools/setlocalversion

Quoted 3 lines
tools/setlocalversion +2 -0
+	if [git name-rev --tags HEAD | \
+	   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' >

/dev/null];

tools/setlocalversion

Quoted 3 lines
tools/setlocalversion +1 -0
+then
 	        git describe | awk -F- '{printf("-%05d-%s",

$(NF-1),$(NF))}'

Quoted 2 lines

fi

Ummm... what exactly has this code, which is running natively in the shell on your development host, to do with a ColdFire cross-compile?

Note that the very same code is used in the Linux kernel.

If this code doesn't work for you, you also cannot compile any recent Linux kernel code?

Also, I don't understand what you do.

Unless you can provide a really good explanation why that should be needed I will reject this patch.

Best regards,

Wolfgang Denk