mirror of
https://github.com/clearlinux/common.git
synced 2026-06-16 11:06:15 +00:00
Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e00c76846b | |||
| af2c0bea72 | |||
| b99b7e8c25 | |||
| 359d2a8379 | |||
| d828f3a3ce | |||
| 330876d190 | |||
| 3bf5f39687 | |||
| 71d9699bdd | |||
| ded920ccb3 | |||
| cc16065a09 | |||
| 45f2185a25 | |||
| 9ffc0b9640 | |||
| 98c5937801 | |||
| a50450212c | |||
| ab77a99a47 | |||
| 090bb77f92 | |||
| f2b7a30d12 | |||
| c26e27ce65 | |||
| 6fa010e10b | |||
| 173673b5c6 | |||
| eea34ccd7f | |||
| fa58b00fb7 | |||
| cd9b9c1319 | |||
| d22e4f985d | |||
| eb58950c17 | |||
| 8ff80b0be2 | |||
| 05634010e9 | |||
| f6442a0e7f | |||
| d6250a68cd | |||
| a0208a0509 | |||
| 7ff122463b | |||
| 08498361a4 | |||
| 1b8c8d250d | |||
| 4eccb104d5 | |||
| 4ac2b829d3 | |||
| 052fa48e83 | |||
| 382ed28176 | |||
| e695db8c80 | |||
| f12e7e48ea | |||
| f269683632 | |||
| a2c4413083 | |||
| cc6e70bb29 | |||
| f3989c0d5a | |||
| f697b227e8 | |||
| 01e548b268 |
+29
-25
@@ -4,8 +4,8 @@ all: build
|
||||
|
||||
TOPLVL = ../..
|
||||
|
||||
include $(TOPLVL)/projects/common/Makefile.functions
|
||||
include $(TOPLVL)/projects/common/Makefile.config
|
||||
include $(TOPLVL)/projects/common/Makefile.shared
|
||||
|
||||
SHELL = /bin/bash
|
||||
|
||||
@@ -19,12 +19,9 @@ RPMS ?= $(LATEST_RPMS)
|
||||
|
||||
WITH_SUDO = $(shell cmp /usr/bin/mock /usr/sbin/mock &> /dev/null && echo sudo )
|
||||
|
||||
ifeq ($(wildcard $(TOPLVL)/repo/clear.cfg),)
|
||||
MOCK ?= $(WITH_SUDO) /usr/bin/mock -r $(MOCK_CONF)
|
||||
else
|
||||
MOCK ?= $(WITH_SUDO) /usr/bin/mock -r $(TOPLVL)/repo/clear.cfg
|
||||
USE_LOCAL_REPO = 1
|
||||
endif
|
||||
# MOCK_CONFIG_VAL is set in Makefile.shared
|
||||
MOCK ?= $(WITH_SUDO) /usr/bin/mock -r $(MOCK_CONFIG_VAL)
|
||||
|
||||
|
||||
ifneq ($(wildcard upstream),)
|
||||
__allsources := $(notdir $(strip $(shell cat upstream)))
|
||||
@@ -118,28 +115,29 @@ 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
|
||||
# the git pull at a password prompt doesn't leave local changes stashed
|
||||
# Do the the git status dance so we only apply a stash we create
|
||||
# Do a git fetch and a git rebase to apply local commits on top of latest
|
||||
# commits from the remote. A git fetch/rebase is used rather than a git pull so
|
||||
# aborting the git pull at a password prompt doesn't leave local changes
|
||||
# stashed. Do the git status dance so we only apply a stash we create. Note
|
||||
# that a fetch/rebase is not attempted if the remote 'origin' is not
|
||||
# initialized locally, or if the remote contains no commits.
|
||||
pullrebase:
|
||||
if [ -z "$$SKIP_GIT" ] && [ -e .git ]; then \
|
||||
set -x ; \
|
||||
@if [ -z "$$SKIP_GIT" ] && [ -e .git ]; then \
|
||||
if ! git rev-parse --verify --quiet origin/master > /dev/null; then \
|
||||
echo "Remote not yet initialized. Continuing."; \
|
||||
exit 0; \
|
||||
fi; \
|
||||
echo "Fetching origin"; \
|
||||
git fetch; \
|
||||
if ! git rev-parse --verify --quiet FETCH_HEAD > /dev/null; then \
|
||||
echo "No commits exist in remote. Continuing."; \
|
||||
exit 0; \
|
||||
fi; \
|
||||
echo "Rebasing to origin/master"; \
|
||||
if git status --porcelain | grep -q '^.[^?]'; \
|
||||
then \
|
||||
git stash save; \
|
||||
@@ -154,17 +152,23 @@ 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."; \
|
||||
exit 1; \
|
||||
fi
|
||||
@printf 'PKG_NAME := %s\nURL = %s\nARCHIVES = %s\n\ninclude ../common/Makefile.common\n' $(PKG_NAME) '$(firstword $(value NEWURL) $(value URL))' '$(value ARCHIVES)' > Makefile
|
||||
python3 $(TOPLVL)/projects/autospec/autospec/autospec.py -t . --integrity \
|
||||
${NON_INTERACTIVE} --config "$(AUTOSPEC_CONF)" ${SKIP_GIT} \
|
||||
$(firstword $(NEWURL) $(URL)) --name $(PKG_NAME) ${CLEANUP} \
|
||||
$${SETVERSION:+ -v $${SETVERSION}} -a $(ARCHIVES)
|
||||
python3 $(TOPLVL)/projects/autospec/autospec/autospec.py \
|
||||
--target . \
|
||||
--integrity \
|
||||
--config "$(AUTOSPEC_CONF)" \
|
||||
--name $(PKG_NAME) \
|
||||
--archives $(ARCHIVES) \
|
||||
--mock-config $(MOCK_CONFIG_VAL) \
|
||||
$${SETVERSION:+ --version $${SETVERSION}} \
|
||||
${NON_INTERACTIVE} ${SKIP_GIT} ${CLEANUP} \
|
||||
$(firstword $(NEWURL) $(URL));
|
||||
@$(MAKE) spdxcheck
|
||||
@$(MAKE) checkblacklist
|
||||
@if [ -e update_changelog.sh ] && [ -z "$$SKIP_GIT" ] ; then \
|
||||
|
||||
@@ -119,6 +119,24 @@ localrepostatus:
|
||||
fi; \
|
||||
)
|
||||
|
||||
# Detection of whether to use the local RPM repo occurs on-the-fly. Normally,
|
||||
# variable definitions appear in Makefile.config, but these variables are not
|
||||
# intended to be user-modifiable.
|
||||
ifeq ($(wildcard $(TOPLVL)/repo/clear.cfg),)
|
||||
MOCK_CONFIG_VAL = $(realpath $(MOCK_CONF))
|
||||
else
|
||||
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
|
||||
+17
-4
@@ -4,8 +4,8 @@ all: clone
|
||||
|
||||
TOPLVL = .
|
||||
|
||||
include $(TOPLVL)/projects/common/Makefile.functions
|
||||
include $(TOPLVL)/projects/common/Makefile.config
|
||||
include $(TOPLVL)/projects/common/Makefile.shared
|
||||
|
||||
SHELL = /bin/bash
|
||||
|
||||
@@ -80,7 +80,11 @@ ${PULL_PKGS}:
|
||||
fi ; \
|
||||
git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit $$O..$$N; echo; \
|
||||
fi ; \
|
||||
$(call gitoliteurl,$$p); \
|
||||
if [ "$$p" = "projects/autospec" ] ; then \
|
||||
git remote set-url --push origin https://github.com/clearlinux/autospec.git; \
|
||||
else \
|
||||
$(call gitoliteurl,$$p); \
|
||||
fi ; \
|
||||
else \
|
||||
echo "$$p: no such remote 'origin'"; \
|
||||
fi ; \
|
||||
@@ -188,7 +192,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; \
|
||||
@@ -204,7 +208,16 @@ autospecnew:
|
||||
$(call subjectprefix,$(NAME)); \
|
||||
); \
|
||||
printf 'PKG_NAME := %s\nURL = %s\nARCHIVES = %s\n\ninclude ../common/Makefile.common\n' $(NAME) '$(value URL)' '$(value ARCHIVES)' > $(TOPLVL)/packages/$(NAME)/Makefile; \
|
||||
python3 $(TOPLVL)/projects/autospec/autospec/autospec.py --integrity -t packages/$(NAME) --config $(AUTOSPEC_CONF) $(URL) --name $(NAME); \
|
||||
python3 $(TOPLVL)/projects/autospec/autospec/autospec.py \
|
||||
--target packages/$(NAME) \
|
||||
--integrity \
|
||||
--config "$(AUTOSPEC_CONF)" \
|
||||
--name $(NAME) \
|
||||
--archives $(ARCHIVES) \
|
||||
--mock-config $(MOCK_CONFIG_VAL) \
|
||||
$${SETVERSION:+ --version $${SETVERSION}} \
|
||||
${NON_INTERACTIVE} ${SKIP_GIT} ${CLEANUP} \
|
||||
$(URL); \
|
||||
$(TOPLVL)/projects/common/checkblacklist.sh $(TOPLVL)/projects/common/blacklist $(TOPLVL)/packages/${NAME}/results/*.rpm; \
|
||||
else \
|
||||
echo "$(NAME) already exists at $(TOPLVL)/packages/$(NAME)"; \
|
||||
|
||||
+1
-1
@@ -149,4 +149,4 @@ fi
|
||||
echo -en "\n************************\n"
|
||||
|
||||
echo 'Workspace has been set up in the "clearlinux" directory'
|
||||
echo 'NOTE: logout and log back in or run "newgrp kvm" to finalize the setup process'
|
||||
echo 'NOTE: logout and log back in to finalize the setup process'
|
||||
|
||||
Reference in New Issue
Block a user