Merge "drop deprecated map-services/packages from zypper element"

This commit is contained in:
Jenkins 2017-05-31 02:11:21 +00:00 committed by Gerrit Code Review
commit 2bdc154df5
6 changed files with 20 additions and 170 deletions

View File

@ -22,6 +22,9 @@
"syslinux-common": "", "syslinux-common": "",
"tftp": "net-ftp/tftp-hpa", "tftp": "net-ftp/tftp-hpa",
"tgt": "sys-block/tgt" "tgt": "sys-block/tgt"
},
"suse": {
"qemu-utils": "qemu-tools"
} }
}, },
"default": { "default": {

View File

@ -7,6 +7,7 @@
}, },
"suse": { "suse": {
"dkms_package": "", "dkms_package": "",
"extlinux": "syslinux",
"grub-pc": "grub2" "grub-pc": "grub2"
}, },
"redhat": { "redhat": {

View File

@ -6,6 +6,9 @@
}, },
"redhat":{ "redhat":{
"ncat":"nmap-ncat" "ncat":"nmap-ncat"
},
"suse":{
"arping": "iputils"
} }
}, },
"default":{ "default":{

View File

@ -21,7 +21,7 @@ set -eu
set -o pipefail set -o pipefail
EXTRA_ARGS="--no-recommends" EXTRA_ARGS="--no-recommends"
MAP_ELEMENT="" MAP_ELEMENT=
ACTION=install ACTION=install
SCRIPTNAME=$(basename $0) SCRIPTNAME=$(basename $0)
@ -57,39 +57,16 @@ while true ; do
esac esac
done done
# Packages that aren't available in the distro but requested for installation PKGS=$@
# can be ignored by adding them to the exclude list if [ -n "$MAP_ELEMENT" ]; then
BLACKLIST=('') if ! PKGS=$(pkg-map --element $MAP_ELEMENT $@); then
WHITELIST=('') echo "bin/pkg-map error. $PKGS"
exit 1
for i in "$@"
do
PKG_NAME=$i
if [ -n "$MAP_ELEMENT" ]; then
if ! PKG_NAME=$(pkg-map --element $MAP_ELEMENT $i); then
echo "bin/pkg-map error. $PKG_NAME"
exit 1
fi
fi
if [[ ! ${BLACKLIST[*]} =~ $PKG_NAME ]]; then
WHITELIST+="$i "
else
echo "The package $i is not available and will not be installed"
fi
done
if [ -n "$WHITELIST" ]; then
if [ -n "$MAP_ELEMENT" ]; then
if ! PKGS=$(pkg-map --element $MAP_ELEMENT $WHITELIST); then
echo "bin/pkg-map error. $PKGS"
exit 1
fi
else
PKGS=$(map-packages $WHITELIST)
fi
if [ -z "${PKGS}" ]; then
echo 'No packages need to be installed'
else
run_zypper $ACTION $EXTRA_ARGS $PKGS
fi fi
fi fi
if [ -z "${PKGS}" ]; then
echo "Not running install-packages $ACTION with empty packages list"
else
run_zypper $ACTION $EXTRA_ARGS $PKGS
fi

View File

@ -1,68 +0,0 @@
#!/usr/bin/env python
# dib-lint: disable=indent
# dib-lint indent requirements causes issue with pep8
# Copyright 2013 SUSE Linux Products GmbH
#
# 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.
from __future__ import print_function
import sys
# Manually maintained for brevity; consider making this compiled from
# distromatch or other rich data sources.
# Debian name on the left, openSUSE on the right.
package_map = {
'arping': 'iputils',
'augeas-tools': 'augeas',
'build-essential': 'make automake gcc gcc-c++ kernel-devel',
'default-jre': 'java',
'extlinux': 'syslinux',
'grub-pc': 'grub2',
'libapache2-mod-wsgi': 'apache2-mod_wsgi',
'libc6-dev': 'glibc-devel',
'libffi-dev': 'libffi-devel',
'libmysql-java': 'mysql-connector-java',
'libmysqlclient-dev': 'libmysqlclient-devel',
'libssl-dev': 'openssl-devel',
'libvirt-bin': 'libvirt',
'libxml2-dev': 'libxml2-devel',
'libxslt-dev': 'libxslt-devel',
'libz-dev': 'zlib-devel',
'linux-image-generic': 'kernel-default',
'mysql-client-5.5': 'mariadb-client',
'mysql-server-5.5': 'mariadb',
'openjdk-7-jre-headless': 'java-1_7_0-openjdk-headless',
'openssh-client': 'openssh',
'openvswitch-common': 'openvswitch',
'openvswitch-datapath-dkms': 'openvswitch-kmp',
'openvswitch-switch': 'openvswitch-switch',
'python-dev': 'python-devel',
'python-libvirt': 'libvirt-python',
'python-memcache': 'python-python-memcached',
'python-mysqldb': 'python-mysql',
'python-pyopenssl': 'python-pyOpenSSL',
'qemu-utils': 'qemu-tools',
'tftpd-hpa': 'tftp',
# openstack related package remappings
'openstack-heat-common': 'openstack-heat',
'openstack-neutron-ml2': 'openstack-neutron',
'openstack-neutron-openvswitch': 'openstack-neutron-openvswitch-agent',
}
print("WARNING: map-packages is deprecated. Please use the pkg-map element.",
file=sys.stderr)
for arg in sys.argv[1:]:
print(package_map.get(arg, arg))
sys.exit(0)

View File

@ -1,66 +0,0 @@
#!/usr/bin/env python
# dib-lint: disable=indent
# Copyright 2012 Hewlett-Packard Development Company, L.P.
# Copyright 2014 SUSE, Inc.
#
# 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.
from __future__ import print_function
import os
import sys
# Manually maintained for brevity; consider making this compiled from
# distromatch or other rich data sources.
# Debian name on the left, openSUSE on the right.
service_map = {
# openstack mapping
'cinder-api': 'openstack-cinder-api',
'cinder-backup': 'openstack-cinder-backup',
'cinder-scheduler': 'openstack-cinder-scheduler',
'cinder-volume': 'openstack-cinder-volume',
'glance-api': 'openstack-glance-api',
'glance-reg': 'openstack-glance-registry',
'heat-api-cfn': 'openstack-heat-api-cfn',
'heat-api-cloudwatch': 'openstack-heat-api-cloudwatch',
'heat-api': 'openstack-heat-api',
'heat-engine': 'openstack-heat-engine',
'keystone': 'openstack-keystone',
'libvirt-bin': 'libvirtd',
'neutron-dhcp-agent': 'openstack-neutron-dhcp-agent',
'neutron-openvswitch-agent': 'openstack-neutron-openvswitch-agent',
'neutron-l3-agent': 'openstack-neutron-l3-agent',
'neutron-metadata-agent': 'openstack-neutron-metadata-agent',
'neutron-ovs-cleanup': 'openstack-neutron-ovs-cleanup',
'neutron-server': 'openstack-neutron',
'nova-api': 'openstack-nova-api',
'nova-cert': 'openstack-nova-cert',
'nova-compute': 'openstack-nova-compute',
'nova-conductor': 'openstack-nova-conductor',
'nova-consoleauth': 'openstack-nova-console',
'nova-baremetal-deploy-helper': 'openstack-nova-baremetal-deploy-helper',
'nova-novncproxy': 'openstack-nova-novncproxy',
'nova-scheduler': 'openstack-nova-scheduler',
}
print("WARNING: map-services has been deprecated. "
"Please use the svc-map element.", file=sys.stderr)
for arg in sys.argv[1:]:
# We need to support the service name being different when installing from
# source vs. packages. So, if the requested service file already exists,
# just use that.
if os.path.exists('/usr/lib/systemd/system/%s.service' % arg):
print(arg)
else:
print(service_map.get(arg, arg))
sys.exit(0)