[Rpm-maint] [rpm-software-management/rpm] Migrate test-suite macro configuration out of root's ~/.rpmmacros (PR #3524)

Michal Domonkos notifications at github.com
Thu Jan 16 16:49:00 UTC 2025


@dmnks requested changes on this pull request.

Some suggestions around the use of `ARG`, see comments inline. Otherwise, looks sane :)

> @@ -1,3 +1,5 @@
+ARG PREFIX=/usr/local

This needs to go after the FROM instruction (FROM resets all ARGs).

> @@ -61,7 +63,10 @@ RUN rm -f /usr/lib/rpm/macros.d/macros.transaction_ima
 RUN dnf -y --enablerepo=updates install "sequoia-sq >= 1.0"
 RUN dnf clean all
 
-RUN echo "%_dbpath $(rpm --eval '%_dbpath')" > /root/.rpmmacros
+ARG PREFIX

Once the above ARG is below FROM, this second ARG isn't needed anymore :smile: 

> @@ -61,7 +63,10 @@ RUN rm -f /usr/lib/rpm/macros.d/macros.transaction_ima
 RUN dnf -y --enablerepo=updates install "sequoia-sq >= 1.0"
 RUN dnf clean all
 
-RUN echo "%_dbpath $(rpm --eval '%_dbpath')" > /root/.rpmmacros
+ARG PREFIX
+# Make sure the built rpm find the system db (for shell usage)
+RUN mkdir -p ${PREFIX}/etc/rpm
+RUN echo "%_dbpath $(rpm --eval '%_dbpath')" > ${PREFIX}/etc/rpm/macros.db

This is still within the "base" layer which is combined with the native cmake build of rpm. So the prefix depends on that cmake build. IOW, that's why `~/.rpmmacros` was used originally :laughing: 

We would have to pass `--build-arg PREFIX=...` when building the "base" layer in mktree.oci but... that'd just make things more complicated.

I'd say let's just remove drop the macros.db file altogether for now and revisit later. Perhaps even by changing the dbpath in our own macros file.

> @@ -88,6 +93,7 @@ WORKDIR /
 CMD /bin/bash
 
 FROM base AS full
+ARG PREFIX

This needs the default value as well.

> @@ -26,7 +26,7 @@ else
 fi
 
 IMAGE=rpm
-ARGS="-f Dockerfile $FROM $CONTEXT"
+ARGS="-f Dockerfile $FROM $CONTEXT "

Leftover? :smile: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3524#pullrequestreview-2556667536
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3524/review/2556667536 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20250116/910b8275/attachment.htm>


More information about the Rpm-maint mailing list