#25 guess dist values from branch name
Closed 5 years ago by cqi. Opened 7 years ago by msuchy.
msuchy/fedpkg dist-git-branches  into  master

file modified
+8
@@ -166,6 +166,14 @@ 

              self.mockconfig = 'fedora-rawhide-%s' % self.localarch

              self.override = None

              self._distunset = 'rhel'

+         elif re.match(r'\D+\d+$', self.branch_merge):

+             m = re.match(r'(\D+)(\d+)$', self.branch_merge)

+             self._distval = m.group(2)

+             self._distvar = m.group(1)

+             self.dist = '%s%s' % (self._distvar[:2], self._distval)
cqi commented 6 years ago

self._disttag should be set. If set self.dist directly, self.disttag will return None always. Others were fixed already in 3c0c248.

cqi commented 6 years ago

Why only get the first two characters from self._distvar?

+             self.mockconfig = '%s-%s-%s' % (self._distvar, self._distval, self.localarch)

+             self.override = '%s-override' % self.branch_merge

+             self._distunset = 'rhel'

          # If we don't match one of the above, punt

          else:

              raise pyrpkg.rpkgError('Could not find the dist from branch name '

fedpkg knows few branches epel, fedora etc.
However in dist-git there can be more branches.
For example in Copr we plan to have custom branches, Mageia etc.
Since fedpkg is in Copr used only for generating srpm, it is
better to create some disttag rather then raising error.
Other values are not used at all.
This RE will work for most values of dist-git branches.
And it is better than hardcoding new value every time we add new chroot
and dist-git branch.

@ausil can you help to review this?

FWIW: It would be nice to state whether 'fedpkg' considered to be library (IMO no), similar to pyrpkg ... then it would be nice to have python{2,3}-fedpkg.
See also:
https://bugzilla.redhat.com/show_bug.cgi?id=1024823
And where I'm kind of in hurry:
https://bugzilla.redhat.com/show_bug.cgi?id=1410403

commits need to be signed off to be merged

self._disttag should be set. If set self.dist directly, self.disttag will return None always. Others were fixed already in 3c0c248.

Why only get the first two characters from self._distvar?

What is the format that is used to construct new branch name added to dist-git? Is there such a format that must be followed?

No response for a long time. Close this PR. Feel free to reopen and update it if it is needed in the future.

Pull-Request has been closed by cqi

5 years ago
Metadata