From fbab4d37945a6ea7cf3f23cf3f01f3fef0216078 Mon Sep 17 00:00:00 2001 From: Jon Ringle Date: Wed, 16 Sep 2009 11:39:24 -0400 Subject: [PATCH] Fix tg export --quilt --numbered w/ > 8 patches MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Creating a quilt patch series with more than 8 patches with: tg export --quilt --numbered patchdir Causes the following error to be produced: eval: 1: arithmetic expression: expecting EOF: "0008 + 1" This is due to the leading 0 and the $(()) evaluates as octal rather than decimal. Add the leading zeros only to the filename, not the number itself. Signed-off-by: Jon Ringle Signed-off-by: Uwe Kleine-König --- tg-export.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tg-export.sh b/tg-export.sh index 5b7794c..a16c290 100644 --- a/tg-export.sh +++ b/tg-export.sh @@ -185,8 +185,8 @@ quilt() echo "Skip empty patch $_dep"; else if "$numbered"; then - number="$(printf "%04u" $(($(cat "$playground/^number" 2>/dev/null) + 1)))"; - bn="$number-$bn"; + number="$(echo $(($(cat "$playground/^number" 2>/dev/null) + 1)))"; + bn="$(printf "%04u-$bn" $number)"; echo "$number" >"$playground/^number"; fi; -- 2.30.2