2016-07-08 16:15:08 +00:00
|
|
|
#!/usr/local/bin/dib-python
|
2014-10-22 15:24:04 +00:00
|
|
|
# dib-lint: disable=indent
|
|
|
|
# dib-lint indent requirements causes issue with pep8
|
2013-02-13 22:16:00 +00:00
|
|
|
|
|
|
|
# Copyright 2012 Hewlett-Packard Development Company, L.P.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
|
|
# not use this file except in compliance with the License. You may obtain
|
|
|
|
# a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
# License for the specific language governing permissions and limitations
|
|
|
|
# under the License.
|
|
|
|
|
2014-10-22 15:24:04 +00:00
|
|
|
from __future__ import print_function
|
2013-02-13 22:16:00 +00:00
|
|
|
import sys
|
|
|
|
|
|
|
|
# Manually maintained for brevity; consider making this compiled from
|
|
|
|
# distromatch or other rich data sources.
|
2014-02-18 22:14:43 +00:00
|
|
|
# Debian name on the left, Fedora/RHEL on the right.
|
2017-01-17 20:05:17 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# !!! DO NOT ADD ANY ENTRIES TO THIS FILE !!!
|
|
|
|
#
|
|
|
|
# This global list has been deprecated by the pkg-map element. New
|
|
|
|
# package mappings should go in pkg-map files inside each element.
|
|
|
|
#
|
2013-02-13 22:16:00 +00:00
|
|
|
package_map = {
|
2014-02-28 01:05:02 +00:00
|
|
|
'apache2': 'httpd',
|
|
|
|
'arping': 'iputils',
|
|
|
|
'augeas-tools': 'augeas',
|
|
|
|
'build-essential': 'make automake gcc gcc-c++ kernel-devel',
|
|
|
|
'default-jre': 'java',
|
|
|
|
'extlinux': 'syslinux-extlinux',
|
|
|
|
'gearman-job-server': 'gearmand',
|
2013-04-02 00:25:25 +00:00
|
|
|
'grub-pc': 'grub2-tools grub2',
|
2014-02-28 22:35:58 +00:00
|
|
|
'libaio1': 'libaio',
|
2014-02-28 01:05:02 +00:00
|
|
|
'libapache2-mod-wsgi': 'mod_wsgi',
|
|
|
|
'libc6-dev': 'glibc-devel',
|
2014-03-05 14:56:50 +00:00
|
|
|
'libmariadb-dev': 'mariadb-devel',
|
2014-03-24 14:23:39 +00:00
|
|
|
'libffi-dev': 'libffi-devel',
|
|
|
|
'libldap2-dev': 'python-ldap',
|
|
|
|
'libmysql-dev': 'mysql++-devel',
|
2014-02-28 01:05:02 +00:00
|
|
|
'libmysql-java': 'mysql-connector-java',
|
|
|
|
'libmysqlclient-dev': 'mysql-devel',
|
2014-03-24 14:23:39 +00:00
|
|
|
'libpq-dev': 'libpqxx-devel',
|
|
|
|
'libxslt-dev': 'libxslt-devel',
|
|
|
|
'libsasl2-dev': 'cyrus-sasl-devel',
|
|
|
|
'libsqlite3-dev': 'libsqlite3x-devel',
|
2014-02-28 01:05:02 +00:00
|
|
|
'libssl-dev': 'openssl-devel',
|
|
|
|
'libvirt-bin': 'libvirt',
|
2014-03-24 14:23:39 +00:00
|
|
|
'libxml2-dev': 'libxml2-devel',
|
2014-02-28 01:05:02 +00:00
|
|
|
'libz-dev': 'zlib-devel',
|
2014-04-24 17:44:40 +00:00
|
|
|
'linux-headers-generic': 'kernel-headers',
|
2013-02-13 22:16:00 +00:00
|
|
|
'linux-image-generic': 'kernel',
|
2014-02-28 01:05:02 +00:00
|
|
|
'lm-sensors': 'lm_sensors',
|
|
|
|
'mysql-client-5.5': 'mariadb',
|
|
|
|
'mysql-server-5.5': 'mariadb-server',
|
|
|
|
'nagios-plugins-basic': 'nagios-plugins-all',
|
2018-08-03 15:19:09 +00:00
|
|
|
'netcat-openbsd': 'nmap-ncat',
|
2014-03-05 19:31:28 +00:00
|
|
|
'nfs-common': 'nfs-utils',
|
2014-02-28 01:05:02 +00:00
|
|
|
'nfs-kernel-server': 'nfs-utils',
|
2013-02-13 22:16:00 +00:00
|
|
|
'open-iscsi': 'iscsi-initiator-utils',
|
2014-04-22 10:38:55 +00:00
|
|
|
'openjdk-7-jre-headless': 'java-1.7.0-openjdk-headless',
|
2014-02-28 01:05:02 +00:00
|
|
|
'openssh-client': 'openssh-clients',
|
|
|
|
'openvswitch-common': 'openvswitch',
|
|
|
|
'openvswitch-switch': 'openvswitch',
|
2014-03-24 14:23:39 +00:00
|
|
|
'python-dev': 'python-devel',
|
2013-04-23 10:57:25 +00:00
|
|
|
'python-libvirt': 'libvirt-python',
|
|
|
|
'python-memcache': 'python-memcached',
|
|
|
|
'python-mysqldb': 'MySQL-python',
|
|
|
|
'python-numpy': 'numpy',
|
2013-06-20 10:02:18 +00:00
|
|
|
'python-pyopenssl': 'pyOpenSSL',
|
2014-02-28 01:05:02 +00:00
|
|
|
'python-xattr': 'pyxattr',
|
|
|
|
'qemu-utils': 'qemu-img',
|
2013-08-07 20:44:55 +00:00
|
|
|
'qpid-client': 'qpid-cpp-client',
|
2014-02-28 01:05:02 +00:00
|
|
|
'qpidd': 'qpid-cpp-server',
|
2014-01-30 17:18:07 +00:00
|
|
|
'snmp-mibs-downloader': '',
|
2014-02-28 01:05:02 +00:00
|
|
|
'snmpd': 'net-snmp',
|
|
|
|
'stunnel4': 'stunnel',
|
|
|
|
'tftpd-hpa': 'tftp-server',
|
|
|
|
'tgt': 'scsi-target-utils',
|
|
|
|
'vlan': 'vconfig',
|
2014-02-06 22:10:38 +00:00
|
|
|
# openstack mappings
|
|
|
|
'openstack-neutron-dhcp-agent': 'openstack-neutron',
|
2014-02-17 21:37:34 +00:00
|
|
|
}
|
2013-02-13 22:16:00 +00:00
|
|
|
|
2017-01-17 20:05:17 +00:00
|
|
|
deprecated = []
|
2013-02-13 22:16:00 +00:00
|
|
|
for arg in sys.argv[1:]:
|
2014-01-17 08:10:13 +00:00
|
|
|
if arg not in package_map and arg.endswith('-dev'):
|
|
|
|
# convert -dev into devel
|
2017-01-17 20:05:17 +00:00
|
|
|
converted = '%s%s' % (arg, 'el')
|
|
|
|
deprecated.append((arg, converted))
|
|
|
|
print(converted)
|
2014-01-17 08:10:13 +00:00
|
|
|
else:
|
2017-01-17 20:05:17 +00:00
|
|
|
converted = package_map.get(arg, arg)
|
|
|
|
if converted != arg:
|
|
|
|
deprecated.append((arg, converted))
|
|
|
|
print(converted)
|
|
|
|
|
|
|
|
if deprecated:
|
|
|
|
print("WARNING: The following packages were re-mapped by "
|
|
|
|
"redhat-common map-packages\n"
|
|
|
|
"They should be converted to pkg-map:", file=sys.stderr)
|
|
|
|
for arg, converted in deprecated:
|
|
|
|
print(" %s -> %s" % (arg, converted), file=sys.stderr)
|
|
|
|
|
2013-02-13 22:16:00 +00:00
|
|
|
sys.exit(0)
|
2017-01-17 20:05:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Tell emacs to use python-mode
|
|
|
|
# Local variables:
|
|
|
|
# mode: python
|
|
|
|
# End:
|