coin-or / coinbrew

COIN-OR build and installation script
29 stars 15 forks source link

awk syntax error #68

Closed rdzman closed 2 years ago

rdzman commented 2 years ago

Recent changes are causing a syntax error for me.

For example this ...

wget https://raw.githubusercontent.com/coin-or/coinbrew/master/coinbrew
chmod a+x coinbrew
./coinbrew fetch Ipopt --no-prompt

... results in the following.

Welcome to the COIN-OR fetch and build utility, version 2

To use the legacy version of coinbrew, '$ wget https://raw.githubusercontent.com/coin-or/coinbrew/1.0/coinbrew'
For help, run script with --help or see https://coin-or.github.io/coinbrew
Please report issues at https://github.com/coin-or/coinbrew
Detailed build documentation at https://coin-or.github.io

NOTE: You didn't provide a version.
      Defaulting to the latest release 3.14.4.

##################################################
### Fetching Ipopt releases/3.14.4 
##################################################

Cloning into 'Ipopt'...
Note: switching to 'd872b3a3d17863c6a2a27475cc9af9e933cb7e92'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

awk: cmd. line:1: /^stable/2.0/{print;}
awk: cmd. line:1:              ^ syntax error

Also, the command listed for the legacy version results in a 404 error due to the fact that the actual tag is v1.0 not 1.0.

xmunoz commented 2 years ago

Looks like the issue is here, likely related to the double quotes: https://github.com/coin-or/coinbrew/blob/master/coinbrew#L1230

svigerske commented 2 years ago

Looks like a slash in $versionnum is not handled well, since the slash also has a meaning in awk (enclosing the regular expression). Maybe something similar beautiful to ${versionnum/\//\\\/} would work.

tkralphs commented 2 years ago

Fixed via d5a0ecc. Thanks @svigerske. By the way, I get another error arising from the fact that config.yml specifies ASL 2.0 as a dependency, but there are no releases 2.0.*. It recovers from the error, but what should we do for that? Should it be required that there is a release? I guess if there's no release, I can just fall back to checking out the stable.

tkralphs commented 2 years ago

Thanks for reporting, @rdzman !

svigerske commented 2 years ago

Fixed via d5a0ecc. Thanks @svigerske. By the way, I get another error arising from the fact that config.yml specifies ASL 2.0 as a dependency, but there are no releases 2.0.*. It recovers from the error, but what should we do for that? Should it be required that there is a release? I guess if there's no release, I can just fall back to checking out the stable.

Would be nice if it falls back to the stable branch.

But I can also tag a release.

tkralphs commented 2 years ago

OK, it falls back to stable now (see 1125197).