summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2007-10-29 10:42:30 -0400
committerMichael DeHaan <mdehaan@redhat.com>2007-10-29 10:42:30 -0400
commit66c992465c21d617f7de5f3d1e9e1ae59a7c87cf (patch)
treed486ce3b702649d370a78650773478e1e3d9a60f
parented3873ed40ccde84ec18e27a7aa43147269056fa (diff)
downloadthird_party-cobbler-66c992465c21d617f7de5f3d1e9e1ae59a7c87cf.tar.gz
third_party-cobbler-66c992465c21d617f7de5f3d1e9e1ae59a7c87cf.tar.xz
third_party-cobbler-66c992465c21d617f7de5f3d1e9e1ae59a7c87cf.zip
Apply patch to restore --arch parameter and handling to cobbler repo
management.
-rw-r--r--AUTHORS1
-rw-r--r--cobbler/action_reposync.py14
-rwxr-xr-xcobbler/cobbler.py3
-rw-r--r--cobbler/item_repo.py13
4 files changed, 27 insertions, 4 deletions
diff --git a/AUTHORS b/AUTHORS
index 11f27b4..440032b 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -8,6 +8,7 @@ Cobbler is written & maintained by:
Patches and other contributions from:
James Bowes <jbowes@redhat.com>
+ C. Daniel Chase <dan@cdchase.com>
Máirín Duffy <duffy@redhat.com>
Tru Huynh <tru@pasteur.fr>
Matt Hyclak <hyclak@math.ohiou.edu>
diff --git a/cobbler/action_reposync.py b/cobbler/action_reposync.py
index e932309..7fac220 100644
--- a/cobbler/action_reposync.py
+++ b/cobbler/action_reposync.py
@@ -118,9 +118,11 @@ class RepoSync:
temp_file = self.create_local_file(repo, temp_path, output=False)
if not has_rpm_list:
-
# if we have not requested only certain RPMs, use reposync
cmd = "/usr/bin/reposync --config=%s --repoid=%s --download_path=%s" % (temp_file, repo.name, store_path)
+ if repo.arch != "":
+ cmd = "%s -a %s" % (cmd, repo.arch)
+
print _("- %s") % cmd
cmds.append(cmd)
@@ -130,9 +132,13 @@ class RepoSync:
if not os.path.exists(dest_path):
os.makedirs(dest_path)
+ use_source = ""
+ if repo.arch == "src":
+ use_source = "--source"
+
# older yumdownloader sometimes explodes on --resolvedeps
# if this happens to you, upgrade yum & yum-utils
- cmd = "/usr/bin/yumdownloader --resolve -c %s --destdir=%s %s" %(temp_file, dest_path, " ".join(repo.rpm_list))
+ cmd = "/usr/bin/yumdownloader --resolve %s -c %s --destdir=%s %s" % (use_source, temp_file, dest_path, " ".join(repo.rpm_list))
print _("- %s") % cmd
cmds.append(cmd)
else:
@@ -144,6 +150,10 @@ class RepoSync:
print _("- warning: --rpm-list is not supported for RHN content")
rest = repo.mirror[6:] # everything after rhn://
cmd = "/usr/bin/reposync -r %s --download_path=%s" % (rest, store_path)
+
+ if repo.arch != "":
+ cmd = "%s -a %s" % (cmd, repo.arch)
+
print _("- %s") % cmd
cmds.append(cmd)
diff --git a/cobbler/cobbler.py b/cobbler/cobbler.py
index 5aea511..4b035a1 100755
--- a/cobbler/cobbler.py
+++ b/cobbler/cobbler.py
@@ -467,7 +467,8 @@ class BootCLI:
'--keep-updated' : lambda(a): repo.set_keep_updated(a),
'--local-filename' : lambda(a): repo.set_local_filename(a),
'--rpm-list' : lambda(a): repo.set_rpm_list(a),
- '--createrepo-flags' : lambda(a): repo.set_createrepo_flags(a)
+ '--createrepo-flags' : lambda(a): repo.set_createrepo_flags(a),
+ '--arch' : lambda(a): repo.set_arch(a)
}
def on_ok():
if newname is not None:
diff --git a/cobbler/item_repo.py b/cobbler/item_repo.py
index 48fefc5..84fcf1f 100644
--- a/cobbler/item_repo.py
+++ b/cobbler/item_repo.py
@@ -36,7 +36,8 @@ class Repo(item.Item):
self.local_filename = ("", '<<inherit>>')[is_subobject]
self.rpm_list = ("", '<<inherit>>')[is_subobject]
self.createrepo_flags = ("-c cache", '<<inherit>>')[is_subobject]
- self.depth = 2 # arbitrary, as not really apart of the graph
+ self.depth = 2 # arbitrary, as not really apart of the graph
+ self.arch = "" # use default arch
def from_datastruct(self,seed_data):
self.parent = self.load_item(seed_data, 'parent')
@@ -46,6 +47,7 @@ class Repo(item.Item):
self.local_filename = self.load_item(seed_data, 'local_filename')
self.rpm_list = self.load_item(seed_data, 'rpm_list')
self.createrepo_flags = self.load_item(seed_data, 'createrepo_flags', '-c cache')
+ self.arch = self.load_item(seed_data, 'arch')
self.depth = self.load_item(seed_data, 'depth', 2)
# force this to be saved as a boolean
@@ -123,6 +125,13 @@ class Repo(item.Item):
self.createrepo_flags = createrepo_flags
return True
+ def set_arch(self,arch):
+ """
+ Override the arch used for reposync
+ """
+ self.arch = arch
+ return True
+
def is_valid(self):
"""
A repo is valid if it has a name and a mirror URL
@@ -141,6 +150,7 @@ class Repo(item.Item):
'local_filename' : self.local_filename,
'rpm_list' : self.rpm_list,
'createrepo_flags' : self.createrepo_flags,
+ 'arch' : self.arch,
'parent' : self.parent,
'depth' : self.depth
}
@@ -152,6 +162,7 @@ class Repo(item.Item):
buf = buf + _("local filename : %s\n") % self.local_filename
buf = buf + _("rpm list : %s\n") % self.rpm_list
buf = buf + _("createrepo_flags : %s\n") % self.createrepo_flags
+ buf = buf + _("arch : %s\n") % self.arch
return buf
def get_parent(self):