* [Buildroot] [PATCH v7 0/4] Improve silent builds
@ 2014-12-30 13:58 Fabio Porcedda
2014-12-30 13:58 ` [Buildroot] [PATCH v7 1/4] Makefile: improve detection of make "-s" flag Fabio Porcedda
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Fabio Porcedda @ 2014-12-30 13:58 UTC (permalink / raw)
To: buildroot
This patch set improves silent builds.
Silent builds are also nice when top-level parallel make is being used
to reduce the output clutter.
After this patch set is accepted I will prepare a patch set to convert
the other helpers (scp wget hg) to use the quiet flag instead of the
environment variable.
The rest of the change logs are in each patch.
v6:
- Remove the patch that renames QUIET to BR_QUIET
Fabio Porcedda (4):
Makefile: improve detection of make "-s" flag
pkg-download: silence check-hash if it is a silent build
support/download: silence svn if it is a silent build
support/download: silence git if it is a silent build
Makefile | 2 +-
package/pkg-download.mk | 8 ++++++++
support/download/check-hash | 22 ++++++++++++++++++++--
support/download/dl-wrapper | 15 ++++++++++-----
support/download/git | 30 +++++++++++++++++++++++++-----
support/download/svn | 20 ++++++++++++++++++--
6 files changed, 82 insertions(+), 15 deletions(-)
--
2.1.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 1/4] Makefile: improve detection of make "-s" flag
2014-12-30 13:58 [Buildroot] [PATCH v7 0/4] Improve silent builds Fabio Porcedda
@ 2014-12-30 13:58 ` Fabio Porcedda
2015-01-01 16:03 ` Yann E. MORIN
2014-12-30 13:58 ` [Buildroot] [PATCH v7 2/4] pkg-download: silence check-hash if it is a silent build Fabio Porcedda
` (3 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Fabio Porcedda @ 2014-12-30 13:58 UTC (permalink / raw)
To: buildroot
Because it's just checked the presence of the "s" character even a
make --warn-undefined-variables
is detected as a silent build so fix this by filtering out long options.
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
---
Notes:
v6:
- use QUIET instead of BR_QUIET
v5:
- remove spaces after commas (Yann)
v4:
- split this patch from the patch set to send to muster as bugfix
v2:
- remove spurious space at the beginning of the QUIET variable (Arnout)
v4:
- split this patch from the patch set to send to muster as bugfix
v2:
- remove spurious space at the beginning of the QUIET variable (Arnout)
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index e18a87e..c033620 100644
--- a/Makefile
+++ b/Makefile
@@ -303,7 +303,7 @@ GNU_HOST_NAME := $(shell support/gnuconfig/config.guess)
TARGETS :=
# silent mode requested?
-QUIET := $(if $(findstring s,$(MAKEFLAGS)),-q)
+QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q)
# Strip off the annoying quoting
ARCH := $(call qstrip,$(BR2_ARCH))
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 2/4] pkg-download: silence check-hash if it is a silent build
2014-12-30 13:58 [Buildroot] [PATCH v7 0/4] Improve silent builds Fabio Porcedda
2014-12-30 13:58 ` [Buildroot] [PATCH v7 1/4] Makefile: improve detection of make "-s" flag Fabio Porcedda
@ 2014-12-30 13:58 ` Fabio Porcedda
2015-01-01 16:16 ` Yann E. MORIN
2015-01-01 16:24 ` Yann E. MORIN
2014-12-30 13:58 ` [Buildroot] [PATCH v7 3/4] support/download: silence svn " Fabio Porcedda
` (2 subsequent siblings)
4 siblings, 2 replies; 9+ messages in thread
From: Fabio Porcedda @ 2014-12-30 13:58 UTC (permalink / raw)
To: buildroot
If it is a silent build (make -s -> QUIET=-q) silence the "check-hash"
script.
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
---
Notes:
v7:
- Add this patch
package/pkg-download.mk | 8 ++++++++
support/download/check-hash | 22 ++++++++++++++++++++--
support/download/dl-wrapper | 9 +++++----
3 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/package/pkg-download.mk b/package/pkg-download.mk
index ba72fc1..9c782fe 100644
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -88,6 +88,7 @@ define DOWNLOAD_GIT
$(EXTRA_ENV) $(DL_WRAPPER) -b git \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
$($(PKG)_SITE) \
$($(PKG)_DL_VERSION) \
@@ -109,6 +110,7 @@ define DOWNLOAD_BZR
$(EXTRA_ENV) $(DL_WRAPPER) -b bzr \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
$($(PKG)_SITE) \
$($(PKG)_DL_VERSION) \
@@ -127,6 +129,7 @@ define DOWNLOAD_CVS
$(EXTRA_ENV) $(DL_WRAPPER) -b cvs \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) \
$($(PKG)_DL_VERSION) \
@@ -147,6 +150,7 @@ define DOWNLOAD_SVN
$(EXTRA_ENV) $(DL_WRAPPER) -b svn \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
$($(PKG)_SITE) \
$($(PKG)_DL_VERSION) \
@@ -168,6 +172,7 @@ define DOWNLOAD_SCP
$(EXTRA_ENV) $(DL_WRAPPER) -b scp \
-o $(DL_DIR)/$(2) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
'$(call stripurischeme,$(call qstrip,$(1)))'
endef
@@ -185,6 +190,7 @@ define DOWNLOAD_HG
$(EXTRA_ENV) $(DL_WRAPPER) -b hg \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
$($(PKG)_SITE) \
$($(PKG)_DL_VERSION) \
@@ -206,6 +212,7 @@ define DOWNLOAD_WGET
$(EXTRA_ENV) $(DL_WRAPPER) -b wget \
-o $(DL_DIR)/$(2) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
'$(call qstrip,$(1))'
endef
@@ -222,6 +229,7 @@ define DOWNLOAD_LOCALFILES
$(EXTRA_ENV) $(DL_WRAPPER) -b cp \
-o $(DL_DIR)/$(2) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
$(call stripurischeme,$(call qstrip,$(1)))
endef
diff --git a/support/download/check-hash b/support/download/check-hash
index b59fd2a..82f2e65 100755
--- a/support/download/check-hash
+++ b/support/download/check-hash
@@ -2,7 +2,10 @@
set -e
# Helper to check a file matches its known hash
-# Call it with:
+#
+# Optional arguments:
+# "-q": quiet flag
+# Required arguments:
# $1: the path of the file containing all the the expected hashes
# $2: the full path to the temporary file that was downloaded, and
# that is to be checked
@@ -10,6 +13,19 @@ set -e
# saved as, to be able to match it to the corresponding hashes
# in the .hash file
+quiet=
+while getopts "q" opt; do
+ case $opt in
+ q)
+ quiet=-q
+ ;;
+ \?)
+ exit 1
+ ;;
+ esac
+done
+shift $((OPTIND-1))
+
h_file="${1}"
file="${2}"
base="${3}"
@@ -43,7 +59,9 @@ check_one_hash() {
# Do the hashes match?
_hash=$( ${_h}sum "${_file}" |cut -d ' ' -f 1 )
if [ "${_hash}" = "${_known}" ]; then
- printf "%s: OK (%s: %s)\n" "${base}" "${_h}" "${_hash}"
+ if [ -z "${quiet}" ]; then
+ printf "%s: OK (%s: %s)\n" "${base}" "${_h}" "${_hash}"
+ fi
return 0
fi
diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
index cced8f6..337fc48 100755
--- a/support/download/dl-wrapper
+++ b/support/download/dl-wrapper
@@ -21,15 +21,16 @@ set -e
main() {
local OPT OPTARG
- local backend output hfile
+ local backend output hfile quiet
# Parse our options; anything after '--' is for the backend
- while getopts :hb:o:H: OPT; do
+ while getopts :hb:o:H:q OPT; do
case "${OPT}" in
h) help; exit 0;;
b) backend="${OPTARG}";;
o) output="${OPTARG}";;
H) hfile="${OPTARG}";;
+ q) quiet="-q";;
:) error "option '%s' expects a mandatory argument\n" "${OPTARG}";;
\?) error "unknown option '%s'\n" "${OPTARG}";;
esac
@@ -49,7 +50,7 @@ main() {
# If the output file already exists, do not download it again
if [ -e "${output}" ]; then
- if support/download/check-hash "${hfile}" "${output}" "${output##*/}"; then
+ if support/download/check-hash ${quiet} "${hfile}" "${output}" "${output##*/}"; then
exit 0
fi
rm -f "${output}"
@@ -85,7 +86,7 @@ main() {
# Check if the downloaded file is sane, and matches the stored hashes
# for that file
- if ! support/download/check-hash "${hfile}" "${tmpf}" "${output##*/}"; then
+ if ! support/download/check-hash ${quiet} "${hfile}" "${tmpf}" "${output##*/}"; then
rm -rf "${tmpd}"
exit 1
fi
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 3/4] support/download: silence svn if it is a silent build
2014-12-30 13:58 [Buildroot] [PATCH v7 0/4] Improve silent builds Fabio Porcedda
2014-12-30 13:58 ` [Buildroot] [PATCH v7 1/4] Makefile: improve detection of make "-s" flag Fabio Porcedda
2014-12-30 13:58 ` [Buildroot] [PATCH v7 2/4] pkg-download: silence check-hash if it is a silent build Fabio Porcedda
@ 2014-12-30 13:58 ` Fabio Porcedda
2014-12-30 13:58 ` [Buildroot] [PATCH v7 4/4] support/download: silence git " Fabio Porcedda
2015-01-01 16:52 ` [Buildroot] [PATCH v7 0/4] Improve silent builds Yann E. MORIN
4 siblings, 0 replies; 9+ messages in thread
From: Fabio Porcedda @ 2014-12-30 13:58 UTC (permalink / raw)
To: buildroot
If it is a silent build (make -s -> QUIET=-q) silence the svn download
helper using "svn -q" just like others download helpers, e.g. wget.
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
---
Notes:
v7:
- use "backend_quiet" instead of "quiet" in the dl-wrapper
v6:
- Use QUIET instead of BR_QUIET
v5:
- Use getopts
v4:
- Instead of changing the "SVN" variable pass the "-q" option to the
download helper (Thomas P.)
v3:
- Add this patch
support/download/dl-wrapper | 8 ++++++--
support/download/svn | 20 ++++++++++++++++++--
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
index 337fc48..e9002fb 100755
--- a/support/download/dl-wrapper
+++ b/support/download/dl-wrapper
@@ -21,7 +21,7 @@ set -e
main() {
local OPT OPTARG
- local backend output hfile quiet
+ local backend output hfile quiet backend_quiet
# Parse our options; anything after '--' is for the backend
while getopts :hb:o:H:q OPT; do
@@ -48,6 +48,10 @@ main() {
error "no hash-file specified, use -H\n"
fi
+ if [ "${backend}" == "svn" ]; then
+ backend_quiet=${quiet}
+ fi
+
# If the output file already exists, do not download it again
if [ -e "${output}" ]; then
if support/download/check-hash ${quiet} "${hfile}" "${output}" "${output##*/}"; then
@@ -76,7 +80,7 @@ main() {
# If the backend fails, we can just remove the temporary directory to
# remove all the cruft it may have left behind. Then we just exit in
# error too.
- if ! "${OLDPWD}/support/download/${backend}" "${tmpf}" "${@}"; then
+ if ! "${OLDPWD}/support/download/${backend}" ${backend_quiet} "${tmpf}" "${@}"; then
rm -rf "${tmpd}"
exit 1
fi
diff --git a/support/download/svn b/support/download/svn
index a960f7d..4873219 100755
--- a/support/download/svn
+++ b/support/download/svn
@@ -4,7 +4,10 @@
set -e
# Download helper for svn, to be called from the download wrapper script
-# Expected arguments:
+#
+# Optional arguments:
+# "-q": quiet flag
+# Required arguments:
# $1: output file
# $2: svn repo
# $3: svn revision
@@ -12,11 +15,24 @@ set -e
# And this environment:
# SVN : the svn command to call
+quiet=
+while getopts "q" opt; do
+ case $opt in
+ q)
+ quiet=-q
+ ;;
+ \?)
+ exit 1
+ ;;
+ esac
+done
+shift $((OPTIND-1))
+
output="${1}"
repo="${2}"
rev="${3}"
basename="${4}"
-${SVN} export "${repo}@${rev}" "${basename}"
+${SVN} ${quiet} export "${repo}@${rev}" "${basename}"
tar czf "${output}" "${basename}"
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 4/4] support/download: silence git if it is a silent build
2014-12-30 13:58 [Buildroot] [PATCH v7 0/4] Improve silent builds Fabio Porcedda
` (2 preceding siblings ...)
2014-12-30 13:58 ` [Buildroot] [PATCH v7 3/4] support/download: silence svn " Fabio Porcedda
@ 2014-12-30 13:58 ` Fabio Porcedda
2015-01-01 16:52 ` [Buildroot] [PATCH v7 0/4] Improve silent builds Yann E. MORIN
4 siblings, 0 replies; 9+ messages in thread
From: Fabio Porcedda @ 2014-12-30 13:58 UTC (permalink / raw)
To: buildroot
If it is a silent build (make -s -> QUIET=-q) silence the git download
helper using "git clone -q" just like others download helpers,
e.g. wget.
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
---
Notes:
Notes:
v7:
- Use "backend_quiet" instead of "quiet" in the dl-wrapper
v6:
- Use QUIET instead of BR_QUIET
v5:
- Use getopts
v3:
- Add this patch
support/download/dl-wrapper | 2 +-
support/download/git | 30 +++++++++++++++++++++++++-----
2 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
index e9002fb..5850a1d 100755
--- a/support/download/dl-wrapper
+++ b/support/download/dl-wrapper
@@ -48,7 +48,7 @@ main() {
error "no hash-file specified, use -H\n"
fi
- if [ "${backend}" == "svn" ]; then
+ if [ "${backend}" == "git" -o "${backend}" == "svn" ]; then
backend_quiet=${quiet}
fi
diff --git a/support/download/git b/support/download/git
index 5d36ca4..f068c63 100755
--- a/support/download/git
+++ b/support/download/git
@@ -4,7 +4,10 @@
set -e
# Download helper for git, to be called from the download wrapper script
-# Expected arguments:
+#
+# Optional arguments:
+# "-q": quiet flag
+# Required arguments:
# $1: output file
# $2: git repo
# $3: git cset
@@ -12,6 +15,19 @@ set -e
# And this environment:
# GIT : the git command to call
+quiet=
+while getopts "q" opt; do
+ case $opt in
+ q)
+ quiet=-q
+ ;;
+ \?)
+ exit 1
+ ;;
+ esac
+done
+shift $((OPTIND-1))
+
output="${1}"
repo="${2}"
cset="${3}"
@@ -21,16 +37,20 @@ basename="${4}"
# than a full clone.
git_done=0
if [ -n "$(${GIT} ls-remote "${repo}" "${cset}" 2>&1)" ]; then
- printf "Doing shallow clone\n"
- if ${GIT} clone --depth 1 -b "${cset}" --bare "${repo}" "${basename}"; then
+ if [ -z "${quiet}" ]; then
+ printf "Doing shallow clone\n";
+ fi
+ if ${GIT} clone ${quiet} --depth 1 -b "${cset}" --bare "${repo}" "${basename}"; then
git_done=1
else
printf "Shallow clone failed, falling back to doing a full clone\n"
fi
fi
if [ ${git_done} -eq 0 ]; then
- printf "Doing full clone\n"
- ${GIT} clone --bare "${repo}" "${basename}"
+ if [ -z "${quiet}" ]; then
+ printf "Doing full clone\n";
+ fi
+ ${GIT} clone ${quiet} --bare "${repo}" "${basename}"
fi
GIT_DIR="${basename}" \
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 1/4] Makefile: improve detection of make "-s" flag
2014-12-30 13:58 ` [Buildroot] [PATCH v7 1/4] Makefile: improve detection of make "-s" flag Fabio Porcedda
@ 2015-01-01 16:03 ` Yann E. MORIN
0 siblings, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2015-01-01 16:03 UTC (permalink / raw)
To: buildroot
Fabio, All,
On 2014-12-30 14:58 +0100, Fabio Porcedda spake thusly:
> Because it's just checked the presence of the "s" character even a
> make --warn-undefined-variables
> is detected as a silent build so fix this by filtering out long options.
>
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> Cc: Arnout Vandecappelle <arnout@mind.be>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Regards,
Yann E. MORIN.
> ---
>
> Notes:
> v6:
> - use QUIET instead of BR_QUIET
> v5:
> - remove spaces after commas (Yann)
> v4:
> - split this patch from the patch set to send to muster as bugfix
> v2:
> - remove spurious space at the beginning of the QUIET variable (Arnout)
> v4:
> - split this patch from the patch set to send to muster as bugfix
> v2:
> - remove spurious space at the beginning of the QUIET variable (Arnout)
>
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index e18a87e..c033620 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -303,7 +303,7 @@ GNU_HOST_NAME := $(shell support/gnuconfig/config.guess)
> TARGETS :=
>
> # silent mode requested?
> -QUIET := $(if $(findstring s,$(MAKEFLAGS)),-q)
> +QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q)
>
> # Strip off the annoying quoting
> ARCH := $(call qstrip,$(BR2_ARCH))
> --
> 2.1.0
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 2/4] pkg-download: silence check-hash if it is a silent build
2014-12-30 13:58 ` [Buildroot] [PATCH v7 2/4] pkg-download: silence check-hash if it is a silent build Fabio Porcedda
@ 2015-01-01 16:16 ` Yann E. MORIN
2015-01-01 16:24 ` Yann E. MORIN
1 sibling, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2015-01-01 16:16 UTC (permalink / raw)
To: buildroot
Fabio, All,
On 2014-12-30 14:58 +0100, Fabio Porcedda spake thusly:
> If it is a silent build (make -s -> QUIET=-q) silence the "check-hash"
> script.
>
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[tested by downloading busybox + a toolchain, then tweaking busybox' hash
to ensure a failed check was still visible]
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Regards,
Yann E. MORIN.
> ---
>
> Notes:
> v7:
> - Add this patch
>
> package/pkg-download.mk | 8 ++++++++
> support/download/check-hash | 22 ++++++++++++++++++++--
> support/download/dl-wrapper | 9 +++++----
> 3 files changed, 33 insertions(+), 6 deletions(-)
>
> diff --git a/package/pkg-download.mk b/package/pkg-download.mk
> index ba72fc1..9c782fe 100644
> --- a/package/pkg-download.mk
> +++ b/package/pkg-download.mk
> @@ -88,6 +88,7 @@ define DOWNLOAD_GIT
> $(EXTRA_ENV) $(DL_WRAPPER) -b git \
> -o $(DL_DIR)/$($(PKG)_SOURCE) \
> -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
> + $(QUIET) \
> -- \
> $($(PKG)_SITE) \
> $($(PKG)_DL_VERSION) \
> @@ -109,6 +110,7 @@ define DOWNLOAD_BZR
> $(EXTRA_ENV) $(DL_WRAPPER) -b bzr \
> -o $(DL_DIR)/$($(PKG)_SOURCE) \
> -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
> + $(QUIET) \
> -- \
> $($(PKG)_SITE) \
> $($(PKG)_DL_VERSION) \
> @@ -127,6 +129,7 @@ define DOWNLOAD_CVS
> $(EXTRA_ENV) $(DL_WRAPPER) -b cvs \
> -o $(DL_DIR)/$($(PKG)_SOURCE) \
> -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
> + $(QUIET) \
> -- \
> $(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) \
> $($(PKG)_DL_VERSION) \
> @@ -147,6 +150,7 @@ define DOWNLOAD_SVN
> $(EXTRA_ENV) $(DL_WRAPPER) -b svn \
> -o $(DL_DIR)/$($(PKG)_SOURCE) \
> -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
> + $(QUIET) \
> -- \
> $($(PKG)_SITE) \
> $($(PKG)_DL_VERSION) \
> @@ -168,6 +172,7 @@ define DOWNLOAD_SCP
> $(EXTRA_ENV) $(DL_WRAPPER) -b scp \
> -o $(DL_DIR)/$(2) \
> -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
> + $(QUIET) \
> -- \
> '$(call stripurischeme,$(call qstrip,$(1)))'
> endef
> @@ -185,6 +190,7 @@ define DOWNLOAD_HG
> $(EXTRA_ENV) $(DL_WRAPPER) -b hg \
> -o $(DL_DIR)/$($(PKG)_SOURCE) \
> -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
> + $(QUIET) \
> -- \
> $($(PKG)_SITE) \
> $($(PKG)_DL_VERSION) \
> @@ -206,6 +212,7 @@ define DOWNLOAD_WGET
> $(EXTRA_ENV) $(DL_WRAPPER) -b wget \
> -o $(DL_DIR)/$(2) \
> -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
> + $(QUIET) \
> -- \
> '$(call qstrip,$(1))'
> endef
> @@ -222,6 +229,7 @@ define DOWNLOAD_LOCALFILES
> $(EXTRA_ENV) $(DL_WRAPPER) -b cp \
> -o $(DL_DIR)/$(2) \
> -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
> + $(QUIET) \
> -- \
> $(call stripurischeme,$(call qstrip,$(1)))
> endef
> diff --git a/support/download/check-hash b/support/download/check-hash
> index b59fd2a..82f2e65 100755
> --- a/support/download/check-hash
> +++ b/support/download/check-hash
> @@ -2,7 +2,10 @@
> set -e
>
> # Helper to check a file matches its known hash
> -# Call it with:
> +#
> +# Optional arguments:
> +# "-q": quiet flag
> +# Required arguments:
> # $1: the path of the file containing all the the expected hashes
> # $2: the full path to the temporary file that was downloaded, and
> # that is to be checked
> @@ -10,6 +13,19 @@ set -e
> # saved as, to be able to match it to the corresponding hashes
> # in the .hash file
>
> +quiet=
> +while getopts "q" opt; do
> + case $opt in
> + q)
> + quiet=-q
> + ;;
> + \?)
> + exit 1
> + ;;
> + esac
> +done
> +shift $((OPTIND-1))
> +
> h_file="${1}"
> file="${2}"
> base="${3}"
> @@ -43,7 +59,9 @@ check_one_hash() {
> # Do the hashes match?
> _hash=$( ${_h}sum "${_file}" |cut -d ' ' -f 1 )
> if [ "${_hash}" = "${_known}" ]; then
> - printf "%s: OK (%s: %s)\n" "${base}" "${_h}" "${_hash}"
> + if [ -z "${quiet}" ]; then
> + printf "%s: OK (%s: %s)\n" "${base}" "${_h}" "${_hash}"
> + fi
> return 0
> fi
>
> diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
> index cced8f6..337fc48 100755
> --- a/support/download/dl-wrapper
> +++ b/support/download/dl-wrapper
> @@ -21,15 +21,16 @@ set -e
>
> main() {
> local OPT OPTARG
> - local backend output hfile
> + local backend output hfile quiet
>
> # Parse our options; anything after '--' is for the backend
> - while getopts :hb:o:H: OPT; do
> + while getopts :hb:o:H:q OPT; do
> case "${OPT}" in
> h) help; exit 0;;
> b) backend="${OPTARG}";;
> o) output="${OPTARG}";;
> H) hfile="${OPTARG}";;
> + q) quiet="-q";;
> :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";;
> \?) error "unknown option '%s'\n" "${OPTARG}";;
> esac
> @@ -49,7 +50,7 @@ main() {
>
> # If the output file already exists, do not download it again
> if [ -e "${output}" ]; then
> - if support/download/check-hash "${hfile}" "${output}" "${output##*/}"; then
> + if support/download/check-hash ${quiet} "${hfile}" "${output}" "${output##*/}"; then
> exit 0
> fi
> rm -f "${output}"
> @@ -85,7 +86,7 @@ main() {
>
> # Check if the downloaded file is sane, and matches the stored hashes
> # for that file
> - if ! support/download/check-hash "${hfile}" "${tmpf}" "${output##*/}"; then
> + if ! support/download/check-hash ${quiet} "${hfile}" "${tmpf}" "${output##*/}"; then
> rm -rf "${tmpd}"
> exit 1
> fi
> --
> 2.1.0
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 2/4] pkg-download: silence check-hash if it is a silent build
2014-12-30 13:58 ` [Buildroot] [PATCH v7 2/4] pkg-download: silence check-hash if it is a silent build Fabio Porcedda
2015-01-01 16:16 ` Yann E. MORIN
@ 2015-01-01 16:24 ` Yann E. MORIN
1 sibling, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2015-01-01 16:24 UTC (permalink / raw)
To: buildroot
Fabio, All,
On 2014-12-30 14:58 +0100, Fabio Porcedda spake thusly:
> If it is a silent build (make -s -> QUIET=-q) silence the "check-hash"
> script.
>
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Even though I acked it earlier, I missed something...
Sorry... :-(
> diff --git a/support/download/check-hash b/support/download/check-hash
> index b59fd2a..82f2e65 100755
> --- a/support/download/check-hash
> +++ b/support/download/check-hash
> @@ -10,6 +13,19 @@ set -e
> # saved as, to be able to match it to the corresponding hashes
> # in the .hash file
>
> +quiet=
> +while getopts "q" opt; do
> + case $opt in
> + q)
> + quiet=-q
> + ;;
> + \?)
> + exit 1
> + ;;
> + esac
This script does not use TABs, so do not introduce any.
> +done
> +shift $((OPTIND-1))
> +
> h_file="${1}"
> file="${2}"
> base="${3}"
> @@ -43,7 +59,9 @@ check_one_hash() {
> # Do the hashes match?
> _hash=$( ${_h}sum "${_file}" |cut -d ' ' -f 1 )
> if [ "${_hash}" = "${_known}" ]; then
> - printf "%s: OK (%s: %s)\n" "${base}" "${_h}" "${_hash}"
> + if [ -z "${quiet}" ]; then
> + printf "%s: OK (%s: %s)\n" "${base}" "${_h}" "${_hash}"
> + fi
Ditto, do not introduce TABs.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v7 0/4] Improve silent builds
2014-12-30 13:58 [Buildroot] [PATCH v7 0/4] Improve silent builds Fabio Porcedda
` (3 preceding siblings ...)
2014-12-30 13:58 ` [Buildroot] [PATCH v7 4/4] support/download: silence git " Fabio Porcedda
@ 2015-01-01 16:52 ` Yann E. MORIN
4 siblings, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2015-01-01 16:52 UTC (permalink / raw)
To: buildroot
Fabio, All,
On 2014-12-30 14:58 +0100, Fabio Porcedda spake thusly:
> This patch set improves silent builds.
I've sent an updated, my simpler solution:
http://patchwork.ozlabs.org/patch/424892/
http://patchwork.ozlabs.org/patch/424893/
> After this patch set is accepted I will prepare a patch set to convert
> the other helpers (scp wget hg) to use the quiet flag instead of the
> environment variable.
Well, with this new solution, that will no longer be needed.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-01-01 16:52 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-30 13:58 [Buildroot] [PATCH v7 0/4] Improve silent builds Fabio Porcedda
2014-12-30 13:58 ` [Buildroot] [PATCH v7 1/4] Makefile: improve detection of make "-s" flag Fabio Porcedda
2015-01-01 16:03 ` Yann E. MORIN
2014-12-30 13:58 ` [Buildroot] [PATCH v7 2/4] pkg-download: silence check-hash if it is a silent build Fabio Porcedda
2015-01-01 16:16 ` Yann E. MORIN
2015-01-01 16:24 ` Yann E. MORIN
2014-12-30 13:58 ` [Buildroot] [PATCH v7 3/4] support/download: silence svn " Fabio Porcedda
2014-12-30 13:58 ` [Buildroot] [PATCH v7 4/4] support/download: silence git " Fabio Porcedda
2015-01-01 16:52 ` [Buildroot] [PATCH v7 0/4] Improve silent builds Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox