Merge ~ahasenack/ubuntu/+source/base-files:bionic-handle-was-removed-1895302 into ubuntu/+source/base-files:ubuntu/bionic-devel

Proposed by Andreas Hasenack
Status: Approved
Approved by: Andreas Hasenack
Approved revision: b150e0508df3cca986407a01382a35366986a71b
Proposed branch: ~ahasenack/ubuntu/+source/base-files:bionic-handle-was-removed-1895302
Merge into: ubuntu/+source/base-files:ubuntu/bionic-devel
Diff against target: 64 lines (+25/-7)
3 files modified
debian/changelog (+14/-0)
debian/motd-news-config.postinst (+1/-1)
debian/postinst.in (+10/-6)
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Approve
Canonical Server Core Reviewers Pending
Review via email: mp+390864@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

See comments on the Xenial MP.

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

After the discussion on the xenial mp, tagging and uploading b150e0508df3cca986407a01382a35366986a71b:

$ git push pkg upload/10.1ubuntu2.11
Enumerating objects: 26, done.
Counting objects: 100% (26/26), done.
Delta compression using up to 4 threads
Compressing objects: 100% (21/21), done.
Writing objects: 100% (21/21), 2.83 KiB | 964.00 KiB/s, done.
Total 21 (delta 15), reused 0 (delta 0)
To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/base-files
 * [new tag] upload/10.1ubuntu2.11 -> upload/10.1ubuntu2.11

$ dput ubuntu ../base-files_10.1ubuntu2.11_source.changes
Checking signature on .changes
gpg: ../base-files_10.1ubuntu2.11_source.changes: Valid signature from AC983EB5BF6BCBA9
Checking signature on .dsc
gpg: ../base-files_10.1ubuntu2.11.dsc: Valid signature from AC983EB5BF6BCBA9
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading base-files_10.1ubuntu2.11.dsc: done.
  Uploading base-files_10.1ubuntu2.11.tar.xz: done.
  Uploading base-files_10.1ubuntu2.11_source.buildinfo: done.
  Uploading base-files_10.1ubuntu2.11_source.changes: done.
Successfully uploaded packages.

Unmerged commits

b150e05... by Andreas Hasenack

changelog

c52d1d8... by Andreas Hasenack

    - d/motd-news-config.postinst: always remove /e/d/motd-news.wasremoved
      if present

5d4519c... by Andreas Hasenack

    - d/postinst.in: only consider creating the .wasremoved file in upgrades,
      never fresh installs like in debootstrap for example

4849a64... by Andreas Hasenack

    - d/postinst.in: re-arrange the cascading conditionals around the
      creation of the .wasremoved file for better clarity

dcfb8b4... by Andreas Hasenack

  * Fix handling of /e/d/motd-news.wasremoved (LP: #1895302):
    - d/postinst.in: check if ubuntu-server is installed before creating
      the .wasremoved file

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 3087eb8..c3e61e5 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,17 @@
6+base-files (10.1ubuntu2.11) bionic; urgency=medium
7+
8+ * Fix handling of /e/d/motd-news.wasremoved (LP: #1895302):
9+ - d/postinst.in: check if ubuntu-server is installed before creating
10+ the .wasremoved file
11+ - d/postinst.in: re-arrange the cascading conditionals around the
12+ creation of the .wasremoved file for better clarity
13+ - d/postinst.in: only consider creating the .wasremoved file in upgrades,
14+ never fresh installs like in debootstrap for example
15+ - d/motd-news-config.postinst: always remove /e/d/motd-news.wasremoved
16+ if present
17+
18+ -- Andreas Hasenack <andreas@canonical.com> Wed, 16 Sep 2020 10:58:22 -0300
19+
20 base-files (10.1ubuntu2.10) bionic; urgency=medium
21
22 [ Andreas Hasenack ]
23diff --git a/debian/motd-news-config.postinst b/debian/motd-news-config.postinst
24index a73427f..0be04fd 100644
25--- a/debian/motd-news-config.postinst
26+++ b/debian/motd-news-config.postinst
27@@ -33,9 +33,9 @@ case "$1" in
28 fi
29 if [ -e /etc/default/motd-news.wasremoved ] && [ -e /etc/default/motd-news ]; then
30 sed -i -e 's/^ENABLED=1/# Changed by motd-news-config.postinst:\n# config file was manually removed - disable the service\nENABLED=0/' /etc/default/motd-news
31- rm /etc/default/motd-news.wasremoved
32 fi
33 fi
34+ rm -f /etc/default/motd-news.wasremoved
35 ;;
36
37 abort-upgrade|abort-remove|abort-deconfigure)
38diff --git a/debian/postinst.in b/debian/postinst.in
39index c347a62..055c914 100644
40--- a/debian/postinst.in
41+++ b/debian/postinst.in
42@@ -130,12 +130,16 @@ fi
43 # it does not put back the file with default contents which would
44 # re-enable motd-news
45 motd_news_config="/etc/default/motd-news"
46-if [ ! -e ${motd_news_config} ]; then
47- if [ ! -e ${motd_news_config}.dpkg-remove ]; then
48- if [ ! -e ${motd_news_config}.dpkg-backup ]; then
49- touch ${motd_news_config}.wasremoved
50- fi
51- fi
52+# only in upgrades, never fresh installs like in debootstrap
53+if [ "$2" != "" ] && \
54+ [ ! -e ${motd_news_config} ] && \
55+ [ ! -e ${motd_news_config}.dpkg-remove ] && \
56+ [ ! -e ${motd_news_config}.dpkg-backup ]; then
57+ # The .wasremoved file only matters if ubuntu-server is installed,
58+ # because that's what will pull in motd-news-config
59+ if dpkg -l ubuntu-server 2>/dev/null | grep -q ^i; then
60+ touch ${motd_news_config}.wasremoved
61+ fi
62 fi
63
64 #DEBHELPER#

Subscribers

People subscribed via source and target branches