return 0;
}
+
+PAKFIRE_EXPORT int pakfire_execute_command(Pakfire pakfire, const char* command, char* envp[], int flags) {
+ const char* argv[2] = {
+ command, NULL,
+ };
+
+ return pakfire_execute(pakfire, argv, envp, flags);
+}
#include <pakfire/types.h>
int pakfire_execute(Pakfire pakfire, const char* argv[], char* envp[], int flags);
+int pakfire_execute_command(Pakfire pakfire, const char* command, char* envp[], int flags);
#endif /* PAKFIRE_EXECUTE_H */
#include <pakfire/types.h>
#include <pakfire/util.h>
-static const char* LDCONFIG[2] = {
- "/sbin/ldconfig", NULL,
-};
+#define LDCONFIG "/sbin/ldconfig"
struct _PakfireStep {
Pakfire pakfire;
if (root)
command = pakfire_path_relpath(root, path);
- const char* argv[2];
- argv[0] = command;
- argv[1] = NULL;
-
// Run the script
- r = pakfire_execute(step->pakfire, argv, NULL, 0);
+ r = pakfire_execute_command(step->pakfire, command, NULL, 0);
if (r) {
DEBUG(step->pakfire, "Script return code: %d\n", r);
}
const char* path = pakfire_get_path(step->pakfire);
- if (pakfire_access(step->pakfire, path, LDCONFIG[0], X_OK) == 0) {
- r = pakfire_execute(step->pakfire, LDCONFIG, NULL, 0);
+ if (pakfire_access(step->pakfire, path, LDCONFIG, X_OK) == 0) {
+ r = pakfire_execute_command(step->pakfire, LDCONFIG, NULL, 0);
DEBUG(step->pakfire, "ldconfig returned %d\n", r);
}