Skip to contentSkip to conversation

scripts/mkversion: Simplify script

PATCH In review Ramkumar Ramachandra 2 participants 3 messages Aug 18, 2010 – Aug 19, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/mkversion: Simplify script

Simplify the script and add a line to help editors recognize this as a shell script.

---
 scripts/mkversion |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
scripts/mkversion +3 -6
index c12addc..6fedcb3 100644
@@ -1,6 +1,3 @@
-if [ ! -f .version ]
-then
-    echo 1
-else
-    expr 0`cat .version` + 1
-fi
+#!/bin/sh
+
+[ ! -f .version ] && echo 1 || expr 0`cat .version` + 1
Signature · 1 line
1.7.1
#1 lore raw
Quoted 2 lines · Ramkumar Ramachandra

Simplify the script and add a line to help editors recognize this as a shell script.

This does not IMO simplify the script.
The original version is simple to follow for the usual C coder. The new version is harder to follow.

Adding the bangshee (#!/bin/sh) is fine.

Sam

#2 lore raw

Hi,

Quoted 9 lines · Sam Ravnborg
Quoted 2 lines · Ramkumar Ramachandra

Simplify the script and add a line to help editors recognize this as a shell script.

This does not IMO simplify the script.
The original version is simple to follow for the usual C coder. The new version is harder to follow.

Adding the bangshee (#!/bin/sh) is fine.

Okay, we can drop the patch.
I'll pick up some other janiorial tasks to get into the hang of writing patches.

-- Ram