#785 [backend] drop unused compat for /bin/copr-builder
Merged 5 months ago by praiskup. Opened 5 months ago by praiskup.
copr/ praiskup/copr drop-copr-builder-compat  into  master

@@ -268,13 +268,6 @@ 

          opts.consecutive_failure_threshold = _get_conf(

              cp, "builder", "consecutive_failure_threshold",

              DEF_CONSECUTIVE_FAILURE_THRESHOLD, mode="int")

-         opts.standalone_builder = _get_conf( # deprecated

-             cp, "builder", "standalone", False, mode="bool")

-         opts.standalone_builder_config = _get_conf( # deprecated

-             cp, "builder", "config", "/etc/copr-builder/fedora-copr.conf")

-         opts.builder_deprecated = _get_conf(

-             cp, "builder", "builder_deprecated", False, mode="bool")

- 

  

          opts.log_dir = _get_conf(

              cp, "backend", "log_dir", "/var/log/copr-backend/")

@@ -26,13 +26,8 @@ 

          self.log = logger

  

          # BACKEND/BUILDER API

- 

-         if self.opts.builder_deprecated:

-             self.builddir = "/var/lib/copr-builder"

-             self.livelog_name = os.path.join(self.builddir, 'live-log')

-         else:

-             self.builddir = "/var/lib/copr-rpmbuild"

-             self.livelog_name = os.path.join(self.builddir, 'main.log')

+         self.builddir = "/var/lib/copr-rpmbuild"

+         self.livelog_name = os.path.join(self.builddir, 'main.log')

  

          self.resultdir = os.path.join(self.builddir, 'results')

          self.pidfile = os.path.join(self.builddir, 'pid')

@@ -97,35 +92,9 @@ 

          return self._build_pid

  

      def _copr_builder_cmd(self):

-         if not self.opts.builder_deprecated:

-             return 'copr-rpmbuild --verbose --drop-resultdir '\

-                    '--build-id {build_id} --chroot {chroot} --detached'.format(

-                        build_id=self.job.build_id, chroot=self.job.chroot)

- 

-         template = 'copr-builder --config {config} --copr {copr} ' \

-                  + '--package {package} --revision {revision} ' \

-                  + '--host-resolv {net} --timeout {timeout} ' \

-                  + '--chroot {chroot} --detached '

- 

-         if self.module_dist_tag:

-             template += '--define {0} '.format(

-                 pipes.quote('dist ' + self.module_dist_tag))

- 

-         # Repo name like <user/group>/<copr>/<package>

-         git_repo_path = self.job.git_repo.split('/')

- 

-         copr = '{0}/{1}'.format(git_repo_path[0], git_repo_path[1])

-         package = git_repo_path[2]

- 

-         return template.format(

-             config=self.opts.standalone_builder_config,

-             copr=copr,

-             package=package,

-             revision=self.job.git_hash,

-             net="True" if self.job.enable_net else "False",

-             chroot=self.job.chroot,

-             timeout=self.timeout,

-         )

+         return 'copr-rpmbuild --verbose --drop-resultdir '\

I quite dislike the fact, that we return the commands as strings, not as lists (like for subprocess.Popen). But we do it like that on multiple places, so we can't just switch now, I am just sharing my thoughts on it.

+                '--build-id {build_id} --chroot {chroot} --detached'.format(

+                    build_id=self.job.build_id, chroot=self.job.chroot)

  

      def attach_to_build(self):

          if not self.build_pid:

The /bin/copr-builder shell script was used for a limited time
period (afaik only in Red Hat copr) and very soon replaced by
/bin/copr-rpmbuild (Python implementation). Nowadays both Fedora
and Red Hat Copr deployments moved to /bin/copr-rpmbuild.

I quite dislike the fact, that we return the commands as strings, not as lists (like for subprocess.Popen). But we do it like that on multiple places, so we can't just switch now, I am just sharing my thoughts on it.

rebased onto c050166

5 months ago

Pull-Request has been merged by praiskup

5 months ago