unreliable -m/-x checks in icon-theme-installer
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gEDA |
New
|
Undecided
|
Unassigned |
Bug Description
Discovered during porting to OpenBSD:
The script build-tools/
However, these tests are unreliable. They originally both assumed that their arguments contained the (absolute) path to the executable in question as the first word. In the case of -x, a call to 'which' was later added to cover the case of providing a command without path, such as 'install'. This is still bogus (although harmless) in case a command of the form 'sh -c ...' is passed (this happens to be the case with the OpenBSD port).
Personally, I would question the point of trying to get these checks right and simply remove them. It is worth noting that the script will still fail at the first use of one of these commands if it fails. The attached patch replaces both with just a check that the required argument was provided.
Otherwise, at least -m should receive the same 'which' wrapper as -x so that commands without path are accepted in both cases.
As an aside, the attached patch also fixes a trivial typo in the error message for the -b argument.
Correction: The argument of -m in my case ended up being:
/bin/sh /.../geda- gaf-1.10. 2/build- tools/install- sh -d
I suspect this will be the usual case (and not OpenBSD-specific), given that install-sh is part of the distribution and all of this was generated by autoconf/automake.
This means that all that is accomplished by the present check in practice is to test whether the shell exists and is executable.