#1410 build_srpm: Wait until after running the sources command to check for alt_sources_dir
Merged 4 years ago by mikem. Opened 4 years ago by bstinson.
bstinson/koji fix-rpms-layout  into  master

file modified
+6 -5
@@ -555,11 +555,6 @@ 

  

      def build_srpm(self, specfile, sourcedir, source_cmd):

          self.session.host.setBuildRootState(self.id,'BUILDING')

-         alt_sources_dir = "%s/SOURCES" % sourcedir

-         if self.options.support_rpm_source_layout and os.path.isdir(alt_sources_dir):

-             sources_dir = alt_sources_dir

-         else:

-             sources_dir = sourcedir

          if source_cmd:

              # call the command defined by source_cmd in the chroot so any required files not stored in

              # the SCM can be retrieved
@@ -571,6 +566,12 @@ 

                  self.expire()

                  raise koji.BuildError("error retrieving sources, %s" % self._mockResult(rv))

  

+         alt_sources_dir = "%s/SOURCES" % sourcedir

+         if self.options.support_rpm_source_layout and os.path.isdir(alt_sources_dir):

+             sources_dir = alt_sources_dir

+         else:

+             sources_dir = sourcedir

+ 

          args = ['--no-clean', '--buildsrpm', '--spec', specfile, '--sources', sources_dir,

                  '--target', 'noarch']

  

In the RPM layout, it's possible that the SOURCES directory might be
completely empty save for the lookaside payload. In this case a SOURCES
directory wouldn't exist in SCM, and wouldn't be created until the
sources command is run.

Moving this code block down lets us run the sources command before we try to decide if we should look for the RPM layout or not.

pretty please pagure-ci rebuild

4 years ago

Commit c3764e5 fixes this pull-request

Pull-Request has been merged by mikem

4 years ago