From cc6e70bb29a124501905134b1679f90cae2958ad Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Wed, 7 Mar 2018 16:09:15 -0800 Subject: [PATCH] Enable local repo notice for autospec commands Similar to how a notice is printed for 'make build', enable the same notice for 'make autospec' and 'make autospecnew'. Signed-off-by: Patrick McCarty --- Makefile.common | 11 ++--------- Makefile.shared | 8 ++++++++ Makefile.toplevel | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Makefile.common b/Makefile.common index dd767ec..a55ee82 100644 --- a/Makefile.common +++ b/Makefile.common @@ -115,15 +115,8 @@ shell: # Always rebuild the source rpm .PHONY: $(SRPMFILE) -$(SRPMFILE): $(SPECFILE) $(__allsources) +$(SRPMFILE): $(SPECFILE) $(__allsources) localreponotice @$(MAKE) spdxcheck - @if [ -n "${USE_LOCAL_REPO}" ]; then \ - printf '\n\n** NOTICE: Using local repo for the build. Continuing after 3 seconds.\n'; \ - printf '** If this is not desired, run `make repodisable`.\n'; \ - printf '** The repo can be re-enabled later with `make repoenable`.\n'; \ - printf '** Run `touch $(TOPLVL)/repo/opt-in-build` to prevent the 3 second delay.\n\n\n'; \ - [ -f $(TOPLVL)/repo/opt-in-build ] || sleep 3; \ - fi >&2 $(MOCK) --buildsrpm --source=./ --spec=$(SPECFILE) --result=results/ --no-cleanup-after --uniqueext=$(PKG_NAME) # Do a git fetch and a git rebase rather than a git pull so aborting @@ -151,7 +144,7 @@ pullrebase: #help already a specfile, it will be overwritten. Several files used by #help autospec will be created in the process. For more information, see #help the project at https://github.com/clearlinux/autospec -autospec: pullrebase +autospec: pullrebase localreponotice rm -f results/*src.rpm @if [ -e $(SPECFILE) ] && ! grep -q "# Generated by: autospec.py" $(SPECFILE) ; then \ echo "Specfile already exists and was not created by autospec.py! Aborting."; \ diff --git a/Makefile.shared b/Makefile.shared index 7e452fe..df3c7ce 100644 --- a/Makefile.shared +++ b/Makefile.shared @@ -129,6 +129,14 @@ MOCK_CONFIG_VAL = $(realpath $(TOPLVL)/repo/clear.cfg) USE_LOCAL_REPO = 1 endif +localreponotice: + @if [ -n "${USE_LOCAL_REPO}" ]; then \ + printf '\n\n** NOTICE: Using local repo for the build. Continuing after 3 seconds.\n'; \ + printf '** If this is not desired, run `make repodisable`.\n'; \ + printf '** The repo can be re-enabled later with `make repoenable`.\n'; \ + printf '** Run `touch $(TOPLVL)/repo/opt-in-build` to prevent the 3 second delay.\n\n\n'; \ + [ -f $(TOPLVL)/repo/opt-in-build ] || sleep 3; \ + fi >&2 .PHONY: help ##### Code diff --git a/Makefile.toplevel b/Makefile.toplevel index 36927ed..f89dbb3 100644 --- a/Makefile.toplevel +++ b/Makefile.toplevel @@ -188,7 +188,7 @@ provides: #help autospecnew: Creates a new autospec package with for a given URL=$(URL) #help with NAME=$(NAME). Several files used by autospec will be created in the #help process. For more information about autospec, see the project page on Github https://github.com/clearlinux/autospec -autospecnew: +autospecnew: localreponotice @if [ -z $(NAME) ] || [ -z $(URL) ]; then \ echo "Please specify NAME and URL. The ARCHIVES variable is optional."; \ exit 1; \