Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 455656 - app-text/yelp-tools: awk dependency
Summary: app-text/yelp-tools: awk dependency
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 418473
  Show dependency tree
 
Reported: 2013-02-05 18:35 UTC by Christoph Junghans (RETIRED)
Modified: 2013-02-06 05:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Junghans (RETIRED) gentoo-dev 2013-02-05 18:35:20 UTC
Can you please have a look if virtual/awk is sufficient or if gawk is needed.
Comment 1 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-02-05 19:03:54 UTC
These are the two awk scripts used in yelp-tools. Do either of them use gawk-only syntax?

#####

BEGIN {
  for (i = 1; i <= 255; i++) chars[sprintf("%c", i)] = i;
}
{
  ret = "";
  for (i = 1; i <= length($0); i++) {
    c = substr($0, i, 1);
    if (c ~ /['$urlencode_slash'a-zA-Z0-9._-]/)
      ret = ret c;
    else
      ret = ret sprintf("%%%X%X", int(chars[c] / 16), chars[c] % 16);
  }
  print ret;
}

######

BEGIN {
  for(i = 0; i < 10; i++) hex[i] = i;
  hex["A"] = hex["a"] = 10;
  hex["B"] = hex["b"] = 11;
  hex["C"] = hex["c"] = 12;
  hex["D"] = hex["d"] = 13;
  hex["E"] = hex["e"] = 14;
  hex["F"] = hex["f"] = 15;
}
{
  ret = "";
  for (i = 1; i <= length($0); i++) {
    c = substr($0, i, 1);
    if (c == "+") {
      ret = ret " ";
    }
    else if (c == "%") {
      c = sprintf("%c", hex[substr($0, i + 1, 1)] * 16 + hex[substr($0, i + 2, 1)]);
      ret = ret c;
      i += 2;
    }
    else {
      ret = ret c;
    }
  }
  print ret;
}
Comment 2 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-02-06 03:32:03 UTC
Looks like gawk is really required; nawk fails on these scripts with syntax errors.

+*yelp-tools-3.6.1-r1 (06 Feb 2013)
+
+  06 Feb 2013; Alexandre Rostovtsev <tetromino@gentoo.org>
+  yelp-tools-3.4.1.ebuild, yelp-tools-3.6.1.ebuild,
+  +yelp-tools-3.6.1-r1.ebuild, +files/yelp-tools-3.6.1-gawk.patch:
+  Require gawk, not generic awk; e.g. nawk reports syntax errors in yelp-tools
+  awk scripts (bug #455656, thanks to Christoph Junghans).
Comment 3 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-02-06 04:55:11 UTC
On further testing, it appears that yelp-tools works with all virtual/awk implementations except for nawk, which is completely broken (bug #455786).

However, we cannot switch to virtual/awk until it's keyworded on amd64-fbsd.

+  06 Feb 2013; Alexandre Rostovtsev <tetromino@gentoo.org>
+  yelp-tools-3.4.1.ebuild, yelp-tools-3.6.1.ebuild,
+  -yelp-tools-3.6.1-r1.ebuild, -files/yelp-tools-3.6.1-gawk.patch:
+  Undo previous commit: yelp-tools works with all virtual/awk implementations
+  except for nawk, which is buggy (see bug #455786). However, the ebuild
+  cannot switch to virtual/awk until it's keyworded on amd64-fbsd.
Comment 4 Christoph Junghans (RETIRED) gentoo-dev 2013-02-06 05:34:55 UTC
(In reply to comment #3)
> On further testing, it appears that yelp-tools works with all virtual/awk
> implementations except for nawk, which is completely broken (bug #455786).
> 
> However, we cannot switch to virtual/awk until it's keyworded on amd64-fbsd.
Added ~amd64-fbsd to virtual/awk (as sys-apps/gawk has it), so feel free to switch.
Comment 5 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-02-06 05:54:17 UTC
+  06 Feb 2013; Alexandre Rostovtsev <tetromino@gentoo.org>
+  yelp-tools-3.4.1.ebuild, yelp-tools-3.6.1.ebuild:
+  Switch to virtual/awk since it has been keyworded.