PR#3843: Package migration scripts to koji-hub

Merges #3843
https://pagure.io/koji/pull-request/3843

Fixes: #3762
https://pagure.io/koji/issue/3762
Move sql schema + migrations to hub package.
This commit is contained in:
Tomas Kopecek 2023-09-13 12:17:19 +02:00
commit cda3163d1f
37 changed files with 22 additions and 2 deletions

View file

@ -9,7 +9,7 @@ PYVER_MAJOR := $(shell $(PYTHON) -c 'import sys; print(".".join(sys.version.spli
ifeq ($(PYVER_MAJOR),2)
SUBDIRS = builder koji cli plugins vm
else
SUBDIRS = kojihub builder koji cli util www plugins vm
SUBDIRS = kojihub builder koji cli util www plugins vm schemas
endif

1
docs/README.schema Normal file
View file

@ -0,0 +1 @@
SQL schema and updates were moved to ../schemas (/usr/share/koji)

View file

@ -428,7 +428,7 @@ make DESTDIR=$RPM_BUILD_ROOT KOJI_MINIMAL=1 PYTHON=%{__python3} install
popd
%endif
%if 0%{py3_support} > 1
for D in kojihub builder plugins util www vm ; do
for D in kojihub builder plugins util www vm schemas ; do
pushd $D
make DESTDIR=$RPM_BUILD_ROOT PYTHON=%{__python3} install
popd
@ -516,6 +516,7 @@ rm -rf $RPM_BUILD_ROOT
%{python3_sitelib}/%{name}
%{python3_sitelib}/%{name}-%{version}.*-info
%{python3_sitelib}/koji_cli
%{_datadir}/koji/*.sql
%endif
%if 0%{py2_support}

18
schemas/Makefile Normal file
View file

@ -0,0 +1,18 @@
BUILDDIR = build
SQLFILES = $(wildcard *.sql)
SQLDIR = /usr/share/koji
clean:
rm -rf $(BUILDDIR)/*
install:
@if [ "$(DESTDIR)" = "" ]; then \
echo " "; \
echo "ERROR: A destdir is required"; \
exit 1; \
fi
mkdir -p $(DESTDIR)/$(SQLDIR)
for p in $(SQLFILES) ; do \
install -p -m 644 $$p $(DESTDIR)/$(SQLDIR)/$$p; \
done