backend/satellite_tools/spacewalk-remove-channel | 21 ++++++++++--------
backend/satellite_tools/spacewalk-remove-channel.sgml | 6 +++++
2 files changed, 18 insertions(+), 9 deletions(-)
New commits:
commit c7d6287087505a26e7b44cd267a0b38c221d0fb2
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Feb 24 11:32:57 2010 -0500
updating man page for channel remove script
diff --git a/backend/satellite_tools/spacewalk-remove-channel.sgml b/backend/satellite_tools/spacewalk-remove-channel.sgml
index e8371f7..9d5cc1c 100644
--- a/backend/satellite_tools/spacewalk-remove-channel.sgml
+++ b/backend/satellite_tools/spacewalk-remove-channel.sgml
@@ -95,6 +95,12 @@ Removes a channel from an RHN Satellite or Spacewalk server.
<para>Delete packages from the satellite even if the package is in more channels than what is specified. (Not Recommended)</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>-p, --skip-packages</term>
+ <listitem>
+ <para>Do not remove the package metadata or the files on teh filesystem.</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</RefSect1>
commit e2eda65039ac165a71465441d08049eeb2dbb134
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Feb 24 11:21:39 2010 -0500
adding a skip packages option to the channel delete script
diff --git a/backend/satellite_tools/spacewalk-remove-channel b/backend/satellite_tools/spacewalk-remove-channel
index 2a3b91e..b000ada 100755
--- a/backend/satellite_tools/spacewalk-remove-channel
+++ b/backend/satellite_tools/spacewalk-remove-channel
@@ -36,16 +36,18 @@ from server import rhnSQL
options_table = [
Option("-v", "--verbose", action="count",
help="Increase verbosity"),
+ Option("-l", "--list", action="store_true",
+ help="List defined channels and exit"),
Option("-c", "--channel", action="append",
help="Delete this channel (can be present multiple times)"),
Option("-u", "--unsubscribe", action="store_true",
help="Unsubscribe systems registered to the specificed channels"),
- Option( "--force", action="store_true",
- help="Remove the channel packages from any other channels too"),
Option( "--justdb", action="store_true",
help="Delete only from the database, do not remove files from disk"),
- Option("-l", "--list", action="store_true",
- help="List defined channels and exit"),
+ Option( "--force", action="store_true",
+ help="Remove the channel packages from any other channels too (Not Recommended)"),
+ Option("-p", "--skip-packages", action="store_true",
+ help="Do not remove package metadata or packages from the filesystem (Not Recommended)"),
]
@@ -110,7 +112,7 @@ def main():
try:
delete_channels(channels.keys(), force=options.force,
- justdb=options.justdb)
+ justdb=options.justdb, skip_packages=options.skip_packages)
except:
rhnSQL.rollback()
raise
@@ -238,7 +240,7 @@ def __listChannels():
return labels, parents
-def delete_channels(channelLabels, force=0, justdb=0):
+def delete_channels(channelLabels, force=0, justdb=0, skip_packages=0):
# Get the package ids
if not channelLabels:
return
@@ -248,10 +250,11 @@ def delete_channels(channelLabels, force=0, justdb=0):
srpms_ids = list_packages(channelLabels, force=force, sources=1)
srpms_paths = _get_package_paths(srpms_ids, sources=1)
- _delete_srpms(srpms_ids)
- _delete_rpms(rpms_ids)
+ if not skip_packages:
+ _delete_srpms(srpms_ids)
+ _delete_rpms(rpms_ids)
- if not justdb:
+ if not justdb and not skip_packages:
_delete_files(rpms_paths + srpms_paths)
# Get the channel ids