Merge ~ahasenack/ubuntu/+source/base-files:groovy-motd-news-config-split into ubuntu/+source/base-files:ubuntu/devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Andreas Hasenack | ||||
Approved revision: | de0f896184fa1b0569ccb57207748e7a24fc6b85 | ||||
Merged at revision: | de0f896184fa1b0569ccb57207748e7a24fc6b85 | ||||
Proposed branch: | ~ahasenack/ubuntu/+source/base-files:groovy-motd-news-config-split | ||||
Merge into: | ubuntu/+source/base-files:ubuntu/devel | ||||
Diff against target: |
169 lines (+106/-2) 7 files modified
debian/base-files.maintscript (+1/-0) debian/changelog (+23/-0) debian/control (+13/-1) debian/motd-news-config.install (+1/-0) debian/motd-news-config.postinst (+55/-0) debian/postinst.in (+13/-0) debian/rules (+0/-1) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Christian Ehrhardt (community) | Approve | ||
Canonical Server Core Reviewers | Pending | ||
Review via email: mp+388835@code.launchpad.net |
Description of the change
Another attempt at this motd-news-config split, after vorlon's feedback to make motd-news-config a base-files package instead of a new source.
PPA with test builds (no ~ppaN suffix because of the precise breaks/replaces I have all over the place): https:/
The overall plan is to have motd-news only enabled on server systems after this upgrade. What it does:
- the /etc/default/
- ubuntu-server has a dependency on motd-news-config
- new base-files breaks old ubuntu-server, forcing an upgrade of ubuntu-server if it is installed
The versions used in these breaks/replaces have to be very precise for this to work, so between now and whenever these are uploaded, I'll check again.
For now in groovy we have:
base-files 11ubuntu10
ubuntu-meta 1.452
Therefore:
ubuntu-server 1.453:
Depends: motd-news-config
base-files 11ubuntu11:
Breaks/Replaces: ubuntu-server (<< 1.453)
rm_conffile /etc/default/
motd-news-config 11ubuntu11:
Breaks/Replaces: base-files (<< 11ubuntu11)
For the PPA ubuntu-meta package, I committed directly to src:ubuntu-meta instead of running its ./update script, as I couldn't convince that script to use a branch of mine instead of the official ubuntu seeds repository. The seeds change is in https:/
Here are the tests I've been running:
a) base-files installed, ubuntu-server installed, unmodified /e/d/motd-news
apt install base-files
- upgrades ubuntu-server
- installs motd-news-config
- /e/d/motd-news remains, motd-news remains enabled
b) base-files installed, ubuntu-server installed, modified /e/d/motd-news
apt install base-files
- upgrades ubuntu-server
- installs motd-news-config
- /e/d/motd-news remains with the original modification
c) base-files installed, ubuntu-server not installed, unmodified /e/d/motd-news
apt install base-files
- upgrades base-files
- removes /e/d/motd-news
- motd-news is disabled
d) base-files installed, ubuntu-server not installed, modified /e/d/motd-news
apt install base-files
- upgrades base-files
- /e/d/motd-news gets renamed to backup
- motd-news is disabled
e) removing motd-news-config will also remove ubuntu-server (since it's a depends, and not a recommends)
f) upgrading just ubuntu-server should pull motd-news-config in, and force-upgrade base-files
g) Removing motd-news-server leaves /e/d/motd-news around; purging motd-news-server removes the /e/d/motd-news config file
Great testing as always. motd-news which at first achieves the same thing (motd news is off)
I was not looking at re-running your tests, instead I wondered "what could happen" and a less surgical blunt user came to mind that just deleted /etc/default/
I tested that on ubuntu-server and without ubuntu-server.
Without Ubuntu-server it is ok, the file does not come back and stays disabled.
But with Ubuntu-server installed there is nothing rm_conffile of base-files does.
Therefore no artifact is left, and due to that the default file is placed (again) and thereby re-enabling the service :-/
# Working (default)
root@g2:~# bash -x /etc/update- motd.d/ 50-motd- news motd-news ']' motd-news /motd.ubuntu. com /motd.ubuntu. com ']' var/cache/ motd-news motd-news ']'
+ '[' -r /etc/default/
+ . /etc/default/
++ ENABLED=1
++ URLS=https:/
++ WAIT=5
+ '[' 1 = 1 ']'
+ '[' -n https:/
+ '[' -n 5 ']'
+ '[' -n '' ']'
+ CACHE=/
+ '[' '' = --force ']'
+ '[' '' '!=' 1 ']'
+ '[' -r /var/cache/
++ id -u
+ '[' 0 -eq 0 ']'
+ :
+ exit 0
# Remove file (disabled)
root@g2:~# rm /etc/default/ motd-news motd.d/ 50-motd- news motd-news ']'
root@g2:~# bash -x /etc/update-
+ '[' -r /etc/default/
+ '[' '' = 1 ']'
+ exit 0
# Upgrade re-enables
root@g2:~# add-apt-repository ppa:ahasenack/ zomg-2
More info: https:/ /launchpad. net/~ahasenack/ +archive/ ubuntu/ zomg-2
Press [ENTER] to continue or Ctrl-c to cancel adding it.
Hit:1 http:// archive. ubuntu. com/ubuntu groovy InRelease archive. ubuntu. com/ubuntu groovy-updates InRelease archive. ubuntu. com/ubuntu groovy-backports InRelease ppa.launchpad. net/ahasenack/ zomg-2/ ubuntu groovy InRelease [17.5 kB] security. ubuntu. com/ubuntu groovy-security InRelease ppa.launchpad. net/ahasenack/ zomg-2/ ubuntu groovy/main amd64 Packages [3772 B] ppa.launchpad. net/ahasenack/ zomg-2/ ubuntu groovy/main Translation-en [1056 B] ppa.launchpad. net/ahasenack/ zomg-2/ ubuntu groovy/main amd64 ubuntu-server amd64 1.453 [46.8 kB] ppa.launchpad. net/ahasenack/ zomg-2/ ubuntu groovy/main amd64 base-files amd64 11ubuntu11 [88.6 kB] ppa.launchpad. net/ahasenack/ zomg-2/ ubuntu groovy/main amd64 motd-news-config all 11ubuntu11 [32.5 kB] ppa.launchpad. net/ahasenack/ zomg-2/ ubuntu groovy/main amd64 ubuntu-minimal amd64 1.453 [46.9 ...
Hit:2 http://
Hit:3 http://
Get:4 http://
Hit:5 http://
Get:6 http://
Get:7 http://
Fetched 22.3 kB in 1s (27.7 kB/s)
Reading package lists... Done
root@g2:~#
root@g2:~#
root@g2:~# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
libfreetype6
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
motd-news-config
The following packages will be upgraded:
base-files ubuntu-minimal ubuntu-server ubuntu-standard
4 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 262 kB of archives.
After this operation, 45.1 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://