Skip to contentSkip to conversation

Improve silent builds

PATCH Superseded Fabio Porcedda 3 participants 13 messages Nov 6, 2014 – Nov 24, 2014 Kbuild

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v3 cover Improve silent builds

This patch set improves silent builds.

Silent builds are nice when top-level parallel make is being used to reduce the output clutter.

The change logs are in each patch.

Best regards
Fabio Porcedda (3):
Makefile: improve detection of make "-s" flag
pkg-download: silence the svn download helper if it is a silent build support/download: silence git if it is a silence build

 Makefile                |  2 +-
 package/pkg-download.mk |  5 +++--
 support/download/git    | 14 ++++++++++----
 3 files changed, 14 insertions(+), 7 deletions(-)
Signature · 1 line
2.1.3
#1 lore raw

PATCH v3 1/3 Makefile: improve detection of make "-s" flag

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.

Cc Arnout Vandecappelle <[email protected]>

---

Notes:
v2:
- remove spurious space at the beginning of the QUIET variable (Arnout)

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 907a0fc..19997c7 100644
@@ -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))
Signature · 1 line
2.1.3
#2 lore raw

PATCH v3 2/3 pkg-download: silence the svn download helper if it is a silent build

In reply to Fabio Porcedda

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.

---

Notes:
v3:
- add this patch

 package/pkg-download.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-download.mk +1 -1
index f3409bd..92240c0 100644
@@ -9,7 +9,7 @@
 
 # Download method commands
 export WGET := $(call qstrip,$(BR2_WGET)) $(QUIET)
-export SVN := $(call qstrip,$(BR2_SVN))
+export SVN := $(call qstrip,$(BR2_SVN)) $(QUIET)
 export CVS := $(call qstrip,$(BR2_CVS))
 export BZR := $(call qstrip,$(BR2_BZR))
 export GIT := $(call qstrip,$(BR2_GIT))
Signature · 1 line
2.1.3
#3 lore raw

PATCH v3 3/3 support/download: silence git if it is a silence build

In reply to Fabio Porcedda

If it is a silence build (make -s -> QUIET=-q), silence the git download helper using "git clone -q" just like others download helpers, e.g. wget.

---

Notes:
v3:
- add this patch

 package/pkg-download.mk |  3 ++-
 support/download/git    | 14 ++++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)
package/pkg-download.mk +2 -1
index 92240c0..265fb88 100644
@@ -99,7 +99,8 @@ define DOWNLOAD_GIT
 		$(DL_DIR)/$($(PKG)_SOURCE) \
 		$($(PKG)_SITE) \
 		$($(PKG)_DL_VERSION) \
-		$($(PKG)_BASE_NAME)
+		$($(PKG)_BASE_NAME) \
+		$(QUIET)
 endef
 
 # TODO: improve to check that the given PKG_DL_VERSION exists on the remote
support/download/git +10 -4
index 5d36ca4..4ce9030 100755
@@ -9,6 +9,7 @@ set -e
 #   $2: git repo
 #   $3: git cset
 #   $4: package's basename (eg. foobar-1.2.3)
+#   $5: "-q", optional quiet flag
 # And this environment:
 #   GIT      : the git command to call
 
@@ -16,21 +17,26 @@ output="${1}"
 repo="${2}"
 cset="${3}"
 basename="${4}"
+quiet="${5}"
 
 # Try to see if we can do a shallow clone, since it is faster
 # 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}" \
Signature · 1 line
2.1.3
#4 lore raw

v3 cover Improve silent builds

In reply to Fabio Porcedda

Dear Fabio Porcedda,

Quoted 5 lines · Fabio Porcedda

This patch set improves silent builds.

Silent builds are nice when top-level parallel make is being used to reduce the output clutter.

Quoted 7 lines

The change logs are in each patch.

Best regards
Fabio Porcedda (3):
Makefile: improve detection of make "-s" flag
pkg-download: silence the svn download helper if it is a silent build support/download: silence git if it is a silence build

When I look at patches 2 and 3, I must say I dislike the fact that in one case (svn), silencing is handled in pkg-download.mk when defining the SVN variable, while in the other case (git), it's handled in the git-specific helper script.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

v3 cover Improve silent builds

Quoted 16 lines · Thomas Petazzoni

Dear Fabio Porcedda,

Quoted 5 lines · Fabio Porcedda

This patch set improves silent builds.

Silent builds are nice when top-level parallel make is being used to reduce the output clutter.

Quoted 7 lines

The change logs are in each patch.

Best regards
Fabio Porcedda (3):
Makefile: improve detection of make "-s" flag
pkg-download: silence the svn download helper if it is a silent build support/download: silence git if it is a silence build

Quoted 4 lines

When I look at patches 2 and 3, I must say I dislike the fact that in one case (svn), silencing is handled in pkg-download.mk when defining the SVN variable, while in the other case (git), it's handled in the git-specific helper script.

I would like to do the same for git but it does not work because:
git -q clone <url>
does not work, but
git clone -q <url>
works, so adding the "-q" in the script is the only option.

Do you have any better idea?

Thanks for reviewing

Signature · 1 line
Fabio Porcedda
#6 lore raw

v3 cover Improve silent builds

Quoted 23 lines · Fabio Porcedda
Quoted 16 lines · Thomas Petazzoni

Dear Fabio Porcedda,

Quoted 5 lines · Fabio Porcedda

This patch set improves silent builds.

Silent builds are nice when top-level parallel make is being used to reduce the output clutter.

Quoted 7 lines

The change logs are in each patch.

Best regards
Fabio Porcedda (3):
Makefile: improve detection of make "-s" flag
pkg-download: silence the svn download helper if it is a silent build support/download: silence git if it is a silence build

Quoted 4 lines

When I look at patches 2 and 3, I must say I dislike the fact that in one case (svn), silencing is handled in pkg-download.mk when defining the SVN variable, while in the other case (git), it's handled in the git-specific helper script.

Quoted 7 lines

I would like to do the same for git but it does not work because:
git -q clone <url>
does not work, but
git clone -q <url>
works, so adding the "-q" in the script is the only option.

Do you have any better idea?

I've forgotten to add Yann in CC.

BR

Signature · 1 line
Fabio Porcedda
#7 lore raw

v3 cover Improve silent builds

In reply to Fabio Porcedda

Dear Fabio Porcedda,

Quoted 5 lines · Fabio Porcedda
Quoted 4 lines

When I look at patches 2 and 3, I must say I dislike the fact that in one case (svn), silencing is handled in pkg-download.mk when defining the SVN variable, while in the other case (git), it's handled in the git-specific helper script.

Quoted 7 lines

I would like to do the same for git but it does not work because:
git -q clone <url>
does not work, but
git clone -q <url>
works, so adding the "-q" in the script is the only option.

Do you have any better idea?

Yes: handle the svn case in the download helper as well. This way, we're consistent between svn and git. And maybe wget should be handled this way as well.

Yann can comment on this on whether my proposal is fine for him.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#8 lore raw

v3 cover Improve silent builds

Quoted 15 lines · Thomas Petazzoni

Dear Fabio Porcedda,

Quoted 11 lines · Fabio Porcedda
Quoted 4 lines

When I look at patches 2 and 3, I must say I dislike the fact that in one case (svn), silencing is handled in pkg-download.mk when defining the SVN variable, while in the other case (git), it's handled in the git-specific helper script.

I would like to do the same for git but it does not work because:
git -q clone <url>
does not work, but
git clone -q <url>
works, so adding the "-q" in the script is the only option.

Quoted 5 lines
Quoted 1 line

Do you have any better idea?

Yes: handle the svn case in the download helper as well. This way, we're consistent between svn and git. And maybe wget should be handled this way as well.

Even the HG and SCP variables contain the "-q" option so with this patch there are a total of four variables.

Quoted 1 line

Yann can comment on this on whether my proposal is fine for him.

BR

Signature · 1 line
Fabio Porcedda
#9 lore raw

v3 cover Improve silent builds

Quoted 17 lines · Fabio Porcedda
Quoted 15 lines · Thomas Petazzoni

Dear Fabio Porcedda,

Quoted 11 lines · Fabio Porcedda
Quoted 4 lines

When I look at patches 2 and 3, I must say I dislike the fact that in one case (svn), silencing is handled in pkg-download.mk when defining the SVN variable, while in the other case (git), it's handled in the git-specific helper script.

I would like to do the same for git but it does not work because:
git -q clone <url>
does not work, but
git clone -q <url>
works, so adding the "-q" in the script is the only option.

Quoted 10 lines
Quoted 5 lines
Quoted 1 line

Do you have any better idea?

Yes: handle the svn case in the download helper as well. This way, we're consistent between svn and git. And maybe wget should be handled this way as well.

Even the HG and SCP variables contain the "-q" option so with this patch there are a total of four variables.

Quoted 1 line

Yann can comment on this on whether my proposal is fine for him.

Yann do you have any opinion about this?

BR

Signature · 1 line
Fabio Porcedda
#10 lore raw

v3 cover Improve silent builds

In reply to Thomas Petazzoni

Thomas, Fabio, All,

On 2014-11-06 18:53 +0100, Thomas Petazzoni spake thusly:

Quoted 13 lines · Fabio Porcedda
Quoted 12 lines
Quoted 5 lines

When I look at patches 2 and 3, I must say I dislike the fact that in one case (svn), silencing is handled in pkg-download.mk when defining the SVN variable, while in the other case (git), it's handled in the git-specific helper script.

I would like to do the same for git but it does not work because:
git -q clone <url>
does not work, but
git clone -q <url>
works, so adding the "-q" in the script is the only option.

Quoted 7 lines
Quoted 1 line

Do you have any better idea?

Yes: handle the svn case in the download helper as well. This way, we're consistent between svn and git. And maybe wget should be handled this way as well.

Yann can comment on this on whether my proposal is fine for him.

Sorry for the delay, still dequeuing my mails from last week...

I agree with Thomas proposal: move everything into the helper scripts.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#11 lore raw

v3 cover Improve silent builds

Quoted 22 lines · Yann E. MORIN

Thomas, Fabio, All,

On 2014-11-06 18:53 +0100, Thomas Petazzoni spake thusly:

Quoted 19 lines · Fabio Porcedda
Quoted 6 lines
Quoted 5 lines

When I look at patches 2 and 3, I must say I dislike the fact that in one case (svn), silencing is handled in pkg-download.mk when defining the SVN variable, while in the other case (git), it's handled in the git-specific helper script.

Quoted 7 lines

I would like to do the same for git but it does not work because:
git -q clone <url>
does not work, but
git clone -q <url>
works, so adding the "-q" in the script is the only option.

Do you have any better idea?

Yes: handle the svn case in the download helper as well. This way, we're consistent between svn and git. And maybe wget should be handled this way as well.

Quoted 5 lines
Quoted 1 line

Yann can comment on this on whether my proposal is fine for him.

Sorry for the delay, still dequeuing my mails from last week...

I agree with Thomas proposal: move everything into the helper scripts.

Ok, i will send an updated patch set.

BR

Signature · 1 line
Fabio Porcedda
#12 lore raw

v3 cover Improve silent builds

Quoted 23 lines · Fabio Porcedda
Quoted 22 lines · Yann E. MORIN

Thomas, Fabio, All,

On 2014-11-06 18:53 +0100, Thomas Petazzoni spake thusly:

Quoted 19 lines · Fabio Porcedda
Quoted 6 lines
Quoted 5 lines

When I look at patches 2 and 3, I must say I dislike the fact that in one case (svn), silencing is handled in pkg-download.mk when defining the SVN variable, while in the other case (git), it's handled in the git-specific helper script.

Quoted 7 lines

I would like to do the same for git but it does not work because:
git -q clone <url>
does not work, but
git clone -q <url>
works, so adding the "-q" in the script is the only option.

Do you have any better idea?

Yes: handle the svn case in the download helper as well. This way, we're consistent between svn and git. And maybe wget should be handled this way as well.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Yann can comment on this on whether my proposal is fine for him.

Sorry for the delay, still dequeuing my mails from last week...

I agree with Thomas proposal: move everything into the helper scripts.

Ok, i will send an updated patch set.

I've sent two updated patch sets:
- for master: http://patchwork.ozlabs.org/patch/412475/
- for next: http://patchwork.ozlabs.org/bundle/fabio/silent-download-v4/

BR

Signature · 1 line
Fabio Porcedda