めんてなのおしごと

Sat, Mar 23, 2019 in debian debian , unblock , bts , release

今回はubuntu-keyringパッケージを題材に「full freeze期間に入ってしまったが、unstableにあるパッケージをリリース対象=testingに入れたい」場合の手順をメモしてみました。


まず、testingにあるバージョンとunstableにあるバージョンの差分(diff)を生成します。今だとgit diffでも良さそうな気はするのですが、慣例的にはソースパッケージに対してdebdiffを使って作ります。ソースパッケージをdgetコマンドで取得し、.dscファイルに対してdebdiffコマンドを実行しています。ソースパッケージのURLはdistro trackerからコピペしていますが、別のやり方もあるでしょう。

$ dget http://deb.debian.org/debian/pool/main/u/ubuntu-keyring/ubuntu-keyring_2018.09.18.1-4.dsc \
       http://deb.debian.org/debian/pool/main/u/ubuntu-keyring/ubuntu-keyring_2018.09.18.1-5.dsc
$ debdiff ubuntu-keyring_2018.09.18.1-4.dsc ubuntu-keyring_2018.09.18.1-5.dsc > ubuntu-keyring.diff

diffが出来たので、これを元にunblockリクエストをバグ登録します。ツールとしてはreportbugコマンドを使うとウィザード形式で行ってくれるので間違いがなくて楽です。reportbugはreportbug <package>という形でパッケージを指定してバグ登録するのですが、今回のような場合はリリース関連の調整をトラッキングするための疑似パッケージ(psuedo package)であるrelease.debian.orgを指定します。

$ reportbug release.debian.org
Detected character set: UTF-8
Please change your locale if this is incorrect.

Using 'Hideki Yamane <henrich@debian.org>' as your from address.
Will send report to Debian (per lsb_release).
What sort of request is this? (If none of these things mean anything to you, or you are trying to report a bug in an existing package, please press Enter to exit reportbug.)

1 binnmu      binNMU requests
2 britney     testing migration script bugs
3 other       None of the other options
4 rm          Stable/Testing removal requests
5 stretch-pu  stretch proposed updates requests
6 transition  transition tracking
7 unblock     unblock requests

Choose the request type:

今回行いたいのはunblockなので"7"を選びます。続けて対象となるパッケージ名(今回はubuntu-keyring)を入力します。

Choose the request type: 7
Please enter the name of the package: ubuntu-keyring
Checking status database...
Latest version seems to be 2018.09.18.1-1, is this the proper one ? [Y|n|?]?

最新バージョンのチェックが行われます…あれ?間違ってますね。なんでだろう?このバージョンはtestingにも無いんですが…謎だ。仕方がないので"n"を入力して現在の最新版である2018.09.18.1-5を入力。

Latest version seems to be 2018.09.18.1-1, is this the proper one ? [Y|n|?]? n
Please enter the version of the package: 2018.09.18.1-5

するとテンプレートが埋められて雛形が出来上がり、sensible-editorで指定されたエディタが立ち上がります

Subject: unblock: ubuntu-keyring/2018.09.18.1-5
Package: release.debian.org
User: release.debian.org@packages.debian.org
Usertags: unblock
Severity: normal

Please unblock package ubuntu-keyring

(explain the reason for the unblock here)

(include/attach the debdiff against the package in testing)

unblock ubuntu-keyring/2018.09.18.1-5

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-3-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8), LANGUAGE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

(include/attach the debdiff against the package in testing)の所を消して、先程作ったdiffを貼り付け、(explain the reason for the unblock here)のところに理由を書いて送ります。出来上がりはこんな感じ。

Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

 Please unblock package ubuntu-keyring

 * This update fixes file removal at maintainer script, and also deals with symlink
   removal that the package in testing doesn't create properly as below

>>      # force remove garbage that was created by previous version, oh moron...
>>      rm -f /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cloud-archive\,\ ubuntu-cloud-removed-keys.gpg

 * ubuntu-keyring is leaf package, no package will be affected with this
   change if there would be a regression ;)

>> $ apt-rdepends -r ubuntu-keyring
>> ubuntu-keyring
>>  Reverse Depends: ubuntu-archive-keyring (2018.09.18.1-5)

 ubuntu-archive-keyring is just a transitional package.


 Here's a debdiff.

diff -Nru ubuntu-keyring-2018.09.18.1/debian/changelog ubuntu-keyring-2018.09.18.1/debian/changelog
--- ubuntu-keyring-2018.09.18.1/debian/changelog	2019-02-07 00:26:23.000000000 +0900
+++ ubuntu-keyring-2018.09.18.1/debian/changelog	2019-03-12 01:40:45.000000000 +0900
@@ -1,3 +1,16 @@
+ubuntu-keyring (2018.09.18.1-5) unstable; urgency=medium
+
+  * debian/*.post{inst,rm}
+    - use apt-config(8)'s Dir::Etc::trustedparts and fix keyring removal error.
+      Thanks to Linda Lapinlampi <linda@lindalap.fi> and
+      Hiroyuki YAMAMORI <h-yamamo@db3.so-net.ne.jp> (Closes: #922176, #922177)
+  * debian/ubuntu-dbgsym-keyring.templates
+    - add ubuntu-dbgsym-keyring.gpg (See #922348)
+  * debian/control
+    - add Rules-Requires-Root: no
+
+ -- Hideki Yamane <henrich@debian.org>  Tue, 12 Mar 2019 01:40:45 +0900
+
 ubuntu-keyring (2018.09.18.1-4) unstable; urgency=medium
 
   * debian/control
diff -Nru ubuntu-keyring-2018.09.18.1/debian/control ubuntu-keyring-2018.09.18.1/debian/control
--- ubuntu-keyring-2018.09.18.1/debian/control	2019-02-07 00:26:23.000000000 +0900
+++ ubuntu-keyring-2018.09.18.1/debian/control	2019-03-12 01:40:45.000000000 +0900
@@ -8,6 +8,7 @@
 Homepage: https://launchpad.net/ubuntu/+source/ubuntu-keyring
 Vcs-Git: https://salsa.debian.org/debian/ubuntu-keyring.git
 Vcs-Browser: https://salsa.debian.org/debian/ubuntu-keyring
+Rules-Requires-Root: no
 
 Package: ubuntu-archive-keyring
 Architecture: all
diff -Nru ubuntu-keyring-2018.09.18.1/debian/ubuntu-cloud-keyring.postinst ubuntu-keyring-2018.09.18.1/debian/ubuntu-cloud-keyring.postinst
--- ubuntu-keyring-2018.09.18.1/debian/ubuntu-cloud-keyring.postinst	2019-02-07 00:26:23.000000000 +0900
+++ ubuntu-keyring-2018.09.18.1/debian/ubuntu-cloud-keyring.postinst	2019-03-12 01:40:45.000000000 +0900
@@ -5,15 +5,26 @@
 case "$1" in
     install|configure)
 
+      # force remove garbage that was created by previous version, oh moron...
+      rm -f /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cloud-archive\,\ ubuntu-cloud-removed-keys.gpg
+
+
+      TRUSTEDPARTS="/etc/apt/trusted.gpg.d/"
+      eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::trustedparts/d)"
+
+      # once clean up keyrings
+      rm -f "${TRUSTEDPARTS}ubuntu-keyring-2012-cloud-archive.gpg" \
+            "${TRUSTEDPARTS}ubuntu-keyring-2012-removed-keys.gpg"
+
       . /usr/share/debconf/confmodule
       db_version 2.0
       db_get ubuntu-cloud-keyring/keyring
 
       if [ -n "$RET" ]; then
-        for keyring in "$RET"
+        selected=$(echo "$RET" | sed -e 's/, /\n/g')
+        echo "$selected" | while read keyring
         do
-          rm -f /etc/apt/trusted.gpg.d/"$keyring".gpg
-          ln -sf /usr/share/keyrings/"$keyring".gpg /etc/apt/trusted.gpg.d/
+          ln -sf "/usr/share/keyrings/${keyring}.gpg" "$TRUSTEDPARTS"
         done
       fi
 
diff -Nru ubuntu-keyring-2018.09.18.1/debian/ubuntu-cloud-keyring.postrm ubuntu-keyring-2018.09.18.1/debian/ubuntu-cloud-keyring.postrm
--- ubuntu-keyring-2018.09.18.1/debian/ubuntu-cloud-keyring.postrm	2019-02-07 00:26:23.000000000 +0900
+++ ubuntu-keyring-2018.09.18.1/debian/ubuntu-cloud-keyring.postrm	2019-03-12 01:40:45.000000000 +0900
@@ -5,9 +5,12 @@
 case "$1" in
     purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
 
-        rm -f /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cloud-archive.gpg \
-              /etc/apt/trusted.gpg.d/ubuntu-cloud-removed-keys.gpg \
-              /etc/apt/trusted.gpg.d/ubuntu-cloud-keyring.gpg
+        TRUSTEDPARTS="/etc/apt/trusted.gpg.d/"
+        eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::trustedparts/d)"
+
+        rm -f "${TRUSTEDPARTS}ubuntu-keyring-2012-cloud-archive.gpg" \
+              "${TRUSTEDPARTS}ubuntu-cloud-removed-keys.gpg" \
+              "${TRUSTEDPARTS}ubuntu-cloud-keyring.gpg"
 
     ;;
     *)
diff -Nru ubuntu-keyring-2018.09.18.1/debian/ubuntu-dbgsym-keyring.postinst ubuntu-keyring-2018.09.18.1/debian/ubuntu-dbgsym-keyring.postinst
--- ubuntu-keyring-2018.09.18.1/debian/ubuntu-dbgsym-keyring.postinst	2019-02-07 00:26:23.000000000 +0900
+++ ubuntu-keyring-2018.09.18.1/debian/ubuntu-dbgsym-keyring.postinst	2019-03-12 01:40:45.000000000 +0900
@@ -5,15 +5,28 @@
 case "$1" in
     install|configure)
 
+      # remove garbage that was created by previous version, oh moron...
+      rm -f /etc/apt/trusted.gpg.d/ubuntu-keyring-2016-dbgsym.gpg\,\ *
+      rm -f /etc/apt/trusted.gpg.d/ubuntu-dbgsym-removed-keys.gpg\,\ *
+
+
+      TRUSTEDPARTS="/etc/apt/trusted.gpg.d/"
+      eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::trustedparts/d)"
+
+      # once clean up keyrings
+      rm -f "${TRUSTEDPARTS}ubuntu-keyring-2016-dbgsym.gpg" \
+            "${TRUSTEDPARTS}ubuntu-dbgsym-removed-keys.gpg" \
+            "${TRUSTEDPARTS}ubuntu-dbgsym-keyring.gpg"
+
       . /usr/share/debconf/confmodule
       db_version 2.0
       db_get ubuntu-dbgsym-keyring/keyring
 
       if [ -n "$RET" ]; then
-        for keyring in "$RET"
+        selected=$(echo "$RET" | sed -e 's/, /\n/g')
+        echo "$selected" | while read keyring
         do
-          rm -f /etc/apt/trusted.gpg.d/"$keyring".gpg
-          ln -sf /usr/share/keyrings/"$keyring".gpg /etc/apt/trusted.gpg.d/
+          ln -sf "/usr/share/keyrings/${keyring}.gpg" "$TRUSTEDPARTS"
         done
       fi
 
diff -Nru ubuntu-keyring-2018.09.18.1/debian/ubuntu-dbgsym-keyring.postrm ubuntu-keyring-2018.09.18.1/debian/ubuntu-dbgsym-keyring.postrm
--- ubuntu-keyring-2018.09.18.1/debian/ubuntu-dbgsym-keyring.postrm	2019-02-07 00:26:23.000000000 +0900
+++ ubuntu-keyring-2018.09.18.1/debian/ubuntu-dbgsym-keyring.postrm	2019-03-12 01:40:45.000000000 +0900
@@ -5,9 +5,12 @@
 case "$1" in
     purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
 
-        rm -f /etc/apt/trusted.gpg.d/ubuntu-keyring-2016-dbgsym.gpg \
-              /etc/apt/trusted.gpg.d/ubuntu-dbgsym-removed-keys.gpg \
-              /etc/apt/trusted.gpg.d/ubuntu-dbgsym-keyring.gpg
+        TRUSTEDPARTS="/etc/apt/trusted.gpg.d/"
+        eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::trustedparts/d)"
+
+        rm -f "${TRUSTEDPARTS}ubuntu-keyring-2016-dbgsym.gpg" \
+              "${TRUSTEDPARTS}ubuntu-dbgsym-removed-keys.gpg" \
+              "${TRUSTEDPARTS}ubuntu-dbgsym-keyring.gpg"
 
     ;;
     *)
diff -Nru ubuntu-keyring-2018.09.18.1/debian/ubuntu-dbgsym-keyring.templates ubuntu-keyring-2018.09.18.1/debian/ubuntu-dbgsym-keyring.templates
--- ubuntu-keyring-2018.09.18.1/debian/ubuntu-dbgsym-keyring.templates	2019-02-07 00:26:23.000000000 +0900
+++ ubuntu-keyring-2018.09.18.1/debian/ubuntu-dbgsym-keyring.templates	2019-03-12 01:40:45.000000000 +0900
@@ -1,6 +1,6 @@
 Template: ubuntu-dbgsym-keyring/keyring
 Type: multiselect
-Choices: ubuntu-keyring-2016-dbgsym, ubuntu-dbgsym-removed-keys
+Choices: ubuntu-dbgsym-keyring, ubuntu-keyring-2016-dbgsym, ubuntu-dbgsym-removed-keys
 Default:
 _Description: Trusted GPG keyring for package authentication
  If you want to use the Ubuntu dbgsym archive in place of the Debian archive in
diff -Nru ubuntu-keyring-2018.09.18.1/debian/ubuntu-keyring.postinst ubuntu-keyring-2018.09.18.1/debian/ubuntu-keyring.postinst
--- ubuntu-keyring-2018.09.18.1/debian/ubuntu-keyring.postinst	2019-02-07 00:26:23.000000000 +0900
+++ ubuntu-keyring-2018.09.18.1/debian/ubuntu-keyring.postinst	2019-03-12 01:40:45.000000000 +0900
@@ -12,15 +12,27 @@
               /etc/apt/trusted.gpg.d/ubuntu-archive-removed-keys.gpg
       fi
 
+      # and also remove garbage that was created by previous version.
+      # oh moron...
+      rm -f /etc/apt/trusted.gpg.d/ubuntu-keyring-201[28]-archive\,\ *
+
+      TRUSTEDPARTS="/etc/apt/trusted.gpg.d/"
+      eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::trustedparts/d)"
+
+      # once clean up keyrings
+      rm -f "${TRUSTEDPARTS}ubuntu-keyring-2018-archive.gpg" \
+            "${TRUSTEDPARTS}ubuntu-keyring-2012-archive.gpg" \
+            "${TRUSTEDPARTS}ubuntu-archive-removed-keys.gpg"
+
       . /usr/share/debconf/confmodule
       db_version 2.0
       db_get ubuntu-keyring/keyring
 
       if [ -n "$RET" ]; then
-        for keyring in "$RET"
+        selected=$(echo "$RET" | sed -e 's/, /\n/g')
+        echo "$selected" | while read keyring
         do
-          rm -f /etc/apt/trusted.gpg.d/"$keyring".gpg
-          ln -sf /usr/share/keyrings/"$keyring".gpg /etc/apt/trusted.gpg.d/
+          ln -sf "/usr/share/keyrings/${keyring}.gpg" "$TRUSTEDPARTS"
         done
       fi
 
diff -Nru ubuntu-keyring-2018.09.18.1/debian/ubuntu-keyring.postrm ubuntu-keyring-2018.09.18.1/debian/ubuntu-keyring.postrm
--- ubuntu-keyring-2018.09.18.1/debian/ubuntu-keyring.postrm	2019-02-07 00:26:23.000000000 +0900
+++ ubuntu-keyring-2018.09.18.1/debian/ubuntu-keyring.postrm	2019-03-12 01:40:45.000000000 +0900
@@ -5,14 +5,17 @@
 case "$1" in
     purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
 
-        rm -f /etc/apt/trusted.gpg.d/ubuntu-archive-keyring.gpg \
-              /etc/apt/trusted.gpg.d/ubuntu-archive-removed-keys.gpg \
-              /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-archive.gpg \
-              /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg \
-              /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg \
-              /etc/apt/trusted.gpg.d/ubuntu-cloudimage-keyring.gpg \
-              /etc/apt/trusted.gpg.d/ubuntu-cloudimage-removed-keys.gpg \
-              /etc/apt/trusted.gpg.d/ubuntu-master-keyring.gpg
+      TRUSTEDPARTS="/etc/apt/trusted.gpg.d/"
+      eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::trustedparts/d)"
+
+      rm -f "${TRUSTEDPARTS}ubuntu-archive-keyring.gpg" \
+            "${TRUSTEDPARTS}ubuntu-archive-removed-keys.gpg" \
+            "${TRUSTEDPARTS}ubuntu-keyring-2012-archive.gpg" \
+            "${TRUSTEDPARTS}ubuntu-keyring-2018-archive.gpg" \
+            "${TRUSTEDPARTS}ubuntu-keyring-2012-cdimage.gpg" \
+            "${TRUSTEDPARTS}ubuntu-cloudimage-keyring.gpg" \
+            "${TRUSTEDPARTS}ubuntu-cloudimage-removed-keys.gpg" \
+            "${TRUSTEDPARTS}ubuntu-master-keyring.gpg"
 
     ;;
     *)

unblock ubuntu-keyring/2018.09.18.1-5

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-3-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8), LANGUAGE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

できたらエディタから抜けて"y"で送信します。

Report will be sent to Debian Bug Tracking System <submit@bugs.debian.org>
Submit this report on release.debian.org (e to edit) [Y|n|a|c|e|i|l|m|p|q|d|t|s|?]? y

SMTPサーバーへの通信が行われ、特に問題なければ完了メッセージがでてきます。

Connecting to mysmtp.example.jp:587 via SMTP...

Bug report submitted to: Debian Bug Tracking System <submit@bugs.debian.org>
Copies sent to:
  Debian Bug Tracking System <submit@bugs.debian.org>
  Hideki Yamane <henrich@debian.org>

If you want to provide additional information, please wait to receive the bug tracking number via email; you may then send any extra information to n@bugs.debian.org (e.g.
nnnnnn@bugs.debian.org), where n is the bug number. Normally you will receive an acknowledgement via email including the bug report number within an hour; if you haven't received a
confirmation, then the bug reporting process failed at some point (reportbug or MTA failure, BTS maintenance, etc.).

送信完了しました。しばらくするとBTSから番号が付与された完了通知が届きますので、あとはそれを確認すればよいでしょう。今回はBug#925350でした。

Thank you for filing a new Bug report with Debian.

You can follow progress on this Bug here: 925350: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925350.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 Debian Release Team <debian-release@lists.debian.org>

If you wish to submit further information on this problem, please
send it to 925350@bugs.debian.org.

Please do not send mail to owner@bugs.debian.org unless you wish
to report a problem with the Bug-tracking system.

-- 
925350: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925350
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems