| Summary: | alternatives-helper: interpreter errors on some unexpected input options | ||
|---|---|---|---|
| Product: | Sisyphus | Reporter: | Ivan Zakharyaschev <imz> |
| Component: | alternatives | Assignee: | placeholder <placeholder> |
| Status: | CLOSED FIXED | QA Contact: | qa-sisyphus |
| Severity: | minor | ||
| Priority: | P2 | CC: | at, glebfm, ldv, placeholder, vt |
| Version: | unstable | ||
| Hardware: | all | ||
| OS: | Linux | ||
No, actual actual results were: # /usr/sbin/alternatives-helper -h /usr/sbin/alternatives-helper: line 37: [: -eq: unary operator expected /usr/sbin/alternatives-helper: line 38: [: -eq: unary operator expected (What I pasted before were the results of the 1st work-around attempt.) Спасибо за замечания, патч обязательно приложу. давно |
alternatives-0.2.0-alt0.11 The script contains unquoted variable substitutions, which lead to errors on unexpected options because the variables expand then to unsuitable values. A workaround: *** alternatives-helper 2004/11/14 23:12:31 1.1 --- alternatives-helper 2004/11/14 23:18:39 1.2 *************** *** 34,41 **** mode=2; shift; continue fi ! [ $mode -eq 1 ] && alternatives-install $1 ! [ $mode -eq 2 ] && alternatives-uninstall $1 shift done --- 34,41 ---- mode=2; shift; continue fi ! [ "${mode:-0}" -eq 1 ] && alternatives-install "$1" ! [ "${mode:-0}" -eq 2 ] && alternatives-uninstall "$1" shift done Steps to Reproduce: /usr/sbin/alternatives-helper -h Actual Results: /usr/sbin/alternatives-helper: line 37: [: : integer expression expected /usr/sbin/alternatives-helper: line 38: [: : integer expression expected Expected Results: At least, no sh errors. But would like to see a usage message.