Skip to content

Commit

Permalink
[frontend][dist-git-client] making mageia chroots work
Browse files Browse the repository at this point in the history
  • Loading branch information
clime committed Sep 15, 2016
1 parent af50ff8 commit 48927aa
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
30 changes: 22 additions & 8 deletions dist-git-client/fedpkg-copr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# fedpkg - a script to interact with the Fedora Packaging system
#
# Copyright (C) 2011 Red Hat Inc.
# Author(s): Jesse Keating <jkeating@redhat.com>
# Author(s): clime <clime@redhat.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
Expand Down Expand Up @@ -57,17 +57,31 @@ class CoprCommands(fedpkg.Commands):
return super(CoprCommands, self).load_rpmdefines()
except pyrpkg.rpkgError:
pass
if 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)
self.mockconfig = '%s-%s-%s' % (self._distvar, self._distval, self.localarch)
if re.match(r'custom\d$', self.branch_merge):
self._distval = self.branch_merge[6]
self._distvar = 'custom'
self.dist = 'custom%s' % self._distval
self.mockconfig = 'custom-%s-%s' % (self._distval, self.localarch)
self.override = '%s-override' % self.branch_merge
self._distunset = 'rhel'
elif re.match(r'mga\d$', self.branch_merge):
self._distval = self.branch_merge[3]
self._distvar = 'mageia'
self.dist = 'mga%s' % self._distval
self.mockconfig = 'mageia-%s-%s' % (self._distval, self.localarch)
self.override = '%s-override' % self.branch_merge
self._distunset = 'rhel'
elif re.match(r'cauldron$', self.branch_merge):
self._distval = 'cauldron'
self._distvar = 'mageia'
self.dist = 'cauldron'
self.mockconfig = 'mageia-cauldron-%s' % self.localarch
self.override = '%s-override' % self.branch_merge
self._distunset = 'rhel'
else:
raise pyrpkg.rpkgError('Could not find the dist from branch name'
raise pyrpkg.rpkgError('Could not find the dist from branch name '
'%s' % self.branch_merge)

self._rpmdefines = ["--define '_sourcedir %s'" % self.path,
"--define '_specdir %s'" % self.path,
"--define '_builddir %s'" % self.path,
Expand Down
12 changes: 10 additions & 2 deletions frontend/coprs_frontend/coprs/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ def chroot_to_branch(chroot):
os = "f"
elif os == "epel" and int(version) <= 6:
os = "el"
elif os == "mageia" and version == "cauldron":
os = "cauldron"
version = ""
elif os == "mageia":
os = "mga"
return "{}{}".format(os, version)


Expand All @@ -227,9 +232,12 @@ def branch_to_os_version(branch):
elif branch[:6] == "custom":
os = "custom"
version = branch[-1:]
elif branch[:6] == "mageia":
elif branch[:3] == "mga":
os = "mageia"
version = branch[6:]
version = branch[3:]
elif branch[:8] == "cauldron":
os = "mageia"
version = "cauldron"
return os, version


Expand Down

0 comments on commit 48927aa

Please sign in to comment.