소스 검색

support/download: print command used for download

Even though that most download commands actually print some output, like
progress indication or other messages, the actual command used is not. This
makes it hard to analyze a build log when you are not fully familiar with
the typical output of said log.

Update the download helpers to do just that, respecting any quiet/verbose
flag so that a silent make (make -s) does not get more verbose.

Note: getting rid of the duplication of the command in the script is not
straightforward without breaking support for arguments with spaces.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
[yann.morin.1998@free.fr: use printf, not echo]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Thomas De Schampheleire 4 년 전
부모
커밋
54d3d94b6e
8개의 변경된 파일24개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      support/download/bzr
  2. 3 0
      support/download/cvs
  3. 3 0
      support/download/file
  4. 3 0
      support/download/git
  5. 3 0
      support/download/hg
  6. 3 0
      support/download/scp
  7. 3 0
      support/download/svn
  8. 3 0
      support/download/wget

+ 3 - 0
support/download/bzr

@@ -34,6 +34,9 @@ shift $((OPTIND-1)) # Get rid of our options
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
 _bzr() {
+    if [ -z "${quiet}" ]; then
+        printf '%s ' ${BZR} "${@}"; printf '\n'
+    fi
     eval ${BZR} "${@}"
 }
 

+ 3 - 0
support/download/cvs

@@ -39,6 +39,9 @@ shift $((OPTIND-1)) # Get rid of our options
 # ). Since nobody sane will put large code bases in CVS, a timeout of
 # 10 minutes should do the trick.
 _cvs() {
+    if [ -z "${quiet}" ]; then
+        printf '%s ' timeout 10m ${CVS} "${@}"; printf '\n'
+    fi
     eval timeout 10m ${CVS} "${@}"
 }
 

+ 3 - 0
support/download/file

@@ -36,6 +36,9 @@ shift $((OPTIND-1)) # Get rid of our options
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
 _localfiles() {
+    if [ -n "${verbose}" ]; then
+        printf '%s ' ${LOCALFILES} "${@}"; printf '\n'
+    fi
     eval ${LOCALFILES} "${@}"
 }
 

+ 3 - 0
support/download/git

@@ -79,6 +79,9 @@ trap _on_error ERR
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
 _git() {
+    if [ -z "${quiet}" ]; then
+        printf '%s ' GIT_DIR="${git_cache}/.git" ${GIT} "${@}"; printf '\n'
+    fi
     eval GIT_DIR="${git_cache}/.git" ${GIT} "${@}"
 }
 

+ 3 - 0
support/download/hg

@@ -33,6 +33,9 @@ shift $((OPTIND-1)) # Get rid of our options
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
 _hg() {
+    if [ -z "${quiet}" ]; then
+        printf '%s ' ${HG} "${@}"; printf '\n'
+    fi
     eval ${HG} "${@}"
 }
 

+ 3 - 0
support/download/scp

@@ -31,6 +31,9 @@ shift $((OPTIND-1)) # Get rid of our options
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
 _scp() {
+    if [ -z "${quiet}" ]; then
+        printf '%s ' ${SCP} "${@}"; printf '\n'
+    fi
     eval ${SCP} "${@}"
 }
 

+ 3 - 0
support/download/svn

@@ -40,6 +40,9 @@ shift $((OPTIND-1)) # Get rid of our options
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
 _svn() {
+    if [ -z "${quiet}" ]; then
+        printf '%s ' ${SVN} "${@}"; printf '\n'
+    fi
     eval ${SVN} "${@}"
 }
 

+ 3 - 0
support/download/wget

@@ -33,6 +33,9 @@ shift $((OPTIND-1)) # Get rid of our options
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
 _wget() {
+    if [ -z "${quiet}" ]; then
+        printf '%s ' ${WGET} "${@}"; printf '\n'
+    fi
     eval ${WGET} "${@}"
 }