rel-eng/packages/spacewalk-utils | 2 +-
utils/cloneByDate.py | 23 +++++++++++++++--------
utils/spacewalk-clone-by-date | 4 +++-
utils/spacewalk-clone-by-date.sgml | 9 +++++++++
utils/spacewalk-utils.spec | 6 +++++-
5 files changed, 33 insertions(+), 11 deletions(-)
New commits:
commit 9d71b9ee51cf923266a70f58456b729c8b7793a9
Author: Stephen Herr <sherr(a)redhat.com>
Date: Fri Apr 5 15:50:27 2013 -0400
Automatic commit of package [spacewalk-utils] release [1.10.3-1].
diff --git a/rel-eng/packages/spacewalk-utils b/rel-eng/packages/spacewalk-utils
index b70c3fb..9f97ee7 100644
--- a/rel-eng/packages/spacewalk-utils
+++ b/rel-eng/packages/spacewalk-utils
@@ -1 +1 @@
-1.10.2-1 utils/
+1.10.3-1 utils/
diff --git a/utils/spacewalk-utils.spec b/utils/spacewalk-utils.spec
index 0e9d9b1..a03af23 100644
--- a/utils/spacewalk-utils.spec
+++ b/utils/spacewalk-utils.spec
@@ -1,7 +1,7 @@
%define rhnroot %{_prefix}/share/rhn
Name: spacewalk-utils
-Version: 1.10.2
+Version: 1.10.3
Release: 1%{?dist}
Summary: Utilities that may be run against a Spacewalk server.
@@ -88,6 +88,10 @@ spacewalk-pylint $RPM_BUILD_ROOT%{rhnroot}
%changelog
+* Fri Apr 05 2013 Stephen Herr <sherr(a)redhat.com> 1.10.3-1
+- 947942 - Updating spacewalk-clone-by-date config file parsing and man page
+- 947942 - add spacewalk-clone-by-date --use-update-date
+
* Wed Mar 27 2013 Michael Mraka <michael.mraka(a)redhat.com> 1.10.2-1
- add openSUSE 12.3 to spacewalk-common-channels config
commit 41aa3b461a33023df545664d0d259732d07f8680
Author: Stephen Herr <sherr(a)redhat.com>
Date: Fri Apr 5 15:49:09 2013 -0400
947942 - Updating spacewalk-clone-by-date config file parsing and man page
diff --git a/utils/spacewalk-clone-by-date b/utils/spacewalk-clone-by-date
index c0faa51..04776e6 100755
--- a/utils/spacewalk-clone-by-date
+++ b/utils/spacewalk-clone-by-date
@@ -42,6 +42,7 @@ SAMPLE_CONFIG = """
"to_date": "2011-10-01",
"skip_depsolve":false,
"security_only":false,
+ "use_update_date":false,
"blacklist": {
"ALL":["sendmail"],
"my-rhel5-x86_64-clone":["emacs"],
@@ -86,7 +87,7 @@ def merge_config(options):
# add it to options
overwrite = ["username", "password", "blacklist", "removelist", "channels",
"server", "assumeyes", "to_date", "skip_depsolve",
- "security_only"]
+ "security_only", "use_update_date"]
for key in overwrite:
if config.has_key(key) and not getattr(options, key):
setattr(options, key, config[key])
@@ -154,7 +155,7 @@ def parse_args():
help="Already existing channels that will be used as the "
+ "original parent and destination parent of child "
+ "channels cloned this session.")
- parser.add_option("--use-update-date", dest="use_update_date", action='store_true', help="While cloning errata by date, use Errata's update date. If omitted will use issue date of errata.")
+ parser.add_option("-z", "--use-update-date", dest="use_update_date", action='store_true', help="While cloning errata by date, clone all errata that have last been updated on or before the date provided by to_date. If omitted will use issue date of errata (default).")
(options, args) = parser.parse_args()
diff --git a/utils/spacewalk-clone-by-date.sgml b/utils/spacewalk-clone-by-date.sgml
index ae305e0..e741718 100644
--- a/utils/spacewalk-clone-by-date.sgml
+++ b/utils/spacewalk-clone-by-date.sgml
@@ -67,6 +67,9 @@ Utility for cloning errata by date.
<arg>-o</arg><arg>--security_only</arg>
</cmdsynopsis>
<cmdsynopsis>
+ <arg>-z</arg><arg>--use-update-date</arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
<arg>-g</arg><arg>--background</arg>
</cmdsynopsis>
<cmdsynopsis>
@@ -156,6 +159,12 @@ Utility for cloning errata by date.
</listitem>
</varlistentry>
<varlistentry>
+ <term>-z --use-update-date</term>
+ <listitem>
+ <para>While cloning errata by date, clone all errata that have last been updated on or before the date provided by to_date. If omitted will use issue date of errata (default).</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term>-v --validate</term>
<listitem>
<para>Run repoclosure on all provided channels. This overrides --to_date and will not perform any cloning.</para>
commit 3f8e200c4ee6aa1fab10bdfe4bdaf27b641c4f28
Author: Paresh Mutha <pmutha(a)redhat.com>
Date: Fri Apr 5 15:22:44 2013 -0400
947942 - add spacewalk-clone-by-date --use-update-date
diff --git a/utils/cloneByDate.py b/utils/cloneByDate.py
index 3116685..22cf566 100644
--- a/utils/cloneByDate.py
+++ b/utils/cloneByDate.py
@@ -144,12 +144,13 @@ def main(options):
tree_cloner = ChannelTreeCloner(channel_list, xmlrpc, db,
options.to_date, options.blacklist,
options.removelist, options.background,
- options.security_only, options.parents)
+ options.security_only, options.use_update_date,
+ options.parents)
else:
tree_cloner = ChannelTreeCloner(channel_list, xmlrpc, db,
options.to_date, options.blacklist,
options.removelist, options.background,
- options.security_only)
+ options.security_only,options.use_update_date)
cloners.append(tree_cloner)
needed_channels += tree_cloner.needing_create().values()
@@ -202,7 +203,7 @@ class ChannelTreeCloner:
# pylint: disable=R0902
def __init__(self, channels, remote_api, db_api, to_date, blacklist,
removelist, detached,
- security_only, parents = None):
+ security_only, use_update_date, parents = None):
self.remote_api = remote_api
self.db_api = db_api
self.channel_map = channels
@@ -221,13 +222,14 @@ class ChannelTreeCloner:
self.channel_details = None
self.detached = detached
self.security_only = security_only
+ self.use_update_date = use_update_date
self.validate_source_channels()
for from_label in self.ordered_labels():
to_label = self.channel_map[from_label]
cloner = ChannelCloner(from_label, to_label, self.to_date,
self.remote_api, self.db_api, self.detached,
- self.security_only)
+ self.security_only,self.use_update_date)
self.cloners.append(cloner)
@@ -425,7 +427,7 @@ class ChannelTreeCloner:
class ChannelCloner:
# pylint: disable=R0902
def __init__(self, from_label, to_label, to_date, remote_api, db_api,
- detached, security_only):
+ detached, security_only, use_update_date):
self.remote_api = remote_api
self.db_api = db_api
self.from_label = from_label
@@ -438,6 +440,7 @@ class ChannelCloner:
self.old_pkg_hash = {}
self.detached = detached
self.security_only = security_only
+ self.use_update_date = use_update_date
def dest_label(self):
@@ -548,9 +551,13 @@ class ChannelCloner:
""" Returns tuple of all available for cloning, and what falls in the date range"""
available_errata = self.db_api.applicable_errata(self.from_label, self.to_label)
to_clone = []
-
+ if self.use_update_date:
+ date_to_use='update_date'
+ else:
+ date_to_use='issue_date'
+ print "Using ",date_to_use
for err in available_errata:
- if self.to_date and err['issue_date'].date() <= self.to_date.date():
+ if self.to_date and err[date_to_use].date() <= self.to_date.date():
if self.security_only:
if err['advisory_type'] == 'Security Advisory':
to_clone.append(err)
@@ -714,7 +721,7 @@ class DBApi:
"""list of errata that is applicable to be cloned, used db because we
need to exclude cloned errata too"""
h = rhnSQL.prepare("""
- select e.id, e.advisory_name, e.advisory_type, e.issue_date, e.synopsis
+ select e.id, e.advisory_name, e.advisory_type, e.issue_date, e.synopsis, e.update_date
from rhnErrata e inner join
rhnChannelErrata ce on e.id = ce.errata_id inner join
rhnChannel c on c.id = ce.channel_id
diff --git a/utils/spacewalk-clone-by-date b/utils/spacewalk-clone-by-date
index 0542e9d..c0faa51 100755
--- a/utils/spacewalk-clone-by-date
+++ b/utils/spacewalk-clone-by-date
@@ -154,6 +154,7 @@ def parse_args():
help="Already existing channels that will be used as the "
+ "original parent and destination parent of child "
+ "channels cloned this session.")
+ parser.add_option("--use-update-date", dest="use_update_date", action='store_true', help="While cloning errata by date, use Errata's update date. If omitted will use issue date of errata.")
(options, args) = parser.parse_args()