Mailinglist Archive: opensuse (946 mails)

< Previous Next >
Re: [opensuse] C++ Question

this belongs in opensuse-programming...

On Sat, 23 Sep 2017, Paul Groves wrote:
I am learning C++ and my program uses system('program --arg1 --arg2'); to run
a proprietary program. My question is how can I make this program a
dependency so that it has to be installed before my program?

You can't. You'll have to create a install-routine / startscript that
checks for the program and bails out if it is missing. E.g.:

==== /usr/bin/foo ====
BAR_BIN="$(type -p bar)"
if ! test -x "$BAR_BIN" ; then
echo "'bar' not found or not executable" >&2;
exit 2;
exec "$REAL_FOO" --bar-bin="${BAR_BIN}" "$@"

(and implement --bar-bin). Or use the environment.


Like most computer techie people, I'll happily spend 6 hours trying figure out
how to do a 3 hour job in 10 minutes. -- James Cort

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >