#58 centpkg-sig works pulling sources and srpm
Merged 2 years ago by tdawson. Opened 2 years ago by tdawson.
centos/ tdawson/centpkg fix-sig  into  develop

file modified
+3 -1
@@ -210,7 +210,9 @@ 

                              '--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,

+                             # This is so the rhel macro is set for spec files

+                             '--define', 'rhel %s' % self._distval.split('_')[0]]

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

  

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

file modified
+15 -16
@@ -207,32 +207,31 @@ 

  

      It inherits most of its behavior from `pyrpkg.lookasideCGILookasideCache`.

      """

-     def __init__(self, hashtype, download_url, upload_url, name, branch, structure='hash'):

+     def __init__(self, hashtype, download_url, upload_url, name, branch, structure='hash', client_cert=None, ca_cert=None):

          super(SIGLookasideCache, self).__init__(

-             hashtype, download_url, upload_url,

-             client_cert=client_cert, ca_cert=ca_cert)

-         

+             hashtype, download_url, upload_url, client_cert=client_cert, ca_cert=ca_cert)

+ 

          self.name = name

          self.branch = branch

          self.structure = structure

  

-     @property

-     def download_path(self):

-         if self.structure == 'hash':

-             return '%(name)s/%(filename)s/%(hashtype)s/%(hash)s'

-         return '%(name)s/%(branch)s/%(hash)s'

- 

      def get_download_url(self, name, filename, hash, hashtype=None, **kwargs):

          if self.structure == 'hash':

+             download_path =  '%(name)s/%(branch)s/%(hash)s'

+             if "/" in name:

+                     real_name = name.split("/")[-1]

+             else:

+                     real_name = name

              path_dict = {

-                 'name': name,

-                 'filename': filename,

-                 'hash': hash,

-                 'hashtype': hashtype

+                     'name': real_name,

+                     'filename': filename,

+                     'branch': self.branch,

+                     'hash': hash,

+                     'hashtype': hashtype

              }

-             path = self.download_path % path_dict

+             path = download_path % path_dict

              return os.path.join(self.download_url, path)

-         

+ 

          return super(SIGLookasideCache, self).get_download_url(name, filename, hash, hashtype, **kwargs)

  

      def remote_file_exists(self, name, filename, hash):

These fixes will not work without the following in rpkg
https://pagure.io/rpkg/pull-request/634

1 new commit added

  • Fix download sources on SIG branches
2 years ago

rebased onto e1698bf

2 years ago

rebased onto 5754c66

2 years ago

Looks like I've got centos-sig working to pull down sources, and create srpms for both regular git.centos.org rpm packages, as well as it's SIG packages.

Also, the pull request for rpkg has been merged.

This has passed all my tests. Merging in.

Pull-Request has been merged by tdawson

2 years ago