summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_lib_dgen.awk
diff options
context:
space:
mode:
authorBernhard Walle <bernhard@bwalle.de>2015-04-29 21:06:18 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2015-04-30 18:11:06 +0200
commit99df263919d3ea8ae8ed3aeb873eeab19fa01945 (patch)
treeab70bb903d5b543490708bfd9de02eb05fc5fb4d /scripts/lib/ptxd_lib_dgen.awk
parent5c1d9fe88d50d5491d8bdee3c0d5d7e32e16d4cf (diff)
downloadptxdist-99df263919d3ea8ae8ed3aeb873eeab19fa01945.tar.gz
ptxdist-99df263919d3ea8ae8ed3aeb873eeab19fa01945.tar.xz
ptxd_lib_dgen.awk: Fix warning
After upgrading my gawk to 4.1.2 (which Arch Linux did today), I get tons of warnings like gawk: /usr/lib/ptxdist-2015.04.0/scripts/lib/ptxd_lib_dgen.awk:386: (FILENAME=/tmp/ptxdist.p1sg2M/dgen/platformconfig FNR=233) warning: gensub: third argument `' treated as 1 This patch fixes the warnings. According to the documentation https://www.gnu.org/software/gawk/manual/gawk.html#String-Functions: | gensub(regexp, replacement, how [, target]) # | ... | | If the how argument is a string that does not begin with ā€˜gā€™ or ā€˜Gā€™, or | if it is a number that is less than or equal to zero, only one | substitution is performed. If how is zero, gawk issues a warning | message. So the fix should be safe. Signed-off-by: Bernhard Walle <bernhard@bwalle.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_lib_dgen.awk')
-rw-r--r--scripts/lib/ptxd_lib_dgen.awk12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
index 9970953ca..c25570654 100644
--- a/scripts/lib/ptxd_lib_dgen.awk
+++ b/scripts/lib/ptxd_lib_dgen.awk
@@ -89,7 +89,7 @@ $1 ~ /^[A-Z_]*PACKAGES-/ {
this_PKG = gensub(/^[A-Z_]*PACKAGES-\$\(PTXCONF_([^\)]*)\)/, "\\1", "g", $1);
this_PKG = gensub(/^[A-Z0-9_]*-\$\(PTXCONF_([^\)]*)\)/, "\\1", "g", this_PKG);
- is_pkg = this_pkg = gensub(/^[[:space:]]*\<(.*)\>[[:space:]]*$/,"\\1","", $2);
+ is_pkg = this_pkg = gensub(/^[[:space:]]*\<(.*)\>[[:space:]]*$/,"\\1",1, $2);
if (this_pkg ~ /[A-Z]+/) {
print \
"\n" \
@@ -222,8 +222,8 @@ function write_vars_pkg_all(this_PKG, this_pkg, prefix) {
print this_PKG "_DEVPKG = " prefix this_devpkg > DGEN_DEPS_PRE;
print this_PKG "_SOURCES = $(" this_PKG "_SOURCE)" > DGEN_DEPS_PRE
- target_PKG = gensub(/^HOST_|^CROSS_/, "", "", this_PKG);
- PREFIX = gensub(/^(HOST_|CROSS_).*/, "\\1", "", this_PKG);
+ target_PKG = gensub(/^HOST_|^CROSS_/, "", 1, this_PKG);
+ PREFIX = gensub(/^(HOST_|CROSS_).*/, "\\1", 1, this_PKG);
# define default ${PKG}, ${PKG}_SOURCE, ${PKG}_DIR
if ((prefix != "") && (target_PKG in PKG_to_pkg)) {
@@ -352,7 +352,7 @@ function write_deps_pkg_active_image(this_PKG, this_pkg, prefix) {
n = split(this_PKG_DEPS, this_DEP_array, " ");
for (i = 1; i <= n; i++) {
this_dep = PKG_to_pkg[this_DEP_array[i]]
- this_dep_prefix = gensub(/^(host-|cross-|image-|).*/, "\\1", "", this_dep)
+ this_dep_prefix = gensub(/^(host-|cross-|image-|).*/, "\\1", 1, this_dep)
if (this_dep_prefix == "")
print "$(" this_PKG "_IMAGE): " "$(STATEDIR)/" this_dep ".targetinstall.post" > DGEN_DEPS_POST;
else
@@ -371,7 +371,7 @@ END {
# for all pkgs
for (this_PKG in PKG_to_pkg) {
this_pkg = PKG_to_pkg[this_PKG];
- this_pkg_prefix = gensub(/^(host-|cross-|image-|).*/, "\\1", "", this_pkg)
+ this_pkg_prefix = gensub(/^(host-|cross-|image-|).*/, "\\1", 1, this_pkg)
write_include(this_PKG)
if (this_pkg_prefix != "image-") {
@@ -383,7 +383,7 @@ END {
# for active pkgs
for (this_PKG in active_PKG_to_pkg) {
this_pkg = PKG_to_pkg[this_PKG];
- this_pkg_prefix = gensub(/^(host-|cross-|image-|).*/, "\\1", "", this_pkg)
+ this_pkg_prefix = gensub(/^(host-|cross-|image-|).*/, "\\1", 1, this_pkg)
if (this_pkg_prefix != "image-") {
write_deps_pkg_active(this_PKG, this_pkg, this_pkg_prefix)