uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
26
pkgs/test/make-binary-wrapper/prefix.c
Normal file
26
pkgs/test/make-binary-wrapper/prefix.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0)
|
||||
|
||||
void set_env_prefix(char *env, char *sep, char *prefix) {
|
||||
char *existing = getenv(env);
|
||||
if (existing) {
|
||||
char *val;
|
||||
assert_success(asprintf(&val, "%s%s%s", prefix, sep, existing));
|
||||
assert_success(setenv(env, val, 1));
|
||||
free(val);
|
||||
} else {
|
||||
assert_success(setenv(env, prefix, 1));
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
set_env_prefix("PATH", ":", "/usr/bin/");
|
||||
set_env_prefix("PATH", ":", "/usr/local/bin/");
|
||||
argv[0] = "/send/me/flags";
|
||||
return execv("/send/me/flags", argv);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue