contrib: add BATCH_MODE env var to reduce log size

If BATCH_MODE is set to a non-empty string, downloads and uncompress
tools are silented to reduce the size of the output console log.
This is not enable by default to let manual usage fully verbose.

This is useful in case of automatic builds.

Change-Id: I7efa6c0f9e8a2edf991030cb7e30d25227ea6674
Reviewed-by: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
This commit is contained in:
Guillaume Roguez
2016-09-29 11:23:55 -04:00
committed by Stepan Salenikovich
parent bcc4c172e4
commit c398f8167e
8 changed files with 21 additions and 18 deletions

View File

@ -184,7 +184,7 @@ $(TARBALLS)/ffmpeg-$(FFMPEG_HASH).tar.xz:
ffmpeg: ffmpeg-$(FFMPEG_HASH).tar.xz .sum-ffmpeg ffmpeg: ffmpeg-$(FFMPEG_HASH).tar.xz .sum-ffmpeg
rm -Rf $@ $@-$(FFMPEG_HASH) rm -Rf $@ $@-$(FFMPEG_HASH)
mkdir -p $@-$(FFMPEG_HASH) mkdir -p $@-$(FFMPEG_HASH)
(cd $@-$(FFMPEG_HASH) && tar xv --strip-components=1 -f ../$<) (cd $@-$(FFMPEG_HASH) && tar x $(if ${BATCH_MODE},,-v) --strip-components=1 -f ../$<)
$(UPDATE_AUTOCONFIG) $(UPDATE_AUTOCONFIG)
$(APPLY) $(SRC)/ffmpeg/0004-avformat-fix-find_stream_info-not-considering-extradata.patch $(APPLY) $(SRC)/ffmpeg/0004-avformat-fix-find_stream_info-not-considering-extradata.patch
$(MOVE) $(MOVE)

View File

@ -182,7 +182,7 @@ $(TARBALLS)/libav-$(LIBAV_HASH).tar.xz:
libav: libav-$(LIBAV_HASH).tar.xz .sum-libav libav: libav-$(LIBAV_HASH).tar.xz .sum-libav
rm -Rf $@ $@-$(LIBAV_HASH) rm -Rf $@ $@-$(LIBAV_HASH)
mkdir -p $@-$(LIBAV_HASH) mkdir -p $@-$(LIBAV_HASH)
(cd $@-$(LIBAV_HASH) && tar xv --strip-components=1 -f ../$<) (cd $@-$(LIBAV_HASH) && tar x $(if ${BATCH_MODE},,-v) --strip-components=1 -f ../$<)
$(UPDATE_AUTOCONFIG) $(UPDATE_AUTOCONFIG)
ifdef HAVE_MACOSX ifdef HAVE_MACOSX
$(APPLY) $(SRC)/libav/0005-avfoundation-simple-capture.patch $(APPLY) $(SRC)/libav/0005-avfoundation-simple-capture.patch

View File

@ -33,6 +33,9 @@ PKGS_ALL := $(patsubst $(SRC)/%/rules.mak,%,$(wildcard $(SRC)/*/rules.mak))
DATE := $(shell date +%Y%m%d) DATE := $(shell date +%Y%m%d)
VPATH := $(TARBALLS) VPATH := $(TARBALLS)
# Set following to non-empty to remove uneeded progression reports (i.e. with automatics builds)
# BATCH_MODE = 1
# Common download locations # Common download locations
GNU := http://ftpmirror.gnu.org/ GNU := http://ftpmirror.gnu.org/
SF := http://heanet.dl.sourceforge.net/sourceforge SF := http://heanet.dl.sourceforge.net/sourceforge
@ -235,10 +238,10 @@ SVN ?= $(error subversion client (svn) not found!)
ifeq ($(DISABLE_CONTRIB_DOWNLOADS),TRUE) ifeq ($(DISABLE_CONTRIB_DOWNLOADS),TRUE)
download = $(error Trying to download $(1) but DISABLE_CONTRIB_DOWNLOADS is TRUE, aborting.) download = $(error Trying to download $(1) but DISABLE_CONTRIB_DOWNLOADS is TRUE, aborting.)
else ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),) else ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),)
download = curl -f -L --retry-delay 10 --retry 2 -- "$(1)" > "$@" download = curl $(if ${BATCH_MODE},-sS) -f -L --retry-delay 10 --retry 2 -- "$(1)" > "$@"
else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),) else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),)
download = rm -f $@.tmp && \ download = rm -f $@.tmp && \
wget --passive -t 2 -w 10 -c -p -O $@.tmp "$(1)" && \ wget $(if ${BATCH_MODE},-nv) --passive -t 2 -w 10 -c -p -O $@.tmp "$(1)" && \
touch $@.tmp && \ touch $@.tmp && \
mv $@.tmp $@ mv $@.tmp $@
else ifeq ($(which fetch >/dev/null 2>&1 || echo FAIL),) else ifeq ($(which fetch >/dev/null 2>&1 || echo FAIL),)
@ -343,10 +346,10 @@ else
CHECK_SHA512 = $(call checksum,$(SHA512SUM),SHA512) CHECK_SHA512 = $(call checksum,$(SHA512SUM),SHA512)
endif endif
UNPACK = $(RM) -R $@ \ UNPACK = $(RM) -R $@ \
$(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzf $(f)) \ $(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xzf $(f) $(if ${BATCH_MODE},,-v)) \
$(foreach f,$(filter %.tar.bz2,$^), && tar xvjf $(f)) \ $(foreach f,$(filter %.tar.bz2,$^), && tar xjf $(f) $(if ${BATCH_MODE},,-v)) \
$(foreach f,$(filter %.tar.xz,$^), && tar xvJf $(f)) \ $(foreach f,$(filter %.tar.xz,$^), && tar xJf $(f) $(if ${BATCH_MODE},,-v)) \
$(foreach f,$(filter %.zip,$^), && unzip $(f)) $(foreach f,$(filter %.zip,$^), && unzip $(if ${BATCH_MODE},-q) $(f))
UNPACK_DIR = $(basename $(basename $(notdir $<))) UNPACK_DIR = $(basename $(basename $(notdir $<)))
APPLY = (cd $(UNPACK_DIR) && patch -fp1) < APPLY = (cd $(UNPACK_DIR) && patch -fp1) <
APPLY_BIN = (cd $(UNPACK_DIR) && patch --binary -flp1) < APPLY_BIN = (cd $(UNPACK_DIR) && patch --binary -flp1) <

View File

@ -19,7 +19,7 @@ $(TARBALLS)/speex-git.tar.gz:
speex: speex-$(SPEEX_VERSION).tar.gz .sum-speex speex: speex-$(SPEEX_VERSION).tar.gz .sum-speex
rm -Rf $@-git $@ rm -Rf $@-git $@
mkdir -p $@-git mkdir -p $@-git
$(ZCAT) "$<" | (cd $@-git && tar xv --strip-components=1) $(ZCAT) "$<" | (cd $@-git && tar x $(if ${BATCH_MODE},,-v) --strip-components=1)
$(MOVE) $(MOVE)
SPEEX_CONF := --disable-binaries SPEEX_CONF := --disable-binaries

View File

@ -19,7 +19,7 @@ $(TARBALLS)/speexdsp-git.tar.gz:
speexdsp: speexdsp-$(SPEEXDSP_VERSION).tar.gz .sum-speexdsp speexdsp: speexdsp-$(SPEEXDSP_VERSION).tar.gz .sum-speexdsp
rm -Rf $@-git $@ rm -Rf $@-git $@
mkdir -p $@-git mkdir -p $@-git
$(ZCAT) "$<" | (cd $@-git && tar xv --strip-components=1) $(ZCAT) "$<" | (cd $@-git && tar x $(if ${BATCH_MODE},,-v) --strip-components=1)
$(MOVE) $(MOVE)
SPEEXDSP_CONF := --enable-resample-full-sinc-table --disable-examples SPEEXDSP_CONF := --enable-resample-full-sinc-table --disable-examples

View File

@ -19,7 +19,7 @@ $(TARBALLS)/libvpx-$(VPX_HASH).tar.gz:
libvpx: libvpx-$(VPX_HASH).tar.gz .sum-vpx libvpx: libvpx-$(VPX_HASH).tar.gz .sum-vpx
rm -Rf $@-$(VPX_HASH) rm -Rf $@-$(VPX_HASH)
mkdir -p $@-$(VPX_HASH) mkdir -p $@-$(VPX_HASH)
(cd $@-$(VPX_HASH) && tar xv --strip-components=1 -f ../$<) (cd $@-$(VPX_HASH) && tar x $(if ${BATCH_MODE},,-v) --strip-components=1 -f ../$<)
$(MOVE) $(MOVE)
DEPS_vpx = DEPS_vpx =

View File

@ -38,7 +38,7 @@ $(TARBALLS)/x264-$(X264_HASH).tar.xz:
x264: x264-$(X264_HASH).tar.xz .sum-x264 x264: x264-$(X264_HASH).tar.xz .sum-x264
rm -Rf $@-$(X264_HASH) rm -Rf $@-$(X264_HASH)
mkdir -p $@-$(X264_HASH) mkdir -p $@-$(X264_HASH)
(cd $@-$(X264_HASH) && tar xv --strip-components=1 -f ../$<) (cd $@-$(X264_HASH) && tar x $(if ${BATCH_MODE},,-v) --strip-components=1 -f ../$<)
$(APPLY) $(SRC)/x264/remove-align.patch $(APPLY) $(SRC)/x264/remove-align.patch
$(UPDATE_AUTOCONFIG) $(UPDATE_AUTOCONFIG)
$(MOVE) $(MOVE)

View File

@ -25,10 +25,10 @@ AUTOCONF=$(PREFIX)/bin/autoconf
export AUTOCONF export AUTOCONF
ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),) ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),)
download = curl -f -L -- "$(1)" > "$@" download = curl $(if ${BATCH_MODE},-sS) -f -L --retry-delay 10 --retry 2 -- "$(1)" > "$@"
else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),) else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),)
download = rm -f $@.tmp && \ download = rm -f $@.tmp && \
wget --passive -c -p -O $@.tmp "$(1)" && \ wget $(if ${BATCH_MODE},-nv) --passive -t 2 -w 10 -c -p -O $@.tmp "$(1)" && \
touch $@.tmp && \ touch $@.tmp && \
mv $@.tmp $@ mv $@.tmp $@
else ifeq ($(which fetch >/dev/null 2>&1 || echo FAIL),) else ifeq ($(which fetch >/dev/null 2>&1 || echo FAIL),)
@ -41,10 +41,10 @@ download = $(error Neither curl nor wget found!)
endif endif
UNPACK = $(RM) -R $@ \ UNPACK = $(RM) -R $@ \
$(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzf $(f)) \ $(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xzf $(f) $(if ${BATCH_MODE},,-v)) \
$(foreach f,$(filter %.tar.bz2,$^), && tar xvjf $(f)) \ $(foreach f,$(filter %.tar.bz2,$^), && tar xjf $(f) $(if ${BATCH_MODE},,-v)) \
$(foreach f,$(filter %.tar.xz,$^), && tar xvJf $(f)) \ $(foreach f,$(filter %.tar.xz,$^), && tar xJf $(f) $(if ${BATCH_MODE},,-v)) \
$(foreach f,$(filter %.zip,$^), && unzip $(f)) $(foreach f,$(filter %.zip,$^), && unzip $(if ${BATCH_MODE},-q) $(f))
UNPACK_DIR = $(basename $(basename $(notdir $<))) UNPACK_DIR = $(basename $(basename $(notdir $<)))
APPLY = (cd $(UNPACK_DIR) && patch -p1) < APPLY = (cd $(UNPACK_DIR) && patch -p1) <