#57 rpmdefines changes depending on rpkg
Merged 2 years ago by tdawson. Opened 2 years ago by onosek.
centos/ onosek/centpkg rpmdefines_format  into  develop

file modified
+7 -7
@@ -189,14 +189,14 @@ 

          self._distval = self._distvar.replace('.', '_')

  

          self._disttag = 'el%s' % self._distval

-         self._rpmdefines = ["--define '_sourcedir %s'" % self.layout.sourcedir,

-                             "--define '_specdir %s'" % self.layout.specdir,

-                             "--define '_builddir %s'" % self.layout.builddir,

-                             "--define '_srcrpmdir %s'" % self.layout.srcrpmdir,

-                             "--define '_rpmdir %s'" % self.layout.rpmdir,

-                             "--define 'dist .%s'" % self._disttag,

+         self._rpmdefines = ['--define', '_sourcedir %s' % self.layout.sourcedir,

+                             '--define', '_specdir %s' % self.layout.specdir,

+                             '--define', '_builddir %s' % self.layout.builddir,

+                             '--define', '_srcrpmdir %s' % self.layout.srcrpmdir,

+                             '--define', '_rpmdir %s' % self.layout.rpmdir,

+                             '--define', 'dist .%s' % self._disttag,

                              # int and float this to remove the decimal

-                             "--define '%s 1'" % self._disttag]

+                             '--define', '%s 1' % self._disttag]

          self.log.debug("RPMDefines: %s" % self._rpmdefines)

  

      def construct_build_url(self, *args, **kwargs):

Recent changes on rpkg side require modification in centpkg too.
rpmdefines in rpkg had to be changed because of a safer way
of executing the 'rpm' command in the 'subprocess' python library
(without shell=True argument).
A related change in rpkg: https://pagure.io/rpkg/pull-request/620
Other tools depending on rpkg (rhpkg, fedpkg, centpkg, rfpkg) are
affected.
Example for fedpkg: https://pagure.io/fedpkg/pull-request/486

Signed-off-by: Ondrej Nosek onosek@redhat.com

Hi,
I tested this change only in code without built packages and with the command centpkg verrel. I haven't released the changed rpkg package yet. Actually, I can do that, because I already notified all rpkg's dependencies. Do you have any suggestions/notes about this?

How to recognize incompatible rpkg:

onosek@d5cffa2a8788:/repo/centos-release(c9s)$ PYTHONPATH=/src/rpkg centpkg verrel
Using centos-stream-release.spec
rpm: --define '_sourcedir /repo/centos-release': unknown option

Could not execute verrel: Could not get n-v-r-e from /repo/centos-release/centos-stream-release.spec

I published the updated rpkg in Bodhi. Would it be possible to release an updated version of centpkg too? I haven't done this before and I'm afraid I don't have proper permission anyway.
Thanks

Pull-Request has been merged by tdawson

2 years ago
Metadata