Bug 1723359 - Major update of gawk (5.x) breaks INPLACE_SUFFIX file creation
Summary: Major update of gawk (5.x) breaks INPLACE_SUFFIX file creation
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gawk
Version: rawhide
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: ---
Assignee: Jakub Martisko
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-24 11:14 UTC by Igor Gnatenko
Modified: 2019-08-05 13:03 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-05 13:03:01 UTC


Attachments (Terms of Use)

Description Igor Gnatenko 2019-06-24 11:14:23 UTC
Description of problem:

+ gawk -i inplace -v INPLACE_SUFFIX=.deps '/^\[((.+\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\[/{f=0}; !f' Cargo.toml
+ /usr/bin/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 /usr/bin/cargo package -l
+ xargs -d '\n' /usr/bin/cp --parents -a -t /builddir/build/BUILDROOT/rust-nom-4.2.3-3.fc31.x86_64/usr/share/cargo/registry/nom-4.2.3
BUILDSTDERR: warning: No (git) VCS found for `/builddir/build/BUILD/nom-4.2.3`
+ /usr/bin/mv Cargo.toml.deps Cargo.toml
BUILDSTDERR: /usr/bin/mv: cannot stat 'Cargo.toml.deps': No such file or directory

Version-Release number of selected component (if applicable):

5.0.1-1.fc31

How reproducible:

Always.

Steps to Reproduce:
1. Build rust-nom package

Actual results:

gawk does not create file with INPLACE_SUFFIX.

Expected results:

gawk creates file with INPLACE_SUFFIX.

Additional info:

Comment 1 Igor Gnatenko 2019-06-24 11:19:29 UTC
This is due to https://git.savannah.gnu.org/cgit/gawk.git/commit/?id=663aff4ae012468c54d2e994e839d0e75210ef80 and it is present only in 5.x... So how should I handle this if I want to support both gawks?

Comment 2 Igor Gnatenko 2019-06-24 11:25:53 UTC
Obviously I can't do this:

+ gawk -i inplace -v inplace::suffix=.deps -v INPLACE_SUFFIX=.deps '/^\[((.+\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\[/{f=0}; !f' Cargo.toml
gawk: fatal: `inplace::suffix' is not a legal variable name

Comment 4 Michal Jaegermann 2019-06-28 20:20:34 UTC
(In reply to Igor Gnatenko from comment #2)
> Obviously I can't do this:
> 
> + gawk -i inplace -v inplace::suffix=.deps -v INPLACE_SUFFIX=.deps
> '/^\[((.+\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\[/{f=0};
> !f' Cargo.toml
> gawk: fatal: `inplace::suffix' is not a legal variable name

This bug is fixed now in sources at git://git.savannah.gnu.org/gawk and INPLACE_SUFFIX if accepted too as a backcompatibility change.

OTOH if you do not want to rely on something not released yet you can check gawk version and proceed accordingly.  Something like that:

suffix=$(gawk -V | gawk '/^GNU Awk /{print ($3 >= 5 ? "inplace::suffix" : "INPLACE_SUFFIX"); exit}')

and use $suffix in the subsequent gawk call.

Comment 5 Andrew Schorr 2019-06-28 21:47:29 UTC
I think it should be fixed in gawk-5.0.1-2, which has incorporated those patches.

Comment 6 Jakub Martisko 2019-07-01 10:47:24 UTC
(In reply to Andrew Schorr from comment #5)
> I think it should be fixed in gawk-5.0.1-2, which has incorporated those
> patches.

Yes, I've added the patches dealing with this to the Fedora. You should now be able to use both the the namespaced and non-namespaced versions of INPLACE_SUFFIX


Note You need to log in before you can comment on or make changes to this bug.