@dmnks commented on this pull request.


> +
+#### spawn({command} [, {actions}])
+
+Spawn, aka execute, an external program. (rpm >= 4.20)
+
+`{command}` is a table consisting of the command and its arguments.
+An optional second table can be used to pass various actions related
+to the command execution, currently supported are:
+
+| Action  | Argument(s) | Description
+|---------|----------------------
+| `stdin` | path        | Redirect standard input to path
+| `stdout`| path        | Redirect standard output to path
+| `stderr`| path        | Redirect standard error to path
+
+Returns the command exit status.

Hmm, this is strange:

```
> print(rpm.execute('ls blah'))
nil     No such file or directory       2.0
> print(rpm.spawn({'ls', 'blah'}))
ls: cannot access 'blah': No such file or directory
nil     exit code       2
```

Shouldn't the second invocation's error message be the same as that of the 
first one? IOW, shouldn't we use `WEXITSTATUS(status)` in the error handling 
code, like we do for `rpm.execute()`?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3241#discussion_r1725317326
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3241/review/2251225...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to