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

Re: xournal FTBFS: wrongly declared R³



Hi!

On Sat, 2020-10-24 at 11:54:54 +0200, Niels Thykier wrote:
> Rather, I suspect the issue is that Rules-Requires-Root is set to "No"
> rather than "no".  AFAICT, only "no" has been defined and it is
> interpreted case sensitively.

Right, and even though this is described in the deb822(5) man page, it
is not explicitly spelled out in the various specific file format man
pages, so I've clarified that there. Also added more clear references
to deb822(5) in the relevant man pages. Patches attached.

> @Guillem/Dpkg Maintainers: Should we provide stricter validation for
> this to stop this at dpkg-source build time ?

Yeah, I think that make sense, as dpkg-buildpackage is already
erroring out on unknown values for «dpkg/» namespaced keywords. So I
prepared the attached patch to do this too.

Thanks,
Guillem
From 4eb8dbf07cf77229db2413ad1cf6a424e6cbfb3d Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Sun, 15 Nov 2020 19:32:08 +0100
Subject: [PATCH] =?UTF-8?q?doc,=20man:=20Clarify=20that=20R=C2=B3=20values?=
 =?UTF-8?q?=20are=20case=20sensitive?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is clear from the deb822(5) man page, but we can make this clear on
the brief format description for each of these file formats.

Prompted-by: Niels Thykier <niels@thykier.net>
---
 doc/rootless-builds.txt | 2 +-
 man/deb-buildinfo.pod   | 3 ++-
 man/deb-changes.pod     | 3 ++-
 man/deb-control.pod     | 3 ++-
 man/deb-src-control.pod | 3 ++-
 man/dsc.pod             | 3 ++-
 6 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/doc/rootless-builds.txt b/doc/rootless-builds.txt
index 3298768ec..af0a32836 100644
--- a/doc/rootless-builds.txt
+++ b/doc/rootless-builds.txt
@@ -25,7 +25,7 @@ We add a new field to the "Source" stanza of debian/control:
 
   Rules-Requires-Root: no | binary-targets | <implementations-keywords>
 
-The values are defined as:
+The case sensitive values are defined as:
 
  * If "no", then "debian/rules binary" will not require root at all (not even
    fakeroot).
diff --git a/man/deb-buildinfo.pod b/man/deb-buildinfo.pod
index 79894bd8a..8b3e9ffd4 100644
--- a/man/deb-buildinfo.pod
+++ b/man/deb-buildinfo.pod
@@ -35,7 +35,8 @@ Each field begins with a tag, such as
 B<Source>
 or
 B<Binary>
-(case insensitive), followed by a colon, and the body of the field.
+(case insensitive), followed by a colon, and the body of the field
+(case sensitive unless stated otherwise).
 Fields are delimited only by field tags.
 In other words, field text may be multiple lines in length, but the
 installation tools will generally join lines when processing the body
diff --git a/man/deb-changes.pod b/man/deb-changes.pod
index 5b7aad78d..797a4a56a 100644
--- a/man/deb-changes.pod
+++ b/man/deb-changes.pod
@@ -35,7 +35,8 @@ Each field begins with a tag, such as
 B<Source>
 or
 B<Binary>
-(case insensitive), followed by a colon, and the body of the field.
+(case insensitive), followed by a colon, and the body of the field
+(case sensitive unless stated otherwise).
 Fields are delimited only by field tags.
 In other words, field text may be multiple lines in length, but the
 installation tools will generally join lines when processing the body
diff --git a/man/deb-control.pod b/man/deb-control.pod
index 645905920..216f1cd02 100644
--- a/man/deb-control.pod
+++ b/man/deb-control.pod
@@ -40,7 +40,8 @@ Each field begins with a tag, such as
 B<Package>
 or
 B<Version>
-(case insensitive), followed by a colon, and the body of the field.
+(case insensitive), followed by a colon, and the body of the field
+(case sensitive unless stated otherwise).
 Fields are delimited only by field tags. In other words, field text
 may be multiple lines in length, but the installation tools will
 generally join lines when processing the body of the field (except
diff --git a/man/deb-src-control.pod b/man/deb-src-control.pod
index 9f7b4121e..45130beee 100644
--- a/man/deb-src-control.pod
+++ b/man/deb-src-control.pod
@@ -41,7 +41,8 @@ least one field. A field starts with a fieldname, such as
 B<Package>
 or
 B<Section>
-(case insensitive), followed by a colon, the body of the field and a newline.
+(case insensitive), followed by a colon, the body of the field
+(case sensitive unless stated otherwise) and a newline.
 Multi-line fields are also allowed, but each supplementary line, without a
 fieldname, should start with at least one space. The content of the multi-line
 fields is generally joined to a single line by the tools (except in the case of
diff --git a/man/dsc.pod b/man/dsc.pod
index e78eff043..34428bbd5 100644
--- a/man/dsc.pod
+++ b/man/dsc.pod
@@ -34,7 +34,8 @@ Each field begins with a tag, such as
 B<Source>
 or
 B<Binary>
-(case insensitive), followed by a colon, and the body of the field.
+(case insensitive), followed by a colon, and the body of the field
+(case sensitive unless stated otherwise).
 Fields are delimited only by field tags.
 In other words, field text may be multiple lines in length, but the
 installation tools will generally join lines when processing the body
-- 
2.29.2

From cb7cbdb5daf431393be54d3b376a41e0ed024265 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Sun, 15 Nov 2020 20:03:11 +0100
Subject: [PATCH] man: Add references to deb822(5) to file formats based on it

Prompted-by: Niels Thykier <niels@thykier.net>
---
 man/deb-buildinfo.pod   | 5 ++++-
 man/deb-changes.pod     | 4 +++-
 man/deb-control.pod     | 5 +++--
 man/deb-src-control.pod | 5 +++--
 man/dsc.pod             | 4 +++-
 5 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/man/deb-buildinfo.pod b/man/deb-buildinfo.pod
index 8b3e9ffd4..14ba706c3 100644
--- a/man/deb-buildinfo.pod
+++ b/man/deb-buildinfo.pod
@@ -30,7 +30,9 @@ I<filename>B<.buildinfo>
 =head1 DESCRIPTION
 
 Each Debian source package build can record the build information in
-a B<.buildinfo> control file, which contains a number of fields.
+a B<.buildinfo> control file, which contains a number of fields in
+B<deb822>(5) format.
+
 Each field begins with a tag, such as
 B<Source>
 or
@@ -243,6 +245,7 @@ backslashes escaped (‘\\’).
 
 =head1 SEE ALSO
 
+B<deb822>(5),
 B<deb-changes>(5),
 B<deb-version>(7),
 B<dpkg-genbuildinfo>(1).
diff --git a/man/deb-changes.pod b/man/deb-changes.pod
index 797a4a56a..340c0cec9 100644
--- a/man/deb-changes.pod
+++ b/man/deb-changes.pod
@@ -30,7 +30,8 @@ I<filename>B<.changes>
 =head1 DESCRIPTION
 
 Each Debian upload is composed of a .changes control file, which
-contains a number of fields.
+contains a number of fields in B<deb822>(5) format.
+
 Each field begins with a tag, such as
 B<Source>
 or
@@ -212,5 +213,6 @@ referred to as a suite.
 
 =head1 SEE ALSO
 
+B<deb822>(5),
 B<deb-src-control>(5),
 B<deb-version>(7).
diff --git a/man/deb-control.pod b/man/deb-control.pod
index 216f1cd02..d2da988b3 100644
--- a/man/deb-control.pod
+++ b/man/deb-control.pod
@@ -32,8 +32,8 @@ B<DEBIAN/control>
 =head1 DESCRIPTION
 
 Each Debian binary package contains a B<control> file in its B<control>
-member, and its format is a subset of the master B<debian/control> file in
-Debian source packages, see B<deb-src-control>(5).
+member, and its B<deb822>(5) format is a subset of the master
+B<debian/control> file in Debian source packages, see B<deb-src-control>(5).
 
 This file contains a number of fields.
 Each field begins with a tag, such as
@@ -440,6 +440,7 @@ executable format.
 
 =head1 SEE ALSO
 
+B<deb822>(5),
 B<deb-src-control>(5),
 B<deb>(5),
 B<deb-version>(7),
diff --git a/man/deb-src-control.pod b/man/deb-src-control.pod
index 45130beee..0f7a0733c 100644
--- a/man/deb-src-control.pod
+++ b/man/deb-src-control.pod
@@ -30,8 +30,8 @@ B<debian/control>
 =head1 DESCRIPTION
 
 Each Debian source package contains the master «B<debian/control>» file,
-and its format is a superset of the B<control> file shipped in Debian
-binary packages, see B<deb-control>(5).
+and its B<deb822>(5) format is a superset of the B<control> file
+shipped in Debian binary packages, see B<deb-control>(5).
 
 This file contains at least 2 paragraphs, separated by a blank line.
 The first paragraph lists
@@ -505,6 +505,7 @@ fields with B<Private->, such as B<XB-Private-New-Field>.
 
 =head1 SEE ALSO
 
+B<deb822>(5),
 B<deb-control>(5),
 B<deb-version>(7),
 B<dpkg-source>(1)
diff --git a/man/dsc.pod b/man/dsc.pod
index 34428bbd5..a96b36ae5 100644
--- a/man/dsc.pod
+++ b/man/dsc.pod
@@ -29,7 +29,8 @@ I<filename>B<.dsc>
 =head1 DESCRIPTION
 
 Each Debian source package is composed of a .dsc control file, which
-contains a number of fields.
+contains a number of fields, in B<deb822>(5) format.
+
 Each field begins with a tag, such as
 B<Source>
 or
@@ -278,6 +279,7 @@ and the format of the extracted source package.
 
 =head1 SEE ALSO
 
+B<deb822>(5),
 B<deb-src-control>(5),
 B<deb-version>(7),
 B<dpkg-source>(1).
-- 
2.29.2

From 5e53c0cc065e334573df7fe2fb08dff2cf1b7f96 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Wed, 28 Oct 2020 00:34:53 +0100
Subject: [PATCH] =?UTF-8?q?dpkg-buildpackage:=20Warn=20on=20known=20R?=
 =?UTF-8?q?=C2=B3=20values=20in=20uppercase?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

These values are case sensitive, but we do not check whether the
packager has used the wrong case, which will then go unnoticed. So
let's check that and error out to avoid surprises.

Reported-by: Niels Thykier <niels@thykier.net>
---
 scripts/dpkg-buildpackage.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 3125b0a78..588c4c4ca 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -725,6 +725,10 @@ sub parse_rules_requires_root {
             if ($keyword ne 'no' and $keyword ne 'binary-targets') {
                 warning(g_('unknown %s field keyword %s'),
                         'Rules-Requires-Root', $keyword);
+            } elsif ($keyword ne lc $keyword and
+                    (lc $keyword eq 'no' or lc $keyword eq 'binary-targets')) {
+                error(g_('%s field keyword %s is uppercase'),
+                      'Rules-Requires-Root', $keyword);
             }
             $keywords_base++;
         }
-- 
2.29.2


Reply to: