Compare commits

..

22 Commits

Author SHA1 Message Date
Patrick McCarty 128799fa02 local repo: unhide local repo conf files
To make sure the conf files are more visible in the local repo
directory, unhide them by installing them without a leading dot
character.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-03-06 16:56:47 -08:00
Patrick McCarty ad77e695dc local repo: instantiate repo after creating the directory
DNF seems to ignore an uninitialized repo, but Yum does not. To fix,
make sure to run createrepo immediately after creating the local repo
directory.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-03-06 16:56:47 -08:00
Patrick McCarty 8bf6c59e96 Enable local repo support for 'make build'
With this change, 'make build' will automatically use the local repo, if
enabled. A notice is printed in case the user didn't want to use the
local repo and wishes to disable it with 'make repodisable'.

Another functional change here is that 'make build' will use the in-tree
mock config (clear.cfg) instead of the /etc/mock/clear.cfg. If this
behavior is not desired, then MOCK_CONF can be modified in
Makefile.config, or overridden by a Makefile.config.site_local.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-03-06 16:56:47 -08:00
Patrick McCarty ac3f1898f6 local repo: forcibly remove RPMs from the local dir
In case the user runs 'make repoclean' followed by 'make repoadd' in a
package repo dir, 'rm' will complain. Add the -f option to silence those
warnings.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-03-06 16:56:47 -08:00
Patrick McCarty 905b1d1c06 local repo: add toplevel 'repoclean' command
In case the user wants to remove all RPMs from the local repo, they can
now run 'make repoclean' at toplevel.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-03-06 16:56:47 -08:00
Patrick McCarty e3b1adedd8 local repo: add 'repostatus' command
This new command displays a helpful summary of what packages exist in
the local RPM repo and whether it is enabled for Yum/DNF, Mock, or both.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-03-06 16:56:47 -08:00
Patrick McCarty ab142ead38 local repo: run createrepo after 'repodel' removes RPMs
To ensure that RPM repo metadata is always up-to-date for the local
repo, make sure createrepo is run after removing the RPMs.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-03-06 16:56:47 -08:00
Patrick McCarty a9982b4064 local repo: add Mock support and enable/disable commands
An interface for a local RPM repository already exists, so extend it by
adding Mock support and the ability to enable and disable the
repository, at package level and at toplevel.

Integration for commands that use Mock will be added in separate
commits.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-03-06 16:56:47 -08:00
clrbuilder 9f8869fdff Update packages file for version 21150
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-03-06 06:01:44 -08:00
Patrick McCarty 9892e87aec autospecnew: never clone the remote repo
With the assumption that developers will be keeping up-to-date by
running 'make pull; make clone', trying to clone the remote repo here is
not necessary.

If the package git repo already exists locally, no action is taken.
Otherwise, create a local package git repo, and then run autospec.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-02-26 13:34:52 -08:00
clrbuilder 100ad5965e Update packages file for version 20920
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-02-22 12:01:34 -08:00
clrbuilder 61db58c057 Update packages file for version 20910
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-02-22 06:01:30 -08:00
clrbuilder abe044ee0c Update packages file for version 20890
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-02-21 06:01:43 -08:00
clrbuilder 8997c889f8 Update packages file for version 20870
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-02-20 06:28:36 -08:00
clrbuilder f2dd86b50c Update packages file for version 20850
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-02-16 13:38:18 -08:00
clrbuilder fa6fa080d6 Update packages file for version 20840
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-02-16 06:01:40 -08:00
clrbuilder a20775675d Update packages file for version 20830
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-02-15 13:06:50 -08:00
clrbuilder 9dfe2ba937 Update packages file for version 20820
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-02-15 07:51:46 -08:00
clrbuilder 744cf78eb1 Update packages file for version 20810
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-02-14 21:51:54 -08:00
clrbuilder 97e7ab937a Update packages file for version 20790
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-02-14 06:43:32 -08:00
clrbuilder 4fb96cadcc Update packages file for version 20780
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-02-13 15:08:36 -08:00
clrbuilder 670a01fc25 Update packages file for version 20770
Signed-off-by: clrbuilder <david.j.klimesh@intel.com>
2018-02-13 10:59:59 -08:00
5 changed files with 173 additions and 13 deletions
+33 -8
View File
@@ -19,7 +19,12 @@ RPMS ?= $(LATEST_RPMS)
WITH_SUDO = $(shell cmp /usr/bin/mock /usr/sbin/mock &> /dev/null && echo sudo )
MOCK ?= $(WITH_SUDO) /usr/bin/mock -r clear
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
ifneq ($(wildcard upstream),)
__allsources := $(notdir $(strip $(shell cat upstream)))
@@ -115,6 +120,13 @@ shell:
.PHONY: $(SRPMFILE)
$(SRPMFILE): $(SPECFILE) $(__allsources)
@$(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
@@ -275,8 +287,11 @@ logcheck:
$(TOPLVL)/repo:
@echo "Creating local RPM repository $(TOPLVL)/repo"
mkdir $(TOPLVL)/repo
$(MAKE) localrepocreate
#help repoadd: Creates a local Yum repository in the $(TOPLVL)/repo directory.
#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.
repoadd: results/build.log $(TOPLVL)/repo
@if [ -z "`grep '^Wrote: .*$(shell basename $(SRPMFILE))$$' results/build.log`" ]; then \
echo "You have not yet succesfully built this release yet"; exit 1; \
@@ -285,17 +300,16 @@ repoadd: results/build.log $(TOPLVL)/repo
echo "Cleaning old rpms:"; \
for r in `cat .repo-index`; do \
echo "-$$r"; \
rm $(TOPLVL)/repo/$$r; \
rm -f $(TOPLVL)/repo/$$r; \
done; \
rm .repo-index; \
fi
for r in $(LATEST_RPMS); do echo "+$$r"; echo $$(basename $$r) >> .repo-index; cp $$r $(TOPLVL)/repo; done
( cd $(TOPLVL)/repo ; if type createrepo_c 1>/dev/null 2>&1; then createrepo_c .; else createrepo .; fi );
@cp $(TOPLVL)/projects/common/image-creator/yum.conf $(TOPLVL)/repo/.yum.conf
@printf "\n\n[local]\nname=Local\nfailovermethod=priority\nenabled=1\ngpgcheck=0\n" >> $(TOPLVL)/repo/.yum.conf
@printf "baseurl=file://$$(realpath $(TOPLVL))/repo/\n\n" >> $(TOPLVL)/repo/.yum.conf
$(MAKE) localrepocreate
$(call localrepoenable,${PM_CONF},${MOCK_CONF})
#help repodel: Removes package from local Yum repository.
#help repodel: Removes RPMs from the local RPM repository that were
#help previously added by 'make repoadd' for this package.
repodel:
@if [ -f .repo-index ]; then \
echo "Cleaning old rpms:"; \
@@ -304,8 +318,19 @@ repodel:
rm -f $(TOPLVL)/repo/$$r; \
done; \
rm .repo-index; \
$(MAKE) localrepocreate; \
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})
#help repodisable: Disables the local RPM repository.
repodisable: localrepodisable ;
#help repostatus: Summarizes the local RPM repository status.
repostatus: localrepostatus ;
loop-up:
$(loopup)
+7
View File
@@ -54,6 +54,13 @@ AUTOSPEC_CONF = $(TOPLVL)/projects/common/autospec.conf
# in "pkg-mapping" for cloning/pulling package repos.
USE_PACKAGE_MAPPING = yes
# Package manager config file. Default to the in-tree copy.
PM_CONF = $(TOPLVL)/projects/common/image-creator/yum.conf
# Mock configuration file. Default to the in-tree copy.
MOCK_CONF = $(TOPLVL)/projects/common/koji-client-files/clear.cfg
# Include any site local configuration variables. These variables may override
# the definitions given above.
-include $(TOPLVL)/projects/common/Makefile.config.site_local
+58
View File
@@ -62,6 +62,64 @@ define remotepkgname
$(if $(USE_PACKAGE_MAPPING),$$(awk -v P="$(1)" '$$1 == P { res=$$2 } END { print res ? res : P }' $(TOPLVL)/projects/common/pkg-mapping),$(1))
endef
# 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\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\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
# 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
# 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 );
# Remove all RPMs from the local RPM repo
localrepoclean:
@find $(TOPLVL)/repo -maxdepth 1 -name '*.rpm' -delete
# Summarizes the local RPM repo status
localrepostatus:
@if [ ! -d $(TOPLVL)/repo ]; then \
echo '** Local repo not found'; \
exit 0; \
fi; \
if [ -f $(TOPLVL)/repo/yum.conf ]; then \
echo '** Local repo enabled for Yum/DNF.'; \
else \
echo '** Local repo not enabled for Yum/DNF.'; \
fi; \
if [ -f $(TOPLVL)/repo/clear.cfg ]; then \
echo '** Local repo enabled for Mock.'; \
else \
echo '** Local repo not enabled for Mock.'; \
fi; \
echo -n '** Local repo package list: '; \
( \
cd "$(TOPLVL)/repo"; \
LC_COLLATE="C"; \
shopt -s nullglob; \
set -- *.rpm; \
if [ -n "$$1" ]; then \
printf '\n'; printf '%q\n' "$$@"; \
else \
printf 'none found\n'; \
fi; \
)
.PHONY: help
##### Code
# Make sure that HELPSPACE has exactly HELPLEN spaces in it
+26 -1
View File
@@ -193,10 +193,16 @@ autospecnew:
echo "Please specify NAME and URL. The ARCHIVES variable is optional."; \
exit 1; \
fi
@git clone $(PKG_BASE_URL)/$(NAME) $(TOPLVL)/packages/$(NAME) &> /dev/null || true
@if [ ! -d $(TOPLVL)/packages/$(NAME)/.git ]; then \
echo "no remote repository found, creating new package repository and running autospec"; \
mkdir -p $(TOPLVL)/packages/$(NAME); \
( \
cd $(TOPLVL)/packages/$(NAME); \
git init; \
git remote add origin $(PKG_BASE_URL)/$(NAME); \
$(call gitoliteurl,packages/$(NAME)); \
$(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); \
$(TOPLVL)/projects/common/checkblacklist.sh $(TOPLVL)/projects/common/blacklist $(TOPLVL)/packages/${NAME}/results/*.rpm; \
@@ -205,5 +211,24 @@ autospecnew:
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})
#help repodisable: Disables the local RPM repository.
repodisable: localrepodisable ;
#help repoclean: Removes all RPMs from the local RPM repository.
repoclean: localrepoclean localrepocreate ;
#help repostatus: Summarizes the local RPM repository status.
repostatus: localrepostatus ;
# Define site local toplevel targets in a separate makefile
-include $(TOPLVL)/projects/common/Makefile.toplevel.site_local
+49 -4
View File
@@ -9,6 +9,7 @@ Jinja2
Keras
LS_COLORS
LVM2
LibRaw
LibVNCServer
Linux-PAM
LuaJIT
@@ -24,7 +25,6 @@ OpenSP
Paste
PasteDeploy
Pillow
PyQt5
PyWavelets
PyYAML
Pygments
@@ -255,6 +255,7 @@ bluez
bndl-lamp-basic
bokeh
boost
borgbackup
boto
boto3
botocore
@@ -269,6 +270,7 @@ c_rehash
ca-certs
ca-certs-static
cabextract
cached-property
cairo
cairomm
cargo
@@ -291,6 +293,7 @@ chrome-gnome-shell
chrony
chrpath
cifs-utils
clamav
clear-config-management
clear-containers-agent
clear-containers-image
@@ -333,6 +336,7 @@ comedilib
compat-SDL2-soname1
compat-efivar-soname0
compat-fuse-soname2
compat-gegl
compat-glew-soname1
compat-guile-soname20
compat-libical-soname2
@@ -388,6 +392,7 @@ dbus-glib
dconf
deap
decorator
defusedxml
dejagnu
desktop-file-utils
dfc
@@ -423,6 +428,7 @@ ecdsa
ed
edk2
efibootmgr
efitools
efivar
eigen
elasticsearch
@@ -507,6 +513,7 @@ geoclue
geocode-glib
gettext
gevent
gexiv2
gflags
ghostscript
gimp
@@ -665,11 +672,12 @@ irssi
isa-l
iso-codes
iso8601
isodate
isort
ister
itstool
iw
javapackages-tools
ixpdimm_sw
jedi
jedi-vim
jemalloc
@@ -855,6 +863,7 @@ libxml2
libxml2-legacy
libxshmfence
libxslt
libyami
libzip
linecache2
links
@@ -926,6 +935,7 @@ mozjs38
mpc
mpfr
mpg123
msgpack-python
msmtp
msr-tools
mstflint
@@ -943,10 +953,12 @@ nasm
nautilus
nbconvert
nbformat
nbsphinx
ncurses
ncurses-compat
ndctl
ndg_httpsclient
neofetch
neon
net-snmp
net-tools
@@ -1001,6 +1013,7 @@ openconnect
opencv
openjade
openjdk
openjdk9
openldap
openmpi
opensm
@@ -1013,6 +1026,7 @@ opusfile
orc
ordereddict
ostree
ovirt-guest-agent
p11-kit
p7zip
packaging
@@ -1062,6 +1076,7 @@ perl-Eval-Closure
perl-Exception-Class
perl-Exporter-Tiny
perl-File-Listing
perl-File-Slurp
perl-HTML-Parser
perl-HTML-Tagset
perl-HTTP-Cookies
@@ -1224,6 +1239,7 @@ python-systemd
python-tappy
python-toml
python-urwid
python-zeep
python3
pytz
pyudev
@@ -1233,8 +1249,33 @@ pyzmq
qemu
qemu-lite
qpdf
qt-everywhere-opensource-src
qt3d
qtbase
qtcanvas3d
qtcharts
qtconnectivity
qtconsole
qtdeclarative
qtgraphicaleffects
qtimageformats
qtlocation
qtmultimedia
qtquickcontrols
qtquickcontrols2
qtremoteobjects
qtscript
qtscxml
qtsensors
qtserialbus
qtserialport
qtsvg
qttools
qttranslations
qtvirtualkeyboard
qtwebchannel
qtwebsockets
qtx11extras
qtxmlpatterns
quagga
quilt
randrproto
@@ -1308,13 +1349,13 @@ sox
spark-dep
speex
speexdsp
sphinx_rtd_theme
sphinxcontrib-newsfeed
sphinxcontrib-websupport
spi-tools
spice
spice-gtk
spice-protocol
spyder
spyder-notebook
sqlite-autoconf
sqlparse
@@ -1371,6 +1412,7 @@ tiptop
tk
tmux
tokyocabinet
toolbelt
tornado
totem
totem-pl-parser
@@ -1443,7 +1485,9 @@ xauth
xbitmaps
xcb-proto
xcb-util
xcb-util-image
xcb-util-keysyms
xcb-util-wm
xclip
xcmiscproto
xcursor-themes
@@ -1488,6 +1532,7 @@ xkbcomp
xkeyboard-config
xlog
xmlsec1
xmlstarlet
xmlto
xorg-server
xorriso