[node-patches] Change in ovirt-node[master]: [RFC] edit-node: Remove common prefix from package names
fabiand at fedoraproject.org
fabiand at fedoraproject.org
Thu May 30 13:30:02 UTC 2013
Fabian Deutsch has uploaded a new change for review.
Change subject: [RFC] edit-node: Remove common prefix from package names
......................................................................
[RFC] edit-node: Remove common prefix from package names
Previosuly the whole package name was used as the plugin name when
building the final isoname.
Now the common prefix (ovirt-node-plugin-) is removed to shorten the
final isoname.
Change-Id: I9e2c413741936d257b5394deb68cf0e2db643c16
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M tools/edit-node
1 file changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/06/15206/1
diff --git a/tools/edit-node b/tools/edit-node
index 19bb86d..f8febb9 100755
--- a/tools/edit-node
+++ b/tools/edit-node
@@ -1718,15 +1718,24 @@
An isoname suggestion
>>> edited_iso = "ovirt-node-iso-2.6.1-20120228.fc18.iso.edited.iso"
- >>> plugins = ["ovirt-node-plugin-igor", "3rd-plugin-cim"]
+ >>> plugins = ["ovirt-node-plugin-igor-slave", "3rd-plugin-cim"]
>>> build_isoname_for_plugins(edited_iso, plugins)
- 'ovirt-node-iso-2.6.1-.ovirt-node-plugin-igor_3rd-plugin-cim.fc18.iso'
+ 'ovirt-node-iso-2.6.1-20120228.igor-slave_3rd-plugin-cim.fc18.iso'
"""
def sane_name_for_plugin(plugin):
package = os.path.basename(plugin)
+
+ # Just include the package name if it's an rpm, not the whole filename
if package.endswith(".rpm"):
nvra = filename_to_nvra(package)
package = nvra[0]
+
+ # Remove the common prefix to shorten the final filename
+ common_prefix = "ovirt-node-plugin-"
+ if package.startswith(common_prefix):
+ cp_len = len(common_prefix)
+ package = package[cp_len:]
+
return package
plugins = plugins if type(plugins) is list else [plugins]
packages = [sane_name_for_plugin(p) for p in plugins]
--
To view, visit http://gerrit.ovirt.org/15206
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e2c413741936d257b5394deb68cf0e2db643c16
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>
More information about the node-patches
mailing list