[devscripts] 01/01: debrepro: Simplify and make the vary() function more clear

James McCoy jamessan at debian.org
Tue Oct 18 03:17:33 UTC 2016


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch master
in repository devscripts.

commit 3bb228d6485048788e35d8f41c876a220ce4cc19
Author: Guillem Jover <guillem at debian.org>
Date:   Tue Oct 18 03:39:15 2016 +0200

    debrepro: Simplify and make the vary() function more clear
    
    Always use two arguments, so that it's obvious from the call sites that
    the first round contains an empty variation, instead of shuffling
    arguments around.
    
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 scripts/debrepro.sh | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/scripts/debrepro.sh b/scripts/debrepro.sh
index 400913b..38dd14f 100755
--- a/scripts/debrepro.sh
+++ b/scripts/debrepro.sh
@@ -38,11 +38,7 @@ variation() {
 
 vary() {
   local first="$1"
-  local second="${2:-}"
-  if [ -z "$second" ]; then
-    second="$first"
-    first=''
-  fi
+  local second="$2"
   if [ "$which_build" = 'first' ]; then
     if [ -n "$first" ]; then
       echo "$first"
@@ -63,7 +59,7 @@ create_build_script() {
   echo 'export SOURCE_DATE_EPOCH=$(date -d "$(dpkg-parsechangelog -SDate)" +%s)'
 
   variation PATH
-  vary 'export PATH="$PATH":/i/capture/the/path'
+  vary '' 'export PATH="$PATH":/i/capture/the/path'
 
   variation USER
   vary 'export USER=user1' 'export USER=user2'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list