Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary package rename (SC-1623) #2887

Merged
merged 12 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 50 additions & 12 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ Vcs-Browser: https://github.com/canonical/ubuntu-pro-client
Rules-Requires-Root: no

Package: ubuntu-advantage-tools
Depends: ubuntu-pro-client (>= ${binary:Version}), ${misc:Depends}
Architecture: all
Priority: optional
Section: oldlibs
Description: transitional dummy package for ubuntu-pro-client
This is a transitional dummy package for ubuntu-pro-client. It can safely be
removed.

Package: ubuntu-pro-client
Homepage: https://canonical-ubuntu-pro-client.readthedocs-hosted.com/
Architecture: any
Depends: ${misc:Depends},
${python3:Depends},
Expand All @@ -43,27 +53,55 @@ Depends: ${misc:Depends},
python3-pkg-resources,
${extra:Depends}
Recommends: ubuntu-pro-client-l10n
Description: management tools for Ubuntu Pro
Ubuntu Pro is the professional package of tooling, technology
and expertise from Canonical, helping organisations around the world
manage their Ubuntu deployments.
.
Subscribers to Ubuntu Pro will find helpful tools for accessing
services in this package.
Breaks: ubuntu-advantage-tools (<<31~)
Replaces: ubuntu-advantage-tools (<<31~)
# IMPORTANT: ubuntu-pro-client does not "Provide" ubuntu-advantage-tools
# At the time of the rename, existing releases with ubuntu-advantage-tools
# include xenial, bionic, focal, jammy, and mantic.
# We cannot allow ubuntu-advantage-tools <<31 to be removed on those releases,
# because it could break ESM (remove sources.list entries in prerm).
# On those releases, ubuntu-minimal (and ubuntu-cloud-minimal) Depends on
# ubuntu-advantage-tools, which prevents it from being removed without also
# removing ubuntu-minimal or ubuntu-cloud-minimal. We consider that to be a
# sufficient warning to users that removing ubuntu-advantage-tools is not
# supported.
# If ubuntu-pro-client were to "Provide" ubuntu-advantage-tools, then that
# mechanism would not work, and users could remove ubuntu-advantage-tools
# accidentally.
# ubuntu-pro-client could "Provide" ubuntu-advantage-tools in releases in the
# future, but it would not add any value over having the ubuntu-advantage-tools
# transitional dummy package.
Description: Management tools for Ubuntu Pro
Ubuntu Pro is a suite of additional services provided by Canonical on
top of Ubuntu. Whether you're an enterprise customer deploying systems
at scale or want security patching for your personal Ubuntu LTS
at home, the Ubuntu Pro Client (pro) is the command-line tool that
will help you manage the services you need.

Package: ubuntu-pro-client-l10n
Architecture: any
Depends: ${misc:Depends}, ubuntu-advantage-tools (>=30~)
Depends: ${misc:Depends}, ubuntu-pro-client (= ${binary:Version})
Description: Translations for Ubuntu Pro Client
This package delivers translations of Ubuntu Pro Client for various
languages.

Package: ubuntu-advantage-pro
Depends: ubuntu-pro-auto-attach, ${misc:Depends}
Architecture: all
Priority: optional
Section: oldlibs
Description: transitional dummy package for ubuntu-pro-auto-attach
This is a transitional dummy package for ubuntu-pro-auto-attach. It can
safely be removed.

Package: ubuntu-pro-auto-attach
Homepage: https://canonical-ubuntu-pro-client.readthedocs-hosted.com/en/latest/explanations/what_are_ubuntu_pro_cloud_instances/
Architecture: all
Depends: ${misc:Depends}, ubuntu-advantage-tools (>=20.2)
Replaces: ubuntu-advantage-tools (<<20.2)
Breaks: ubuntu-advantage-tools (<<20.2)
Description: Additional services for Ubuntu Pro images
Depends: ${misc:Depends}, ubuntu-pro-client (>=31~)
Breaks: ubuntu-advantage-pro (<<31~)
Replaces: ubuntu-advantage-pro (<<31~)
Provides: ubuntu-advantage-pro
Description: Service to auto-attach Ubuntu Pro cloud images
This package delivers an additional service that performs an auto-attach
operation for Ubuntu Pro cloud instances. This package should not be manually
installed, as it is already present on the cloud instances that require it.
6 changes: 3 additions & 3 deletions debian/po/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-17 16:08-0500\n"
"POT-Creation-Date: 2024-01-19 16:55-0500\n"
"PO-Revision-Date: 2023-09-25 12:29-0400\n"
"Last-Translator: Lucas Moura <[email protected]>\n"
"Language-Team: Brazilian Portuguese <[email protected]."
Expand Down Expand Up @@ -369,12 +369,12 @@ msgstr ""
msgid ""
" A new version is available: {version}\n"
"Please run:\n"
" sudo apt install ubuntu-advantage-tools\n"
" sudo apt install ubuntu-pro-client\n"
"to get the latest bug fixes and new features."
msgstr ""
" Uma nova versão está disponível: {version}\n"
"Por favor, execute:\n"
" sudo apt install ubuntu-advantage-tools\n"
" sudo apt install ubuntu-pro-client\n"
"para obter as últimas correções de erros e novas funcionalidades."

#. ##############################################################################
Expand Down
4 changes: 2 additions & 2 deletions debian/po/ubuntu-pro.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-17 16:08-0500\n"
"POT-Creation-Date: 2024-01-19 16:55-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -312,7 +312,7 @@ msgstr ""
msgid ""
" A new version is available: {version}\n"
"Please run:\n"
" sudo apt install ubuntu-advantage-tools\n"
" sudo apt install ubuntu-pro-client\n"
"to get the latest bug fixes and new features."
msgstr ""

Expand Down
56 changes: 28 additions & 28 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ include /etc/os-release
# the flag --supported-esm. Those versions are 0.18 and 0.14build1,
# respectively. So we set specific distro-info requirements for bionic and later
# versus Xenial to make those contraints applicable on each series.
DISTRO_INFO_DEPS="distro-info (>= 0.18ubuntu0.18.04.1),"
DISTRO_INFO_DEPS=distro-info (>= 0.18ubuntu0.18.04.1),

ifeq (${VERSION_ID},"16.04")
APT_PKG_DEPS="apt (>= 1.2.32), apt-transport-https (>= 1.2.32), apt-utils (>= 1.2.32), libapt-inst2.0 (>= 1.2.32), libapt-pkg5.0 (>= 1.2.32),"
DISTRO_INFO_DEPS="distro-info (>= 0.14ubuntu0.2),"
APT_PKG_DEPS=apt (>= 1.2.32), apt-transport-https (>= 1.2.32), apt-utils (>= 1.2.32), libapt-inst2.0 (>= 1.2.32), libapt-pkg5.0 (>= 1.2.32),
DISTRO_INFO_DEPS=distro-info (>= 0.14ubuntu0.2),
else ifeq (${VERSION_ID},"18.04")
APT_PKG_DEPS="apt (>= 1.6.11), apt-utils (>= 1.6.11), libapt-inst2.0 (>= 1.6.11), libapt-pkg5.0 (>= 1.6.11),"
else ifeq (${VERSION_ID},"19.04")
APT_PKG_DEPS="apt (>= 1.8.1), apt-utils (>= 1.8.1), libapt-inst2.0 (>= 1.8.1), libapt-pkg5.0 (>= 1.8.1),"
else ifeq (${VERSION_ID},"19.10")
APT_PKG_DEPS="apt (>= 1.8.1), apt-utils (>= 1.8.1), libapt-pkg5.90 (>= 1.8.1),"
APT_PKG_DEPS=apt (>= 1.6.11), apt-utils (>= 1.6.11), libapt-inst2.0 (>= 1.6.11), libapt-pkg5.0 (>= 1.6.11),
endif

%:
Expand All @@ -43,50 +39,54 @@ endif
endif

override_dh_gencontrol:
echo extra:Depends=$(APT_PKG_DEPS) $(DISTRO_INFO_DEPS) >> debian/ubuntu-advantage-tools.substvars
echo "extra:Depends=$(APT_PKG_DEPS) $(DISTRO_INFO_DEPS)" >> debian/ubuntu-pro-client.substvars
dh_gencontrol

override_dh_systemd_enable:
dh_systemd_enable -pubuntu-advantage-pro ua-auto-attach.service
dh_systemd_enable -pubuntu-advantage-tools ua-reboot-cmds.service
dh_systemd_enable -pubuntu-advantage-tools ua-timer.timer
dh_systemd_enable -pubuntu-advantage-tools ua-timer.service
dh_systemd_enable -pubuntu-advantage-tools ubuntu-advantage.service
dh_systemd_enable -pubuntu-pro-auto-attach ua-auto-attach.service
dh_systemd_enable -pubuntu-pro-client ua-reboot-cmds.service
dh_systemd_enable -pubuntu-pro-client ua-timer.timer
dh_systemd_enable -pubuntu-pro-client ua-timer.service
dh_systemd_enable -pubuntu-pro-client ubuntu-advantage.service
ifeq (${VERSION_ID},"16.04")
# Only enable cloud-id-shim on Xenial
dh_systemd_enable -pubuntu-advantage-tools ubuntu-advantage-cloud-id-shim.service
dh_systemd_enable -pubuntu-pro-client ubuntu-advantage-cloud-id-shim.service
endif

override_dh_systemd_start:
dh_systemd_start -pubuntu-advantage-tools ua-timer.timer
dh_systemd_start -pubuntu-advantage-tools ubuntu-advantage.service
dh_systemd_start -pubuntu-pro-client ua-timer.timer
dh_systemd_start -pubuntu-pro-client ubuntu-advantage.service

override_dh_auto_install:
dh_auto_install --destdir=debian/ubuntu-advantage-tools
dh_auto_install --destdir=debian/ubuntu-pro-client
debian/jinja2_render debian/apparmor/ubuntu_pro_apt_news.jinja2 debian/apparmor/ubuntu_pro_apt_news ubuntu_codename=${UBUNTU_CODENAME}
# quick syntax check on the generated profile
apparmor_parser -K -T -Q debian/apparmor/ubuntu_pro_apt_news
install -D -m 644 $(CURDIR)/debian/apparmor/ubuntu_pro_apt_news $(CURDIR)/debian/ubuntu-advantage-tools/etc/apparmor.d/ubuntu_pro_apt_news
dh_apparmor -pubuntu-advantage-tools --profile-name=ubuntu_pro_apt_news
install -D -m 644 $(CURDIR)/debian/apparmor/ubuntu_pro_apt_news $(CURDIR)/debian/ubuntu-pro-client/etc/apparmor.d/ubuntu_pro_apt_news
dh_apparmor -pubuntu-pro-client --profile-name=ubuntu_pro_apt_news

flist=$$(find $(CURDIR)/debian/ -type f -name version.py) && sed -i 's,@@PACKAGED_VERSION@@,$(DEB_VERSION),' $${flist:-did-not-find-version-py-for-replacement}

# We install the conf file even on non-LTS version to avoid issues on upgrade scenarios
make -C apt-hook DESTDIR=$(CURDIR)/debian/ubuntu-advantage-tools install-conf
make -C apt-hook DESTDIR=$(CURDIR)/debian/ubuntu-advantage-tools install
make -C apt-hook DESTDIR=$(CURDIR)/debian/ubuntu-pro-client install-conf
make -C apt-hook DESTDIR=$(CURDIR)/debian/ubuntu-pro-client install

# We want to guarantee that we are not shipping any conftest files
find $(CURDIR)/debian/ubuntu-advantage-tools -type f -name conftest.py -delete
find $(CURDIR)/debian/ubuntu-pro-client -type f -name conftest.py -delete

ifneq (${VERSION_ID},"16.04")
# Only install cloud-id-shim on Xenial
rm $(CURDIR)/debian/ubuntu-advantage-tools/lib/systemd/system/ubuntu-advantage-cloud-id-shim.service
rm $(CURDIR)/debian/ubuntu-pro-client/lib/systemd/system/ubuntu-advantage-cloud-id-shim.service
endif

# Move ua-auto-attach.service out to ubuntu-advantage-pro
mkdir -p debian/ubuntu-advantage-pro/lib/systemd/system
mv debian/ubuntu-advantage-tools/lib/systemd/system/ua-auto-attach.* debian/ubuntu-advantage-pro/lib/systemd/system
cd debian/ubuntu-advantage-tools
# Move ua-auto-attach.service out to ubuntu-pro-auto-attach
mkdir -p debian/ubuntu-pro-auto-attach/lib/systemd/system
mv debian/ubuntu-pro-client/lib/systemd/system/ua-auto-attach.* debian/ubuntu-pro-auto-attach/lib/systemd/system

# move migration scripts from before the package rename into ubuntu-advantage-tools
mkdir -p debian/ubuntu-advantage-tools/usr/lib/ubuntu-advantage
mv debian/ubuntu-pro-client/usr/lib/ubuntu-advantage/migrate_user_config.py debian/ubuntu-advantage-tools/usr/lib/ubuntu-advantage
mv debian/ubuntu-pro-client/usr/lib/ubuntu-advantage/patch_status_json.py debian/ubuntu-advantage-tools/usr/lib/ubuntu-advantage


override_dh_auto_clean:
Expand Down
3 changes: 0 additions & 3 deletions debian/ubuntu-advantage-pro.lintian-overrides

This file was deleted.

14 changes: 9 additions & 5 deletions debian/ubuntu-advantage-tools.lintian-overrides
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# We are silencing this issue because of this LP: #1930121
ubuntu-advantage-tools: command-with-path-in-maintainer-script

# Ubuntu doesn't support sysv init.d
ubuntu-advantage-tools: package-supports-alternative-init-but-no-init.d-script
ubuntu-advantage-tools: possible-bashism-in-maintainer-script

# We have made the decision of delivering those files
ubuntu-advantage-tools: package-installs-apt-preferences
# python3 is a transitive dependency via ubuntu-pro-client
ubuntu-advantage-tools: python3-script-but-no-python3-dep

ubuntu-advantage-tools: possible-bashism-in-maintainer-script
# This is only to cleanup an old tmp file
ubuntu-advantage-tools: possibly-insecure-handling-of-tmp-files-in-maintainer-script /tmp [postinst:61]

# systemctl is the only way to do these calls, and we do the required check before calling it
ubuntu-advantage-tools: maintainer-script-calls-systemctl [postinst:260]
ubuntu-advantage-tools: maintainer-script-calls-systemctl [postinst:263]
10 changes: 0 additions & 10 deletions debian/ubuntu-advantage-tools.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ case "$1" in
rm_old_license_check_marker
disable_new_timer_if_old_timer_already_disabled
remove_old_systemd_units
/usr/lib/ubuntu-advantage/cloud-id-shim.sh || true

# On old version of ubuntu-advantange-tools, we don't have a public
# machine_token.json file on attached machines. Since the non-root
Expand All @@ -474,15 +473,6 @@ case "$1" in
if dpkg --compare-versions "$PREVIOUS_PKG_VER" lt "29~"; then
rename_gpg_keys
fi

if grep -q "^ua_config:" /etc/ubuntu-advantage/uaclient.conf; then
echo "Warning: uaclient.conf contains old ua_config field." >&2
echo " Please do the following:" >&2
echo " 1. Run 'pro config set field=value' for each field/value pair" >&2
echo " present under ua_config in /etc/ubuntu-advantage/uaclient.conf" >&2
echo " 2. Delete ua_config and all sub-fields in" >&2
echo " /etc/ubuntu-advantage/uaclient.conf" >&2
fi
;;
esac

Expand Down
26 changes: 0 additions & 26 deletions debian/ubuntu-advantage-tools.postrm
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,7 @@
set -e


remove_apt_auth(){
# config file created at runtime, needs explicit handling on purge
rm -f /etc/apt/auth.conf.d/90ubuntu-advantage
}

remove_cache_dir(){
rm -rf /var/lib/ubuntu-advantage
}

remove_logs(){
rm -f /var/log/ubuntu-advantage.log*
rm -f /var/log/ubuntu-advantage-timer.log*
rm -f /var/log/ubuntu-advantage-license-check.log*
rm -f /var/log/ubuntu-advantage-daemon.log*
}

remove_gpg_files(){
rm -f /etc/apt/trusted.gpg.d/ubuntu-pro-*.gpg
}

case "$1" in
purge)
remove_apt_auth
remove_cache_dir
remove_logs
remove_gpg_files
;;
abort-install|abort-upgrade)
# LP: #2004280
if dpkg --compare-versions "$2" lt "27.14~"; then
Expand Down
3 changes: 3 additions & 0 deletions debian/ubuntu-pro-auto-attach.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Avoid warning on wanted-by-target

ubuntu-pro-auto-attach: systemd-service-file-refers-to-unusual-wantedby-target
File renamed without changes.
8 changes: 8 additions & 0 deletions debian/ubuntu-pro-client.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Ubuntu doesn't support sysv init.d
ubuntu-pro-client: package-supports-alternative-init-but-no-init.d-script

# We have made the decision of delivering those files
ubuntu-pro-client: package-installs-apt-preferences

# This is intentional
ubuntu-pro-client: uses-dpkg-database-directly [usr/lib/ubuntu-advantage/apt-esm-json-hook]
Loading
Loading