Merge "Deprecate dib-python; remove from in-tree elements"

This commit is contained in:
Zuul 2020-08-07 09:57:12 +00:00 committed by Gerrit Code Review
commit 1291dcba51
15 changed files with 19 additions and 43 deletions

View File

@ -1,3 +1,2 @@
debootstrap
dib-python
pkg-map

View File

@ -73,13 +73,6 @@ to_install+="busybox sudo "
# required for dpkg element to be able to add apt keys
to_install+="gnupg2 "
if [ "$DIB_PYTHON_VERSION" == "2" ]; then
to_install+="python "
elif [ "$DIB_PYTHON_VERSION" == "3" ]; then
to_install+="python3 "
else
echo "ERROR: DIB_PYTHON_VERSION is '$DIB_PYTHON_VERSION' but needs to be 2 or 3"
exit 1
fi
to_install+="python3 "
$apt_get install -y $to_install

View File

@ -2,6 +2,11 @@
dib-python
==========
.. note::
This element is deprecated. All distributions support Python 3 so
tools running in the chroot can simply use ``/usr/bin/python3``.
Adds a symlink to ``/usr/local/bin/dib-python`` which points at either a
``python2`` or ``python3`` executable as appropriate.

View File

@ -1,4 +1,4 @@
#!/usr/local/bin/dib-python
#!/usr/bin/env python3
# Copyright 2017 Red Hat, Inc.
#

View File

@ -1,4 +1,4 @@
#!/usr/local/bin/dib-python
#!/usr/bin/env python3
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
@ -14,8 +14,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import print_function
import argparse
import json
import locale

View File

@ -1,3 +1,2 @@
dib-python
install-bin
pkg-map

View File

@ -1,4 +1,4 @@
#!/usr/local/bin/dib-python
#!/usr/bin/env python3
# Copyright 2014 Red Hat Inc.
#

View File

@ -1 +0,0 @@
dib-python

View File

@ -1 +0,0 @@
dib-python

View File

@ -1,4 +1,4 @@
#!/usr/local/bin/dib-python
#!/usr/bin/env python3
#
# 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

View File

@ -1,4 +1,4 @@
#!/usr/local/bin/dib-python
#!/usr/bin/env python3
# dib-lint: disable=indent
# dib-lint indent requirements causes issue with pep8
@ -16,7 +16,6 @@
# 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

View File

@ -1,4 +1,4 @@
#!/usr/local/bin/dib-python
#!/usr/bin/env python3
# Copyright 2012 Hewlett-Packard Development Company, L.P.
# Copyright 2014 Red Hat, Inc.

View File

@ -56,17 +56,6 @@ if [ $DIB_RELEASE != "trusty" ] && [ $DIB_RELEASE != "xenial" ]; then
fi
# default required
to_install+="busybox sudo " # dib-lint: safe_sudo
# required for dpkg element to be able to add apt keys
to_install+="gnupg2 "
if [ "$DIB_PYTHON_VERSION" == "2" ]; then
to_install+="python "
elif [ "$DIB_PYTHON_VERSION" == "3" ]; then
to_install+="python3 "
else
echo "ERROR: DIB_PYTHON_VERSION is '$DIB_PYTHON_VERSION' but needs to be 2 or 3"
exit 1
fi
to_install+="busybox sudo python3 " # dib-lint: safe_sudo
$apt_get install -y $to_install

View File

@ -51,15 +51,6 @@ if [ $DIB_RELEASE != "trusty" ] && [ $DIB_RELEASE != "xenial" ]; then
fi
# default required
to_install+="sudo " # dib-lint: safe_sudo
if [ "$DIB_PYTHON_VERSION" == "2" ]; then
to_install+="python "
elif [ "$DIB_PYTHON_VERSION" == "3" ]; then
to_install+="python3 "
else
echo "ERROR: DIB_PYTHON_VERSION is '$DIB_PYTHON_VERSION' but needs to be 2 or 3"
exit 1
fi
to_install+="sudo python3 " # dib-lint: safe_sudo
$apt_get install -y $to_install

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
The ``dib-python`` element is deprecated. In chroot Python tools
should use ``#!/usrbin/env python3`` on all distributions now.