[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1054137: apt: let dh_installsystemd choose the location of units



Source: apt
Version: 2.7.6
Tags: patch
User: helmutg@debian.org
Usertags: dep17m2

We want to move aliased files from / to /usr to finalize the /usr-merge
transition via DEP17. apt is involved, because it install systemd units.
It currently hard codes their location to /lib/systemd/system. Rather
than moving them to /usr directly, I recommend using dh_installsystemd,
because backports will automatically revert back to the previous
location honouring the file move moratorium in bookworm. I'm attaching a
patch for your convenience. Once dh_installsystemd is updated and apt
binNMUed, it will have no files left in aliased locations.

Helmut
diff -Nru apt-2.7.6/debian/apt-daily-upgrade.service apt-2.7.6+nmu1/debian/apt-daily-upgrade.service
--- apt-2.7.6/debian/apt-daily-upgrade.service	2023-09-20 10:25:26.000000000 +0200
+++ apt-2.7.6+nmu1/debian/apt-daily-upgrade.service	1970-01-01 01:00:00.000000000 +0100
@@ -1,12 +0,0 @@
-[Unit]
-Description=Daily apt upgrade and clean activities
-Documentation=man:apt(8)
-ConditionACPower=true
-After=apt-daily.service network.target network-online.target systemd-networkd.service NetworkManager.service connman.service
-
-[Service]
-Type=oneshot
-ExecStartPre=-/usr/lib/apt/apt-helper wait-online
-ExecStart=/usr/lib/apt/apt.systemd.daily install
-KillMode=process
-TimeoutStopSec=900
diff -Nru apt-2.7.6/debian/apt-daily-upgrade.timer apt-2.7.6+nmu1/debian/apt-daily-upgrade.timer
--- apt-2.7.6/debian/apt-daily-upgrade.timer	2023-09-20 10:25:26.000000000 +0200
+++ apt-2.7.6+nmu1/debian/apt-daily-upgrade.timer	1970-01-01 01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
-[Unit]
-Description=Daily apt upgrade and clean activities
-After=apt-daily.timer
-
-[Timer]
-OnCalendar=*-*-* 6:00
-RandomizedDelaySec=60m
-Persistent=true
-
-[Install]
-WantedBy=timers.target
diff -Nru apt-2.7.6/debian/apt-daily.service apt-2.7.6+nmu1/debian/apt-daily.service
--- apt-2.7.6/debian/apt-daily.service	2023-09-20 10:25:26.000000000 +0200
+++ apt-2.7.6+nmu1/debian/apt-daily.service	1970-01-01 01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
-[Unit]
-Description=Daily apt download activities
-Documentation=man:apt(8)
-ConditionACPower=true
-After=network.target network-online.target systemd-networkd.service NetworkManager.service connman.service
-
-[Service]
-Type=oneshot
-ExecStartPre=-/usr/lib/apt/apt-helper wait-online
-ExecStart=/usr/lib/apt/apt.systemd.daily update
-
diff -Nru apt-2.7.6/debian/apt-daily.timer apt-2.7.6+nmu1/debian/apt-daily.timer
--- apt-2.7.6/debian/apt-daily.timer	2023-09-20 10:25:26.000000000 +0200
+++ apt-2.7.6+nmu1/debian/apt-daily.timer	1970-01-01 01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
-[Unit]
-Description=Daily apt download activities
-
-[Timer]
-OnCalendar=*-*-* 6,18:00
-RandomizedDelaySec=12h
-Persistent=true
-
-[Install]
-WantedBy=timers.target
diff -Nru apt-2.7.6/debian/apt.apt-daily-upgrade.service apt-2.7.6+nmu1/debian/apt.apt-daily-upgrade.service
--- apt-2.7.6/debian/apt.apt-daily-upgrade.service	1970-01-01 01:00:00.000000000 +0100
+++ apt-2.7.6+nmu1/debian/apt.apt-daily-upgrade.service	2023-09-20 10:25:26.000000000 +0200
@@ -0,0 +1,12 @@
+[Unit]
+Description=Daily apt upgrade and clean activities
+Documentation=man:apt(8)
+ConditionACPower=true
+After=apt-daily.service network.target network-online.target systemd-networkd.service NetworkManager.service connman.service
+
+[Service]
+Type=oneshot
+ExecStartPre=-/usr/lib/apt/apt-helper wait-online
+ExecStart=/usr/lib/apt/apt.systemd.daily install
+KillMode=process
+TimeoutStopSec=900
diff -Nru apt-2.7.6/debian/apt.apt-daily-upgrade.timer apt-2.7.6+nmu1/debian/apt.apt-daily-upgrade.timer
--- apt-2.7.6/debian/apt.apt-daily-upgrade.timer	1970-01-01 01:00:00.000000000 +0100
+++ apt-2.7.6+nmu1/debian/apt.apt-daily-upgrade.timer	2023-09-20 10:25:26.000000000 +0200
@@ -0,0 +1,11 @@
+[Unit]
+Description=Daily apt upgrade and clean activities
+After=apt-daily.timer
+
+[Timer]
+OnCalendar=*-*-* 6:00
+RandomizedDelaySec=60m
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff -Nru apt-2.7.6/debian/apt.apt-daily.service apt-2.7.6+nmu1/debian/apt.apt-daily.service
--- apt-2.7.6/debian/apt.apt-daily.service	1970-01-01 01:00:00.000000000 +0100
+++ apt-2.7.6+nmu1/debian/apt.apt-daily.service	2023-09-20 10:25:26.000000000 +0200
@@ -0,0 +1,11 @@
+[Unit]
+Description=Daily apt download activities
+Documentation=man:apt(8)
+ConditionACPower=true
+After=network.target network-online.target systemd-networkd.service NetworkManager.service connman.service
+
+[Service]
+Type=oneshot
+ExecStartPre=-/usr/lib/apt/apt-helper wait-online
+ExecStart=/usr/lib/apt/apt.systemd.daily update
+
diff -Nru apt-2.7.6/debian/apt.apt-daily.timer apt-2.7.6+nmu1/debian/apt.apt-daily.timer
--- apt-2.7.6/debian/apt.apt-daily.timer	1970-01-01 01:00:00.000000000 +0100
+++ apt-2.7.6+nmu1/debian/apt.apt-daily.timer	2023-09-20 10:25:26.000000000 +0200
@@ -0,0 +1,10 @@
+[Unit]
+Description=Daily apt download activities
+
+[Timer]
+OnCalendar=*-*-* 6,18:00
+RandomizedDelaySec=12h
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff -Nru apt-2.7.6/debian/apt.install apt-2.7.6+nmu1/debian/apt.install
--- apt-2.7.6/debian/apt.install	2023-09-20 10:25:26.000000000 +0200
+++ apt-2.7.6+nmu1/debian/apt.install	2023-10-17 16:12:09.000000000 +0200
@@ -1,5 +1,3 @@
-debian/*.service /lib/systemd/system/
-debian/*.timer /lib/systemd/system/
 debian/apt.systemd.daily usr/lib/apt
 etc/apt/
 usr/bin/apt
diff -Nru apt-2.7.6/debian/changelog apt-2.7.6+nmu1/debian/changelog
--- apt-2.7.6/debian/changelog	2023-09-20 10:25:26.000000000 +0200
+++ apt-2.7.6+nmu1/debian/changelog	2023-10-17 16:12:19.000000000 +0200
@@ -1,3 +1,10 @@
+apt (2.7.6+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Let dh_installsystemd choose the location of units. (Closes: #-1)
+
+ -- Helmut Grohne <helmut@subdivi.de>  Tue, 17 Oct 2023 16:12:19 +0200
+
 apt (2.7.6) unstable; urgency=medium
 
   [ Américo Monteiro ]
diff -Nru apt-2.7.6/debian/rules apt-2.7.6+nmu1/debian/rules
--- apt-2.7.6/debian/rules	2023-09-20 10:25:26.000000000 +0200
+++ apt-2.7.6+nmu1/debian/rules	2023-10-17 16:12:02.000000000 +0200
@@ -40,8 +40,10 @@
 	# Do not restart "apt-daily.service" because this script runs
 	# unattended-upgrades. So if apt itself is upgraded as part of
 	# an unattended-upgrades run it would kill itself
-	dh_installsystemd -papt apt-daily.timer apt-daily-upgrade.timer
-	dh_installsystemd -papt --no-restart-on-upgrade --no-restart-after-upgrade --no-start apt-daily.service apt-daily-upgrade.service
+	dh_installsystemd -papt --name apt-daily --no-restart-on-upgrade --no-restart-after-upgrade --no-start apt-daily.service
+	dh_installsystemd -papt --name apt-daily apt-daily.timer
+	dh_installsystemd -papt --name apt-daily-upgrade --no-restart-on-upgrade --no-restart-after-upgrade --no-start apt-daily-upgrade.service
+	dh_installsystemd -papt --name apt-daily-upgrade apt-daily-upgrade.timer
 	dh_installsystemd --remaining-packages
 
 ifneq ($(filter pkg.apt.nodoxygen,$(DEB_BUILD_PROFILES)),)

Reply to: