Skip to contentSkip to conversation

setlocalversion: fix version for untaged nontip mercurial revs

PATCH In review Milton Miller 2 participants 2 messages Jul 22, 2010 – Aug 12, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 setlocalversion: fix version for untaged nontip mercurial revs

The manpage for cut says it will return all lines without the delimiter unless -s is specified.

When I backed up my mecurial tree to generate modules, I found that the scm part of localversion was turning up blank.

Cc Michal Marek <[email protected]>
Cc "Michał Górny" <[email protected]>

---
This version is against linux next-20100721. The diff against 35-rc would be shifted left one tab stop and have different line numbers, should this be sent to stable.

Resend without 8-bit characters (maintainers name) in header Added [email protected] which get-maintainer did not

scripts/setlocalversion +1 -1
index a7b9f76..872312f 100755
@@ -86,7 +86,7 @@ scm_version()
 
 	# Check for mercurial and a mercurial repo.
 	if hgid=`hg id 2>/dev/null`; then
-		tag=`printf '%s' "$hgid" | cut -d' ' -f2`
+		tag=`printf '%s' "$hgid" | cut -s -d' ' -f2`
 
 		# Do we have an untagged version?
 		if [ -z "$tag" -o "$tag" = tip ]; then
#1 lore raw
Quoted 23 lines · Milton Miller

The manpage for cut says it will return all lines without the delimiter unless -s is specified.

When I backed up my mecurial tree to generate modules, I found that the scm part of localversion was turning up blank.

Cc Michal Marek <[email protected]>
Cc "Michał Górny" <[email protected]>

---
This version is against linux next-20100721. The diff against 35-rc would be shifted left one tab stop and have different line numbers, should this be sent to stable.

Resend without 8-bit characters (maintainers name) in header Added [email protected] which get-maintainer did not

scripts/setlocalversion +0 -0
index a7b9f76..872312f 100755

scripts/setlocalversion scm_version() · line 92

Quoted 8 lines
scripts/setlocalversion +1 -1
@@ -86,7 +86,7 @@ scm_version()
 
 	# Check for mercurial and a mercurial repo.
 	if hgid=`hg id 2>/dev/null`; then
-		tag=`printf '%s' "$hgid" | cut -d' ' -f2`
+		tag=`printf '%s' "$hgid" | cut -s -d' ' -f2`
 
 		# Do we have an untagged version?
 		if [ -z "$tag" -o "$tag" = tip ]; then

Sorry, I somehow missed this patch. I applied it now.

Michal