[tor-bugs] #28012 [Core Tor/Tor]: shellcheck: updateRustDependencies.sh issues

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Oct 11 17:09:23 UTC 2018


#28012: shellcheck: updateRustDependencies.sh issues
------------------------------+--------------------
     Reporter:  rl1987        |      Owner:  (none)
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------
 Shellcheck (​​​​​​https://github.com/koalaman/shellcheck) finds the
 following issues:

 {{{


 In updateRustDependencies.sh line 23:
 HERE=`dirname $(realpath $0)`
      ^-- SC2006: Use $(..) instead of legacy `..`.
               ^-- SC2046: Quote this to prevent word splitting.
                          ^-- SC2086: Double quote to prevent globbing and
 word splitting.


 In updateRustDependencies.sh line 24:
 TOPLEVEL=`dirname $(dirname $HERE)`
          ^-- SC2006: Use $(..) instead of legacy `..`.
                   ^-- SC2046: Quote this to prevent word splitting.
                             ^-- SC2086: Double quote to prevent globbing
 and word splitting.


 In updateRustDependencies.sh line 27:
 CARGO=`which cargo`
       ^-- SC2006: Use $(..) instead of legacy `..`.
        ^-- SC2230: which is non-standard. Use builtin 'command -v'
 instead.


 In updateRustDependencies.sh line 30:
     printf "Error: Couldn't find workspace Cargo.toml in expected
 location: %s\n" "$TOML"
 ^-- SC1117: Backslash is literal in "\n". Prefer explicit escaping: "\\n".


 In updateRustDependencies.sh line 34:
     printf "Error: Couldn't find directory for Rust dependencies! Expected
 location: %s\n" "$VENDORED"
 ^-- SC1117: Backslash is literal in "\n". Prefer explicit escaping: "\\n".


 In updateRustDependencies.sh line 38:
     printf "Error: cargo must be installed and in your \$PATH\n"
                                                              ^-- SC1117:
 Backslash is literal in "\n". Prefer explicit escaping: "\\n".


 In updateRustDependencies.sh line 41:
 if test -z `cargo --list | grep vendor` ; then
            ^-- SC2046: Quote this to prevent word splitting.
            ^-- SC2006: Use $(..) instead of legacy `..`.


 In updateRustDependencies.sh line 42:
     printf "Error: cargo-vendor not installed\n"
                                              ^-- SC1117: Backslash is
 literal in "\n". Prefer explicit escaping: "\\n".


 In updateRustDependencies.sh line 45:
 $CARGO vendor -v --locked --explicit-version --no-delete --sync $TOML
 $VENDORED
                                                                 ^--
 SC2086: Double quote to prevent globbing and word splitting.
                                                                       ^--
 SC2086: Double quote to prevent globbing and word splitting.

 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/28012>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list