Public bug reported:

The only feature used by dpkg-awk beyond those required by POSIX is
'delete array'. This extension is supported by all awk variants
currently in Debian, i.e. by gawk, mawk, and original-awk. Attached diff
replaces dependency on gawk with dependency on virtual package awk
provided by all of the above awk packages.

Note however that unsetting environment variable POSIXLY_CORRECT in
/usr/bin/dpkg-awk is still needed because otherwise if gawk is
configured as default awk it treats 'delete array' as an error (see
debbug 170375).

Note also that debbug 64146 aroused out of a mistake: the previous
Debian maintainer of dpkg-awk forgot to replace gawk with awk in
/usr/bin/dpkg-awk when triying to drop dependency on gawk in dpkg-awk
1.0.0.

Actually, 'delete array' is supported even by Plan 9 awk that gets
installed by package 9base as /usr/lib/plan9/bin/awk and doesn't provide
awk in Debian.

But if POSIX compatibility must be retained by all means, the following
patch should also be applied. It replaces 'delete array' with
'split("",array)'. In this case, 'unset POSIXLY_CORRECT' in /usr/bin
/dpkg-awk obviously isn't needed anymore.

diff --git a/dpkg-awk.awk b/dpkg-awk.awk
index 7669c40..cf00c43 100644
--- a/dpkg-awk.awk
+++ b/dpkg-awk.awk
@@ -86,7 +86,7 @@ BEGIN {
 
        if (options["debug"] >= 1)
                print "ARGV[0]='" ARGV[0] "'\n"
-       delete ARGV
+       split("", ARGV)
        if (options["debug"] >= 1)
                for (a in options)
                        print "options[" a "]='" options[a] "'\n"
@@ -99,8 +99,8 @@ function my_split(input, output,
        a, b, fields, save0)
 
 {
-       delete output
-       delete fields
+       split("", output)
+       split("", fields)
        save0 = $0
        $0 = input
        num_fields = split(input, fields, "\n")

** Affects: dpkg-awk (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: bitesize packaging patch

** Patch added: "replace dependency on gawk with awk"
   
https://bugs.launchpad.net/bugs/1092539/+attachment/3464739/+files/depend-on-awk.diff

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1092539

Title:
  Should depend on awk, not on gawk

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dpkg-awk/+bug/1092539/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to