mirror of
https://github.com/clearlinux/common.git
synced 2026-06-16 19:16:00 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 47927ff332 | |||
| 80bb811f5f | |||
| 71827cbf99 | |||
| 84a9b62e3f | |||
| 0dfb2f6ef5 | |||
| 59a46563cf | |||
| a198b2d0a0 | |||
| 9574f4ecde |
+30
-44
@@ -21,7 +21,8 @@ RPMS ?= $(LATEST_RPMS)
|
||||
WITH_SUDO = $(shell cmp /usr/bin/mock /usr/sbin/mock &> /dev/null && echo sudo )
|
||||
|
||||
# MOCK_CONFIG_VAL is set in Makefile.shared
|
||||
MOCK ?= $(WITH_SUDO) /usr/bin/mock -r $(MOCK_CONFIG_VAL) $(MOCK_OPTS)
|
||||
MOCK_SMP_FLAGS=$(patsubst -j%, -D_smp_mflags\ -j%,$(filter -j%, $(MAKEFLAGS)))
|
||||
MOCK ?= $(WITH_SUDO) /usr/bin/mock -r $(MOCK_CONFIG_VAL) $(MOCK_SMP_FLAGS) $(MOCK_OPTS)
|
||||
|
||||
ifneq ($(wildcard upstream),)
|
||||
__allsources := $(notdir $(strip $(shell cat upstream)))
|
||||
@@ -172,7 +173,7 @@ autospec: preautospec-checks pullrebase localreponotice clean-old-content
|
||||
--name $(PKG_NAME) \
|
||||
--archives $(ARCHIVES) \
|
||||
--mock-config $(MOCK_CONFIG_VAL) \
|
||||
--mock-opts="$(MOCK_OPTS)" \
|
||||
--mock-opts="$(MOCK_SMP_FLAGS) $(MOCK_OPTS)" \
|
||||
$${SETVERSION:+ --version $${SETVERSION}} \
|
||||
$${NON_INTERACTIVE:+ --non_interactive} \
|
||||
$${SKIP_GIT:+ --skip-git} \
|
||||
@@ -349,11 +350,6 @@ rekoji-nowait:
|
||||
logcheck:
|
||||
@perl $(TOPLVL)/projects/common/logcheck.pl results/build.log
|
||||
|
||||
$(TOPLVL)/repo:
|
||||
@echo "Creating local RPM repository $(TOPLVL)/repo"
|
||||
mkdir $(TOPLVL)/repo
|
||||
$(MAKE) localrepocreate
|
||||
|
||||
#help repoadd: Adds locally-built RPMs for this package to the local RPM
|
||||
#help repository. If this repository does not yet exist, it is created and
|
||||
#help enabled.
|
||||
@@ -361,22 +357,16 @@ repoadd: $(TOPLVL)/repo
|
||||
@if [ -z "${LATEST_RPMS}" ]; then \
|
||||
echo "No rpms found in rpms/ directory."; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
if [ -f .repo-index ]; then \
|
||||
echo "Cleaning old rpms:"; \
|
||||
for r in `cat .repo-index`; do \
|
||||
echo "-$$r"; \
|
||||
rm -f $(TOPLVL)/repo/$$r; \
|
||||
done; \
|
||||
rm .repo-index; \
|
||||
fi; \
|
||||
for r in ${LATEST_RPMS}; do \
|
||||
echo "+$$r"; \
|
||||
echo $$(basename $$r) >> .repo-index; \
|
||||
ln -f $$r $(TOPLVL)/repo/; \
|
||||
done
|
||||
$(MAKE) localrepocreate
|
||||
$(call localrepoenable,${PM_CONF},${MOCK_CONF})
|
||||
fi
|
||||
$(MAKE) -s repodel NO_CREATEREPO=1
|
||||
@echo "Adding new rpms:"; \
|
||||
for rpm in ${LATEST_RPMS}; do \
|
||||
echo "+$${rpm#rpms/}"; \
|
||||
echo "$${rpm#rpms/}" >> .repo-index; \
|
||||
done; \
|
||||
flock $</repo.lock ln -f -t $< ${LATEST_RPMS}
|
||||
$(MAKE) -s localrepocreate
|
||||
$(MAKE) -s localrepoenable
|
||||
|
||||
#help repostage: Stages locally-built RPMs for this package to the local RPM
|
||||
#help directory. If this directory does not yet exist, it is created and
|
||||
@@ -385,37 +375,33 @@ repostage: $(TOPLVL)/repo
|
||||
@if [ -z "${LATEST_RPMS}" ]; then \
|
||||
echo "No rpms found in rpms/ directory."; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
if [ -f .repo-index ]; then \
|
||||
echo "Cleaning old rpms:"; \
|
||||
for r in `cat .repo-index`; do \
|
||||
echo "-$$r"; \
|
||||
rm -f $(TOPLVL)/repo/$$r; \
|
||||
done; \
|
||||
rm .repo-index; \
|
||||
fi; \
|
||||
for r in ${LATEST_RPMS}; do \
|
||||
echo "+$$r"; \
|
||||
echo $$(basename $$r) >> .repo-index; \
|
||||
ln -f $$r $(TOPLVL)/repo/; \
|
||||
done
|
||||
fi
|
||||
$(MAKE) -s repodel NO_CREATEREPO=1
|
||||
@for r in ${LATEST_RPMS}; do \
|
||||
echo "+$${rpm#rpms/}"; \
|
||||
echo "$${rpm#rpms/}" >> .repo-index; \
|
||||
done; \
|
||||
flock $</repo.lock ln -f -t $< ${LATEST_RPMS}
|
||||
|
||||
#help repodel: Removes RPMs from the local RPM repository that were
|
||||
#help previously added by 'make repoadd' for this package.
|
||||
repodel:
|
||||
repodel: $(TOPLVL)/repo
|
||||
@if [ -f .repo-index ]; then \
|
||||
echo "Cleaning old rpms:"; \
|
||||
for r in `cat .repo-index`; do \
|
||||
echo "-$$r"; \
|
||||
rm -f $(TOPLVL)/repo/$$r; \
|
||||
done; \
|
||||
mapfile -t rpms < <(sed 's|.*|$</&|' .repo-index); \
|
||||
for rpm in "$${rpms[@]}"; do \
|
||||
echo "-$${rpm#$</}"; \
|
||||
done < .repo-index; \
|
||||
flock $</repo.lock rm -f "$${rpms[@]}"; \
|
||||
rm .repo-index; \
|
||||
$(MAKE) localrepocreate; \
|
||||
if [ -z "$$NO_CREATEREPO" ]; then \
|
||||
$(MAKE) -s localrepocreate; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
#help repoenable: Enables the local RPM repository for use with Yum/DNF and
|
||||
#help Mock. If this repository does not yet exist, it is created.
|
||||
repoenable: $(TOPLVL)/repo ; $(call localrepoenable,${PM_CONF},${MOCK_CONF})
|
||||
repoenable: localrepoenable ;
|
||||
|
||||
#help repodisable: Disables the local RPM repository.
|
||||
repodisable: localrepodisable ;
|
||||
|
||||
+47
-17
@@ -93,34 +93,64 @@ $(MAKE) clone_$(1) || { \
|
||||
}
|
||||
endef
|
||||
|
||||
$(TOPLVL)/repo:
|
||||
@echo "Creating local RPM repository $(TOPLVL)/repo"
|
||||
mkdir $(TOPLVL)/repo
|
||||
|
||||
# Enables the local RPM repo by installing package manager and Mock configs.
|
||||
# First argument is the path to the package manager config, and the second
|
||||
# argument is the path to the mock config. Each of these config files is
|
||||
# augmented for local repo support.
|
||||
define localrepoenable
|
||||
@cp $(1) $(TOPLVL)/repo/yum.conf
|
||||
@printf "\n\n[local]\nname=Local\nfailovermethod=priority\nenabled=1\ngpgcheck=0\npriority=1\n" >> $(TOPLVL)/repo/yum.conf
|
||||
@printf "baseurl=file://$$(realpath $(TOPLVL))/repo/\n\n" >> $(TOPLVL)/repo/yum.conf
|
||||
@cp $(2) $(TOPLVL)/repo/clear.cfg
|
||||
@printf "\n\n[localrepo]\nname=Local repo\nfailovermethod=priority\nenabled=1\ngpgcheck=0\npriority=1\n" >> $(TOPLVL)/repo/clear.cfg
|
||||
@printf "baseurl=file://$$(realpath $(TOPLVL))/repo/\n\n" >> $(TOPLVL)/repo/clear.cfg
|
||||
@sed -i '/^"""/d; $$a"""' $(TOPLVL)/repo/clear.cfg
|
||||
endef
|
||||
localrepoenable: $(TOPLVL)/repo
|
||||
@if grep -qx '\[localrepo\]' ${PM_CONF}; then \
|
||||
echo "[ERROR] ${PM_CONF} contains section named [localrepo]."; \
|
||||
echo "[ERROR] Remove that section and try again."; \
|
||||
exit 1; \
|
||||
fi >&2
|
||||
@if grep -qx '\[localrepo\]' ${MOCK_CONF}; then \
|
||||
echo "[ERROR] ${MOCK_CONF} contains section named [localrepo]."; \
|
||||
echo "[ERROR] Remove that section and try again."; \
|
||||
exit 1; \
|
||||
fi >&2
|
||||
@last="$$(tail -n 1 ${MOCK_CONF})"; \
|
||||
if [[ "$$last" != "\"\"\"" ]]; then \
|
||||
echo "[ERROR] Last line of ${MOCK_CONF} is malformed; expected: \"\"\"; actual: $$last"; \
|
||||
echo "[ERROR] Fix that line and try again."; \
|
||||
exit 1; \
|
||||
fi >&2
|
||||
@pm_new=$$(mktemp -p $< yum.conf.XXXXXXX); \
|
||||
pm_orig=$</yum.conf; \
|
||||
mock_new=$$(mktemp -p $< clear.cfg.XXXXXXX); \
|
||||
mock_orig=$</clear.cfg; \
|
||||
cp ${PM_CONF} $$pm_new; \
|
||||
printf "\n\n[localrepo]\nname=localrepo\nfailovermethod=priority\nenabled=1\ngpgcheck=0\npriority=1\n" >> $$pm_new; \
|
||||
printf "baseurl=file://$$(realpath $<)/\n\n" >> $$pm_new; \
|
||||
if ! cmp -s $$pm_new $$pm_orig; then \
|
||||
flock $</repo.lock mv $$pm_new $$pm_orig; \
|
||||
fi; \
|
||||
rm -f $$pm_new; \
|
||||
cp ${MOCK_CONF} $$mock_new; \
|
||||
sed -i '$$d' $$mock_new; \
|
||||
printf "\n\n[localrepo]\nname=localrepo\nfailovermethod=priority\nenabled=1\ngpgcheck=0\npriority=1\n" >> $$mock_new; \
|
||||
printf "baseurl=file://$$(realpath $<)/\n\n" >> $$mock_new; \
|
||||
sed -i '$$a"""' $$mock_new; \
|
||||
if ! cmp -s $$mock_new $$mock_orig; then \
|
||||
flock $</repo.lock mv $$mock_new $$mock_orig; \
|
||||
fi; \
|
||||
rm -f $$mock_new
|
||||
|
||||
# Disables the local RPM repo by removing the installed package manager and
|
||||
# Mock configuration files.
|
||||
localrepodisable:
|
||||
@rm -f $(TOPLVL)/repo/yum.conf
|
||||
@rm -f $(TOPLVL)/repo/clear.cfg
|
||||
localrepodisable: $(TOPLVL)/repo
|
||||
flock $</repo.lock rm -f $</yum.conf $</clear.cfg
|
||||
|
||||
# Runs createrepo_c (or createrepo) for the local RPM repo
|
||||
localrepocreate:
|
||||
( cd $(TOPLVL)/repo ; if type createrepo_c 1>/dev/null 2>&1; then createrepo_c .; else createrepo .; fi );
|
||||
# Runs createrepo_c for the local RPM repo
|
||||
localrepocreate: $(TOPLVL)/repo
|
||||
cd $< && flock repo.lock createrepo_c .
|
||||
|
||||
# Remove all RPMs from the local RPM repo
|
||||
localrepoclean:
|
||||
@find $(TOPLVL)/repo -maxdepth 1 -name '*.rpm' -delete
|
||||
localrepoclean: $(TOPLVL)/repo
|
||||
flock $</repo.lock find $< -maxdepth 1 -name '*.rpm' -delete
|
||||
|
||||
# Summarizes the local RPM repo status
|
||||
localrepostatus:
|
||||
|
||||
+1
-6
@@ -290,14 +290,9 @@ autospecnewgo: preautospecnew-checks localreponotice
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
$(TOPLVL)/repo:
|
||||
@echo "Creating local RPM repository $(TOPLVL)/repo"
|
||||
mkdir $(TOPLVL)/repo
|
||||
$(MAKE) localrepocreate
|
||||
|
||||
#help repoenable: Enables the local RPM repository for use with Yum/DNF and
|
||||
#help Mock. If this repository does not yet exist, it is created.
|
||||
repoenable: $(TOPLVL)/repo ; $(call localrepoenable,${PM_CONF},${MOCK_CONF})
|
||||
repoenable: localrepoenable ;
|
||||
|
||||
#help repodisable: Disables the local RPM repository.
|
||||
repodisable: localrepodisable ;
|
||||
|
||||
@@ -163,7 +163,6 @@ R-R.cache
|
||||
R-R.methodsS3
|
||||
R-R.oo
|
||||
R-R.utils
|
||||
R-R2Cuba
|
||||
R-R2HTML
|
||||
R-R2WinBUGS
|
||||
R-R2jags
|
||||
@@ -1434,6 +1433,7 @@ comedilib
|
||||
comfortaa-fonts
|
||||
commonmark
|
||||
compat-SDL2-soname1
|
||||
compat-boost-soname1.72.0
|
||||
compat-cryptsetup-soname4
|
||||
compat-curl-gnutls-soname4
|
||||
compat-double-conversion-soname1
|
||||
@@ -2093,6 +2093,7 @@ isa-l
|
||||
iso-codes
|
||||
iso8601
|
||||
isodate
|
||||
isomd5sum
|
||||
isort
|
||||
ister
|
||||
isync
|
||||
@@ -2178,6 +2179,7 @@ kcachegrind
|
||||
kcalc
|
||||
kcalendarcore
|
||||
kcalutils
|
||||
kcc
|
||||
kcharselect
|
||||
kcmutils
|
||||
kcodecs
|
||||
@@ -2227,7 +2229,6 @@ keepassxc
|
||||
kemoticons
|
||||
kerberos
|
||||
kernel-config
|
||||
kernel-config-checker
|
||||
kernel-install
|
||||
kexec-tools
|
||||
keychain
|
||||
@@ -4836,6 +4837,7 @@ xf86-video-vesa
|
||||
xf86-video-vmware
|
||||
xfburn
|
||||
xfce4-appfinder
|
||||
xfce4-battery-plugin
|
||||
xfce4-dev-tools
|
||||
xfce4-notifyd
|
||||
xfce4-panel
|
||||
@@ -4887,6 +4889,7 @@ xvfb-run
|
||||
xwd
|
||||
xwdrun
|
||||
xwininfo
|
||||
xxhash
|
||||
xz
|
||||
yajl
|
||||
yakuake
|
||||
|
||||
Reference in New Issue
Block a user