Opened 3 years ago

Closed 3 years ago

#22302 closed defect (fixed) uses a deprecated arithmetic syntax

Reported by: catalyst Owned by: catalyst
Priority: Medium Milestone:
Component: Core Tor/Chutney Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description uses a deprecated bash-specific syntax to do arithmetic. This fails on systems like Ubuntu and Debian that use dash instead of bash for /bin/sh. should probably use the POSIX $((arithmetic_expr)) syntax instead.

Typical error from the log files:

/home/tlyu/src/tor/../chutney/tools/ 302: [: Illegal number: $[n_rounds+1]
Completed $[n_rounds+1] of 1 verify rounds.

Child Tickets

Change History (5)

comment:2 Changed 3 years ago by catalyst

Status: newneeds_review

oops, forgot to set needs_review

comment:3 Changed 3 years ago by teor

Milestone: Tor: unspecified
Status: needs_reviewmerge_ready

The bash thing will continue to haunt me until I switch my default sh.

This is the only instance of this pattern in chutney.

$ grep -r --exclude-dir .git --exclude-dir net --exclude '*~' '$[[]' .
./tools/      n_rounds=$[n_rounds+1]

I think this is fine to merge, is there any reason it is WIP on gitlab?

comment:4 Changed 3 years ago by catalyst

I labeled it WIP partly to prevent accidental click-merge and partly to indicate it needed review. Feel free to ignore that, or I can delete the WIP notation if you want.

comment:5 Changed 3 years ago by teor

Resolution: fixed
Status: merge_readyclosed

Closed by merging 9e48988 into master.

Note: See TracTickets for help on using tickets.