Bläddra i källkod

Remove unnecessary quotes and semicolons

Where not required, they only add visual cruft.
Alois Mahdal 7 år sedan
förälder
incheckning
3b35bb9513
6 ändrade filer med 25 tillägg och 25 borttagningar
  1. 7
    7
      src/include/build.sh
  2. 4
    4
      src/include/deploy.sh
  3. 3
    3
      src/include/facts.sh
  4. 8
    8
      src/include/ini.sh
  5. 1
    1
      src/include/mkit.sh
  6. 2
    2
      src/include/release.sh

+ 7
- 7
src/include/build.sh Visa fil

@@ -8,9 +8,9 @@ _build1() {
8 8
     #
9 9
     # Process one skeleton
10 10
     #
11
-    local srcpath="$1"
12
-    local dstpath="$2"
13
-    local ftype="$3"
11
+    local srcpath=$1
12
+    local dstpath=$2
13
+    local ftype=$3
14 14
     test -n "$dstpath"  || dstpath=${srcpath%.skel}
15 15
     test -n "$ftype"    || ftype=$(_guess_ftype "$dstpath")
16 16
     debug_var srcpath dstpath ftype
@@ -23,7 +23,7 @@ _build1_ftype() {
23 23
     #
24 24
     # Build a file of type $1
25 25
     #
26
-    local ftype="$1"
26
+    local ftype=$1
27 27
     case $ftype in
28 28
         MKIT_COMMON)    _expand_tokens "tokens" ;;
29 29
         markdown)       _expand_includes | _expand_tokens "tokens" ;;
@@ -93,7 +93,7 @@ _guess_ftype() {
93 93
     #
94 94
     # Guess file type from destination path $1
95 95
     #
96
-    local dstpath="$1"
96
+    local dstpath=$1
97 97
     case $dstpath in
98 98
         *.md) echo markdown    ;;
99 99
         *)    echo MKIT_COMMON ;;
@@ -209,8 +209,8 @@ rpmstuff() {
209 209
     #
210 210
     # Build specfile
211 211
     #
212
-    local specname="$MKIT_PROJ_PKGNAME.spec"
213
-    local specsrc="$(ini 1value "dist:rpmstuff")"
212
+    local specname=$MKIT_PROJ_PKGNAME.spec
213
+    local specsrc=$(ini 1value "dist:rpmstuff")
214 214
     test -n "$specsrc" || die "dist:rpmstuff not specified"
215 215
     test -f "$specsrc" || die "specfile template not found: $specsrc"
216 216
     _build1 "$specsrc" "$specname"

+ 4
- 4
src/include/deploy.sh Visa fil

@@ -23,9 +23,9 @@ _deploy_item() {
23 23
     # Directories are copied recursively, and mode is
24 24
     # applied only to files.
25 25
     #
26
-    local src="$1"
27
-    local dst="$2"
28
-    local mode="${3:-$MKIT_DEFAULT_MODE}"
26
+    local src=$1
27
+    local dst=$2
28
+    local mode=${3:-$MKIT_DEFAULT_MODE}
29 29
     if test -d "$src";
30 30
     then
31 31
         _maybe mkdir -vp "$(dirname "$dst")"
@@ -55,7 +55,7 @@ _get_root() {
55 55
     #
56 56
     # Find out target root for group $1
57 57
     #
58
-    local grp="$1"
58
+    local grp=$1
59 59
     local root=$(ini 1value "roots:$grp")
60 60
     local destdir=$(ini 1value ENV:DESTDIR)
61 61
     destdir=${destdir%/}

+ 3
- 3
src/include/facts.sh Visa fil

@@ -6,7 +6,7 @@ git_bool() {
6 6
     #
7 7
     # Get git bool (ie. exit status counts) $1
8 8
     #
9
-    local bool_name="$1"
9
+    local bool_name=$1
10 10
     git_present || warn "can't give bool outside git repo: $bool_name"
11 11
     case "$bool_name" in
12 12
         dirty_files)
@@ -29,7 +29,7 @@ git_fact() {
29 29
     #
30 30
     # Get git fact $1
31 31
     #
32
-    local fact_name="$1"
32
+    local fact_name=$1
33 33
     git_present || warn "can't give fact outside git repo: $fact_name"
34 34
     case "$fact_name" in
35 35
         latest_tag)
@@ -165,7 +165,7 @@ semver() {
165 165
             0:)  suffix="+dirty"         ;;
166 166
             1:*) suffix="+$commit"       ;;
167 167
             0:*) suffix="+$commit.dirty" ;;
168
-            *)   suffix=MKIT_BUG;
168
+            *)   suffix=MKIT_BUG
169 169
                  warn "MKIT_BUG: bad dirt/commit detection" ;;
170 170
         esac
171 171
         test -n "$prerl" && suffix="-$prerl$suffix"

+ 8
- 8
src/include/ini.sh Visa fil

@@ -48,12 +48,12 @@ _ini_greppath() {
48 48
     #     [files:share]
49 49
     #         my/lib.sh   = proj/my/lib.sh
50 50
     #
51
-    local wnt="$1"
52
-    local wntkey="${wnt##*:}"
53
-    local wntsec="${wnt%:$wntkey}"
51
+    local wnt=$1
52
+    local wntkey=${wnt##*:}
53
+    local wntsec=${wnt%:$wntkey}
54 54
     if test "$wntsec" = 'ENV';
55 55
     then
56
-        local override="${!wntkey}"
56
+        local override=${!wntkey}
57 57
         if test -n "$override";
58 58
         then
59 59
             echo "$override"
@@ -67,7 +67,7 @@ _ini_grepsec() {
67 67
     #
68 68
     # Read one INI section
69 69
     #
70
-    local wnt="$1"
70
+    local wnt=$1
71 71
     local ok=false
72 72
     grep '.' \
73 73
       | grep -v '\s*#' \
@@ -87,7 +87,7 @@ _ini_lskeys() {
87 87
     #
88 88
     # List keys from a section
89 89
     #
90
-    local sct="$1"
90
+    local sct=$1
91 91
     _ini_grepsec "$sct" | cut -d= -f1 | sort | uniq
92 92
 }
93 93
 
@@ -125,8 +125,8 @@ update_version() {
125 125
     #
126 126
     # Change project.version in mkit.ini at path $2 to version $1
127 127
     #
128
-    local version="$1"
129
-    local inifile="$2"
128
+    local version=$1
129
+    local inifile=$2
130 130
     local tmp=$(mktemp -t mkit.update_version.XXXXXXXX)
131 131
     <"$inifile" perl -e '
132 132
         my $hit = 0;

+ 1
- 1
src/include/mkit.sh Visa fil

@@ -66,7 +66,7 @@ _compver() {
66 66
     # the x.  Fragments must equal.
67 67
     #
68 68
     local their_ver our_x our_y their_x their_y
69
-    their_ver="$1"
69
+    their_ver=$1
70 70
     their_x=${their_ver%%.*}
71 71
     their_y=${their_ver##$their_x.}
72 72
     their_y=${their_y%%.*}

+ 2
- 2
src/include/release.sh Visa fil

@@ -28,7 +28,7 @@ _relck() {
28 28
     #
29 29
     # Die if blocking condition $1 is detected
30 30
     #
31
-    local condition="$1"
31
+    local condition=$1
32 32
     local x
33 33
     case "$condition" in
34 34
         git_present)
@@ -127,7 +127,7 @@ _release_msg() {
127 127
 }
128 128
 
129 129
 _vbump() {
130
-    local rlevel="$1"
130
+    local rlevel=$1
131 131
     local nextver   # after the bump
132 132
     _relck git_present
133 133
     _relck at_relsrc