Package: coreutils
Version: 9.5-1
Severity: wishlist
Tags: patch
X-Debbugs-Cc: hel...@debian.org
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu questing ubuntu-patch

In Ubuntu, the attached patch was applied to achieve the following:

Rename the binary package to gnu-coreutils and build binaries with 'gnu' prefix.

The prefix choice is debatable, like many years ago I added `g` and
`gnu` as supported prefixes to apt's test suite for FreeBSD and friends,
and I'd have preferred `g` but `gcp` and `gstat` and a bunch of others
are already taken.

This patch could be uploaded to experimental, and in combination with
the new coreutils-from package which takes over the coreutils binary
and provides several coreutils-from-{gnu,uutils,toybox,busybox}
binaries would then provide an upgrade path.

An alternative choice can be made where GNU coreutils would not
be co-installable with other coreutils and coreutils itself
instead provides coreutils-from; and adds protective diversions
for switches with other coreutils-from providers.

However, it stands to reason that having the ability to run
say gnucp when say cp from uutils is insufficient is helpful; but
it may be less useful for Debian if it doesn't want to switch the
default (and the toybox/busybox cases are for minimizing image size,
you don't want co-installability).

For Ubuntu we had to do a rename of some sort, such that the
coreutils binary upgrades people to coreutils-from-uutils.

Thanks for considering the patch.

-- System Information:
Debian Release: trixie/sid
  APT prefers questing
  APT policy: (500, 'questing'), (500, 'plucky-updates'), (500, 
'plucky-security'), (500, 'plucky'), (100, 'questing-proposed')
Architecture: amd64 (x86_64)

Kernel: Linux 6.14.0-15-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en
diff -Nru coreutils-9.5/debian/control coreutils-9.5/debian/control
--- coreutils-9.5/debian/control        2025-04-25 08:55:05.000000000 +0200
+++ coreutils-9.5/debian/control        2025-05-08 11:06:23.000000000 +0200
@@ -1,18 +1,17 @@
 Source: coreutils
-Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
-XSBC-Original-Maintainer: Michael Stone <mst...@debian.org>
+Maintainer: Michael Stone <mst...@debian.org>
 Section: utils
 Priority: required
 Standards-Version: 4.5.0
 Build-Depends: gettext (>= 0.10.37), debhelper-compat (= 13), texinfo (>= 
4.2), groff, libattr1-dev [linux-any], libacl1-dev [linux-any], libselinux1-dev 
(>= 1.32) [linux-any], gperf, bison, libgmp3-dev, libssl-dev, libsystemd-dev
 
-Package: coreutils
+Package: gnu-coreutils
 Architecture: any
 Multi-Arch: foreign
 Pre-Depends: ${shlibs:Depends}, ${misc:Pre-Depends}
-Essential: yes
 Depends: ${misc:Depends}
 Breaks: usrmerge (<< 39)
+Replaces: coreutils (<< 9.5-1ubuntu2~)
 Description: GNU core utilities
  This package contains the basic file, shell and text manipulation
  utilities which are expected to exist on every operating system.
diff -Nru coreutils-9.5/debian/coreutils.dirs 
coreutils-9.5/debian/coreutils.dirs
--- coreutils-9.5/debian/coreutils.dirs 2025-04-25 08:55:05.000000000 +0200
+++ coreutils-9.5/debian/coreutils.dirs 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-usr/share/doc/coreutils
diff -Nru coreutils-9.5/debian/coreutils.NEWS 
coreutils-9.5/debian/coreutils.NEWS
--- coreutils-9.5/debian/coreutils.NEWS 2025-04-25 08:55:05.000000000 +0200
+++ coreutils-9.5/debian/coreutils.NEWS 1970-01-01 01:00:00.000000000 +0100
@@ -1,40 +0,0 @@
-coreutils (8.23-1) unstable; urgency=low
-
-  GNU coreutils package now includes the `realpath' command that used to
-  be found in a separate `realpath' package.
-
-  Even though the GNU version provides all the features of the old Debian
-  version, the behaviour is a bit different, namely:
-
-    * GNU `realpath' and `realpath -s' commands require all but the
-      last path components to exist
-
-  whereas:
-
-    * Debian version of `realpath' required all the path components to exist;
-    * Debian version of `realpath -s' required no path components to exist.
-
-  To get the old behaviour in GNU `realpath' an additional option needs
-  to be used:
-
-       Old Debian realpath       New GNU coreutils realpath
-     -----------------------    ----------------------------
-      realpath    file(s)    =>    realpath -e    file(s)
-      realpath -s file(s)    =>    realpath -s -m file(s)
-
- -- Robert Luberda <rob...@debian.org>  Sun, 31 Aug 2014 16:08:14 +0200
-
-coreutils (5.96-3) unstable; urgency=low
-
-  * The POSIX compatibility level is now set to POSIX 1003.1-2001,
-    which affects the syntax for several commands.  For transition
-    purposes, "sort +number" and "tail +number" will be supported
-    for the etch release. Note that these usages are deprecated, and
-    will be removed in etch+1; the recommended usage is "sort -k number"
-    and "tail -n +number". Also, "uniq +number" should be replaced with
-    "uniq -s number" and "touch number filename" should be replaced with
-    "touch -t number filename". To revert to the older syntax, set the
-    environment variable _POSIX2_VERSION to "199209".
-
- -- Michael Stone <mst...@debian.org>  Sat, 27 May 2006 12:56:18 -0400
-
diff -Nru coreutils-9.5/debian/coreutils.README.Debian 
coreutils-9.5/debian/coreutils.README.Debian
--- coreutils-9.5/debian/coreutils.README.Debian        2025-04-25 
08:55:05.000000000 +0200
+++ coreutils-9.5/debian/coreutils.README.Debian        1970-01-01 
01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
-Most of the coreutils documentation is available as info pages. (Try "info
-coreutils" at a command prompt). A version of this documentation is also
-available online at
-http://www.gnu.org/software/coreutils/manual/html_node/index.html
-(Note that the online version may not reflect the version of coreutils in this
-package.)
-
-There is also a frequently asked questions document available at
-http://www.gnu.org/software/coreutils/faq/coreutils-faq.html
-
diff -Nru coreutils-9.5/debian/gnu-coreutils.dirs 
coreutils-9.5/debian/gnu-coreutils.dirs
--- coreutils-9.5/debian/gnu-coreutils.dirs     1970-01-01 01:00:00.000000000 
+0100
+++ coreutils-9.5/debian/gnu-coreutils.dirs     2025-05-08 11:06:23.000000000 
+0200
@@ -0,0 +1 @@
+usr/share/doc/gnu-coreutils
diff -Nru coreutils-9.5/debian/gnu-coreutils.NEWS 
coreutils-9.5/debian/gnu-coreutils.NEWS
--- coreutils-9.5/debian/gnu-coreutils.NEWS     1970-01-01 01:00:00.000000000 
+0100
+++ coreutils-9.5/debian/gnu-coreutils.NEWS     2025-05-08 11:06:23.000000000 
+0200
@@ -0,0 +1,40 @@
+coreutils (8.23-1) unstable; urgency=low
+
+  GNU coreutils package now includes the `realpath' command that used to
+  be found in a separate `realpath' package.
+
+  Even though the GNU version provides all the features of the old Debian
+  version, the behaviour is a bit different, namely:
+
+    * GNU `realpath' and `realpath -s' commands require all but the
+      last path components to exist
+
+  whereas:
+
+    * Debian version of `realpath' required all the path components to exist;
+    * Debian version of `realpath -s' required no path components to exist.
+
+  To get the old behaviour in GNU `realpath' an additional option needs
+  to be used:
+
+       Old Debian realpath       New GNU coreutils realpath
+     -----------------------    ----------------------------
+      realpath    file(s)    =>    realpath -e    file(s)
+      realpath -s file(s)    =>    realpath -s -m file(s)
+
+ -- Robert Luberda <rob...@debian.org>  Sun, 31 Aug 2014 16:08:14 +0200
+
+coreutils (5.96-3) unstable; urgency=low
+
+  * The POSIX compatibility level is now set to POSIX 1003.1-2001,
+    which affects the syntax for several commands.  For transition
+    purposes, "sort +number" and "tail +number" will be supported
+    for the etch release. Note that these usages are deprecated, and
+    will be removed in etch+1; the recommended usage is "sort -k number"
+    and "tail -n +number". Also, "uniq +number" should be replaced with
+    "uniq -s number" and "touch number filename" should be replaced with
+    "touch -t number filename". To revert to the older syntax, set the
+    environment variable _POSIX2_VERSION to "199209".
+
+ -- Michael Stone <mst...@debian.org>  Sat, 27 May 2006 12:56:18 -0400
+
diff -Nru coreutils-9.5/debian/gnu-coreutils.README.Debian 
coreutils-9.5/debian/gnu-coreutils.README.Debian
--- coreutils-9.5/debian/gnu-coreutils.README.Debian    1970-01-01 
01:00:00.000000000 +0100
+++ coreutils-9.5/debian/gnu-coreutils.README.Debian    2025-05-08 
11:06:23.000000000 +0200
@@ -0,0 +1,10 @@
+Most of the coreutils documentation is available as info pages. (Try "info
+coreutils" at a command prompt). A version of this documentation is also
+available online at
+http://www.gnu.org/software/coreutils/manual/html_node/index.html
+(Note that the online version may not reflect the version of coreutils in this
+package.)
+
+There is also a frequently asked questions document available at
+http://www.gnu.org/software/coreutils/faq/coreutils-faq.html
+
diff -Nru coreutils-9.5/debian/rules coreutils-9.5/debian/rules
--- coreutils-9.5/debian/rules  2025-04-25 08:55:05.000000000 +0200
+++ coreutils-9.5/debian/rules  2025-05-08 11:04:58.000000000 +0200
@@ -3,6 +3,9 @@
 #export DH_VERBOSE=1
 #export DH_OPTIONS=-v
 
+PROGRAM_PREFIX := gnu
+PACKAGE_PREFIX := gnu-
+
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/default.mk
 
@@ -23,13 +26,13 @@
 BIN_PROGS = cat chgrp chmod chown cp date dd df dir echo false ln ls mkdir \
        mknod mv pwd readlink rm rmdir vdir sleep stty sync touch true uname \
        mktemp
-d=debian/coreutils
+d=debian/$(PACKAGE_PREFIX)coreutils
 
 override_dh_auto_configure:
 ifeq ($(cross_build),yes)
        echo 'fu_cv_sys_stat_statfs2_bsize=yes' > config.cache
 endif
-       dh_auto_configure -- --enable-systemd --enable-install-program=arch 
--with-openssl=auto-gpl-compat $(CROSS_CONFIGURE_FLAGS)
+       dh_auto_configure -- --program-prefix=gnu --enable-systemd 
--enable-install-program=arch --with-openssl=auto-gpl-compat 
$(CROSS_CONFIGURE_FLAGS)
 
 %:
        dh $@ --with autoreconf
@@ -74,26 +77,30 @@
 override_dh_install-arch: 
        dh_install -a
 
+ifeq ($(PROGRAM_PREFIX),)
        # backward compatability
        ln -s /usr/bin/md5sum $(d)/usr/bin/md5sum.textutils
        ln -s /usr/share/man/man1/md5sum.1 
$(d)/usr/share/man/man1/md5sum.textutils.1
+endif
 
        # remove stuff provided by other packages
 ifeq ($(DEB_HOST_ARCH_OS),linux)
        # kill from procps is linux-specific
-       rm -f $(d)/usr/bin/kill $(d)/usr/share/man/man1/kill.1
+       rm -f $(d)/usr/bin/$(PROGRAM_PREFIX)kill 
$(d)/usr/share/man/man1/$(PROGRAM_PREFIX)kill.1
 endif
-       rm -f $(d)/usr/bin/hostname $(d)/usr/share/man/man1/hostname.1
-       rm -f $(d)/usr/bin/uptime $(d)/usr/share/man/man1/uptime.1
+       rm -f $(d)/usr/bin/$(PROGRAM_PREFIX)hostname 
$(d)/usr/share/man/man1/$(PROGRAM_PREFIX)hostname.1
+       rm -f $(d)/usr/bin/$(PROGRAM_PREFIX)uptime 
$(d)/usr/share/man/man1/$(PROGRAM_PREFIX)uptime.1
 
+ifeq ($(PROGRAM_PREFIX),)
        # the [ program doesn't have its own man page yet
        ln -s test.1 $(d)/usr/share/man/man1/[.1
+endif
 
        # gnu thinks chroot is in bin, debian thinks it's in sbin
        install -d $(d)/usr/sbin $(d)/usr/share/man/man8
-       mv $(d)/usr/bin/chroot $(d)/usr/sbin/chroot
-       sed s/\"1\"/\"8\"/1 $(d)/usr/share/man/man1/chroot.1 > 
$(d)/usr/share/man/man8/chroot.8
-       rm $(d)/usr/share/man/man1/chroot.1
+       mv $(d)/usr/bin/$(PROGRAM_PREFIX)chroot 
$(d)/usr/sbin/$(PROGRAM_PREFIX)chroot
+       sed s/\"1\"/\"8\"/1 $(d)/usr/share/man/man1/$(PROGRAM_PREFIX)chroot.1 > 
$(d)/usr/share/man/man8/$(PROGRAM_PREFIX)chroot.8
+       rm $(d)/usr/share/man/man1/$(PROGRAM_PREFIX)chroot.1
 
        # some build environments will leave a dangling info dir
        rm -f $(d)/usr/share/info/dir
@@ -102,5 +109,5 @@
                NEWS README \
                THANKS \
                TODO \
-               $(d)/usr/share/doc/coreutils
+               $(d)/usr/share/doc/$(PACKAGE_PREFIX)coreutils
 

Reply via email to