Package: borgbackup
Version: 1.2.3-1
Severity: important
Tags: patch
Control: block 1019950 by -1

Hi,

In order to fix #1019950, I would like to manage /usr/bin/borg using
update-alternatives. My idea for managing this is as follows:

 * Rename all command line utilities and manual pages such that they get
   a "1" suffix.
 * Add alternatives for all of the original names such that the previous
   original names keep working.
 * I have uploaded borgbackup2 to experimental (stuck in NEW) such that
   all of its command line utilities and manual pages have a "2" suffix.
 * I want to add update-alternatives to borgbackup2 with a *lower*
   priority than the one of borgbackup 1.x.

I note that these tools are not fully compatible. For instance, "borg
init" becomes "borg rcreate" borg "list" is split into "borg list" and
"borg rlist". Also --glob-archives becomes --match-archives and further
differences. Yet, I think that alternatives are a good compromise.

People installing just one borgbackup package will have it use standard
names. People upgrading from bullseye to bookworm will have borg be
borg 1.x regardless of whether borgbackup2 is installed as part of the
upgrade (due to the lower priority). Therefore prior usage of borg will
continue to work. Machines providing "borg serve" are able to provide
both borg 1.x and borg 2.x repositories due to both borg versions being
coinstallable.

In trixie, I want to either remove borg 1.x or lower its priority below
the priority of borg 2.x.

Release notes shall be extended to advise people to upgrade their borg
repositories after the upgrade and remove the borgbackup package.

Do you agree?

If you happen to not care much, I offer taking over maintenance of
borgbackup as part of the Freexian Packaging Team. Please let me know if
you favour that solution.

A quick reply is appreciated due to the imminent freeze.

Helmut for the Freexian Packaging Team
diff --minimal -Nru borgbackup-1.2.3/debian/borgbackup.alternatives 
borgbackup-1.2.3/debian/borgbackup.alternatives
--- borgbackup-1.2.3/debian/borgbackup.alternatives     1970-01-01 
01:00:00.000000000 +0100
+++ borgbackup-1.2.3/debian/borgbackup.alternatives     2023-01-16 
17:23:10.000000000 +0100
@@ -0,0 +1,43 @@
+Name: borg
+Link: /usr/bin/borg
+Alternative: /usr/bin/borg1
+Priority: 50
+Dependents:
+ /usr/bin/borgbackup borgbackup /usr/bin/borgbackup1
+ /usr/bin/borgfs borgfs /usr/bin/borgfs1
+ /usr/share/man/man1/borg-benchmark-crud.1.gz borg-benchmark-crud.1.gz 
/usr/share/man/man1/borg1-benchmark-crud.1.gz
+ /usr/share/man/man1/borg-benchmark.1.gz borg-benchmark.1.gz 
/usr/share/man/man1/borg1-benchmark.1.gz
+ /usr/share/man/man1/borg-break-lock.1.gz borg-break-lock.1.gz 
/usr/share/man/man1/borg1-break-lock.1.gz
+ /usr/share/man/man1/borg-change-passphrase.1.gz borg-change-passphrase.1.gz 
/usr/share/man/man1/borg1-change-passphrase.1.gz
+ /usr/share/man/man1/borg-check.1.gz borg-check.1.gz 
/usr/share/man/man1/borg1-check.1.gz
+ /usr/share/man/man1/borg-common.1.gz borg-common.1.gz 
/usr/share/man/man1/borg1-common.1.gz
+ /usr/share/man/man1/borg-compact.1.gz borg-compact.1.gz 
/usr/share/man/man1/borg1-compact.1.gz
+ /usr/share/man/man1/borg-compression.1.gz borg-compression.1.gz 
/usr/share/man/man1/borg1-compression.1.gz
+ /usr/share/man/man1/borg-config.1.gz borg-config.1.gz 
/usr/share/man/man1/borg1-config.1.gz
+ /usr/share/man/man1/borg-create.1.gz borg-create.1.gz 
/usr/share/man/man1/borg1-create.1.gz
+ /usr/share/man/man1/borg-delete.1.gz borg-delete.1.gz 
/usr/share/man/man1/borg1-delete.1.gz
+ /usr/share/man/man1/borg-diff.1.gz borg-diff.1.gz 
/usr/share/man/man1/borg1-diff.1.gz
+ /usr/share/man/man1/borg-export-tar.1.gz borg-export-tar.1.gz 
/usr/share/man/man1/borg1-export-tar.1.gz
+ /usr/share/man/man1/borg-extract.1.gz borg-extract.1.gz 
/usr/share/man/man1/borg1-extract.1.gz
+ /usr/share/man/man1/borg-import-tar.1.gz borg-import-tar.1.gz 
/usr/share/man/man1/borg1-import-tar.1.gz
+ /usr/share/man/man1/borg-info.1.gz borg-info.1.gz 
/usr/share/man/man1/borg1-info.1.gz
+ /usr/share/man/man1/borg-init.1.gz borg-init.1.gz 
/usr/share/man/man1/borg1-init.1.gz
+ /usr/share/man/man1/borg-key-change-passphrase.1.gz 
borg-key-change-passphrase.1.gz 
/usr/share/man/man1/borg1-key-change-passphrase.1.gz
+ /usr/share/man/man1/borg-key-export.1.gz borg-key-export.1.gz 
/usr/share/man/man1/borg1-key-export.1.gz
+ /usr/share/man/man1/borg-key-import.1.gz borg-key-import.1.gz 
/usr/share/man/man1/borg1-key-import.1.gz
+ /usr/share/man/man1/borg-key-migrate-to-repokey.1.gz 
borg-key-migrate-to-repokey.1.gz 
/usr/share/man/man1/borg1-key-migrate-to-repokey.1.gz
+ /usr/share/man/man1/borg-key.1.gz borg-key.1.gz 
/usr/share/man/man1/borg1-key.1.gz
+ /usr/share/man/man1/borg-list.1.gz borg-list.1.gz 
/usr/share/man/man1/borg1-list.1.gz
+ /usr/share/man/man1/borg-mount.1.gz borg-mount.1.gz 
/usr/share/man/man1/borg1-mount.1.gz
+ /usr/share/man/man1/borg-patterns.1.gz borg-patterns.1.gz 
/usr/share/man/man1/borg1-patterns.1.gz
+ /usr/share/man/man1/borg-placeholders.1.gz borg-placeholders.1.gz 
/usr/share/man/man1/borg1-placeholders.1.gz
+ /usr/share/man/man1/borg-prune.1.gz borg-prune.1.gz 
/usr/share/man/man1/borg1-prune.1.gz
+ /usr/share/man/man1/borg-recreate.1.gz borg-recreate.1.gz 
/usr/share/man/man1/borg1-recreate.1.gz
+ /usr/share/man/man1/borg-rename.1.gz borg-rename.1.gz 
/usr/share/man/man1/borg1-rename.1.gz
+ /usr/share/man/man1/borg-serve.1.gz borg-serve.1.gz 
/usr/share/man/man1/borg1-serve.1.gz
+ /usr/share/man/man1/borg-umount.1.gz borg-umount.1.gz 
/usr/share/man/man1/borg1-umount.1.gz
+ /usr/share/man/man1/borg-upgrade.1.gz borg-upgrade.1.gz 
/usr/share/man/man1/borg1-upgrade.1.gz
+ /usr/share/man/man1/borg-with-lock.1.gz borg-with-lock.1.gz 
/usr/share/man/man1/borg1-with-lock.1.gz
+ /usr/share/man/man1/borg.1.gz borg.1.gz /usr/share/man/man1/borg1.1.gz
+ /usr/share/man/man1/borgbackup.1.gz borgbackup.1.gz 
/usr/share/man/man1/borgbackup1.1.gz
+ /usr/share/man/man1/borgfs.1.gz borgfs.1.gz /usr/share/man/man1/borgfs1.1.gz
diff --minimal -Nru borgbackup-1.2.3/debian/borgbackup.links 
borgbackup-1.2.3/debian/borgbackup.links
--- borgbackup-1.2.3/debian/borgbackup.links    2022-12-29 10:17:45.000000000 
+0100
+++ borgbackup-1.2.3/debian/borgbackup.links    2023-01-16 17:23:12.000000000 
+0100
@@ -1,2 +1,2 @@
-/usr/bin/borg /usr/bin/borgbackup
-/usr/share/man/man1/borg.1.gz /usr/share/man/man1/borgbackup.1.gz
+/usr/bin/borg1 /usr/bin/borgbackup1
+/usr/share/man/man1/borg1.1.gz /usr/share/man/man1/borgbackup1.1.gz
diff --minimal -Nru borgbackup-1.2.3/debian/changelog 
borgbackup-1.2.3/debian/changelog
--- borgbackup-1.2.3/debian/changelog   2022-12-29 10:17:45.000000000 +0100
+++ borgbackup-1.2.3/debian/changelog   2023-01-16 17:23:12.000000000 +0100
@@ -1,3 +1,11 @@
+borgbackup (1.2.3-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Rename borg to borg1 and install borg using update-alternatives.
+    (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Mon, 16 Jan 2023 17:23:12 +0100
+
 borgbackup (1.2.3-1) unstable; urgency=medium
 
   * New upstream release
diff --minimal -Nru borgbackup-1.2.3/debian/rules borgbackup-1.2.3/debian/rules
--- borgbackup-1.2.3/debian/rules       2022-12-29 10:17:45.000000000 +0100
+++ borgbackup-1.2.3/debian/rules       2023-01-16 17:17:35.000000000 +0100
@@ -2,6 +2,8 @@
 
 #export DH_VERBOSE=1
 
+VERSION_SUFFIX=1
+
 # The command 'sphinx-build' refers to the python2 version;
 # currently there is no easier way to refer to the python3 version.
 SPHINXBUILD=/usr/share/sphinx/scripts/python3/sphinx-build
@@ -73,6 +75,18 @@
        LC_ALL=C.UTF-8 fakeroot dh_auto_test
 endif
 
+ifneq (,$(VERSION_SUFFIX))
+execute_after_dh_install-arch:
+       set -e; for f in debian/borgbackup/usr/bin/*; do \
+               mv "$$f" "$${f}$(VERSION_SUFFIX)"; \
+       done
+
+execute_after_dh_installman-arch:
+       set -e; for f in debian/borgbackup/usr/share/man/man1/*.1; do \
+               mv "$$f" "$$(echo "$$f" | sed 
's,^\(.*/[a-z]*\),&$(VERSION_SUFFIX),')"; \
+       done
+endif
+
 # Do not compress .ico file (affects html documentation)
 override_dh_compress:
        dh_compress -X.ico -Xfonts

Reply via email to