diff options
author | Andrej Valek <andrej.valek@siemens.com> | 2021-06-25 08:10:11 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-07-20 19:05:39 +0100 |
commit | 39395edb4d16392502447d678ed35f9a67b65ace (patch) | |
tree | c760ea611a88b26b3d30cfcf6be0dfc7a63e5b06 /meta/recipes-core/busybox/busybox/0001-mktemp-add-tmpdir-option.patch | |
parent | 3fc2f0d47a5d9e9562158f636389c7d18f49ec53 (diff) | |
download | poky-39395edb4d16392502447d678ed35f9a67b65ace.tar.gz |
busybox: add tmpdir option into mktemp applet
- Make mktemp applet compatible with --tmpdir option in ca-certificate
update script.
(From OE-Core rev: 9b83aefa9c4a21d9dc1eea4a6b00af379466a288)
Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 3d969e482d29da29828d1510f106f161d2b3d3c0)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/busybox/busybox/0001-mktemp-add-tmpdir-option.patch')
-rw-r--r-- | meta/recipes-core/busybox/busybox/0001-mktemp-add-tmpdir-option.patch | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox/0001-mktemp-add-tmpdir-option.patch b/meta/recipes-core/busybox/busybox/0001-mktemp-add-tmpdir-option.patch new file mode 100644 index 0000000000..4a1960dff2 --- /dev/null +++ b/meta/recipes-core/busybox/busybox/0001-mktemp-add-tmpdir-option.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | From ceb378209f953ea745ed93a8645567196380ce3c Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrej Valek <andrej.valek@siemens.com> | ||
3 | Date: Thu, 24 Jun 2021 19:13:22 +0200 | ||
4 | Subject: [PATCH] mktemp: add tmpdir option | ||
5 | |||
6 | Make mktemp more compatible with coreutils. | ||
7 | - add "--tmpdir" option | ||
8 | - add long variants for "d,q,u" options | ||
9 | |||
10 | Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2021-June/088932.html] | ||
11 | |||
12 | Signed-off-by: Andrej Valek <andrej.valek@siemens.com> | ||
13 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
14 | --- | ||
15 | coreutils/mktemp.c | 26 ++++++++++++++++++-------- | ||
16 | 1 file changed, 18 insertions(+), 8 deletions(-) | ||
17 | |||
18 | diff --git a/coreutils/mktemp.c b/coreutils/mktemp.c | ||
19 | index 5393320a5..05c6d98c6 100644 | ||
20 | --- a/coreutils/mktemp.c | ||
21 | +++ b/coreutils/mktemp.c | ||
22 | @@ -39,16 +39,17 @@ | ||
23 | //kbuild:lib-$(CONFIG_MKTEMP) += mktemp.o | ||
24 | |||
25 | //usage:#define mktemp_trivial_usage | ||
26 | -//usage: "[-dt] [-p DIR] [TEMPLATE]" | ||
27 | +//usage: "[-dt] [-p DIR, --tmpdir[=DIR]] [TEMPLATE]" | ||
28 | //usage:#define mktemp_full_usage "\n\n" | ||
29 | //usage: "Create a temporary file with name based on TEMPLATE and print its name.\n" | ||
30 | //usage: "TEMPLATE must end with XXXXXX (e.g. [/dir/]nameXXXXXX).\n" | ||
31 | //usage: "Without TEMPLATE, -t tmp.XXXXXX is assumed.\n" | ||
32 | -//usage: "\n -d Make directory, not file" | ||
33 | -//usage: "\n -q Fail silently on errors" | ||
34 | -//usage: "\n -t Prepend base directory name to TEMPLATE" | ||
35 | -//usage: "\n -p DIR Use DIR as a base directory (implies -t)" | ||
36 | -//usage: "\n -u Do not create anything; print a name" | ||
37 | +//usage: "\n -d Make directory, not file" | ||
38 | +//usage: "\n -q Fail silently on errors" | ||
39 | +//usage: "\n -t Prepend base directory name to TEMPLATE" | ||
40 | +//usage: "\n -p DIR, --tmpdir[=DIR] Use DIR as a base directory (implies -t)" | ||
41 | +//usage: "\n For --tmpdir is a optional one." | ||
42 | +//usage: "\n -u Do not create anything; print a name" | ||
43 | //usage: "\n" | ||
44 | //usage: "\nBase directory is: -p DIR, else $TMPDIR, else /tmp" | ||
45 | //usage: | ||
46 | @@ -72,13 +73,22 @@ int mktemp_main(int argc UNUSED_PARAM, char **argv) | ||
47 | OPT_t = 1 << 2, | ||
48 | OPT_p = 1 << 3, | ||
49 | OPT_u = 1 << 4, | ||
50 | + OPT_td = 1 << 5, | ||
51 | }; | ||
52 | |||
53 | path = getenv("TMPDIR"); | ||
54 | if (!path || path[0] == '\0') | ||
55 | path = "/tmp"; | ||
56 | |||
57 | - opts = getopt32(argv, "^" "dqtp:u" "\0" "?1"/*1 arg max*/, &path); | ||
58 | + opts = getopt32long(argv, "^" | ||
59 | + "dqtp:u\0" | ||
60 | + "?1" /* 1 arg max */, | ||
61 | + "directory\0" No_argument "d" | ||
62 | + "quiet\0" No_argument "q" | ||
63 | + "dry-run\0" No_argument "u" | ||
64 | + "tmpdir\0" Optional_argument "\xff" | ||
65 | + , &path, &path | ||
66 | + ); | ||
67 | |||
68 | chp = argv[optind]; | ||
69 | if (!chp) { | ||
70 | @@ -95,7 +105,7 @@ int mktemp_main(int argc UNUSED_PARAM, char **argv) | ||
71 | goto error; | ||
72 | } | ||
73 | #endif | ||
74 | - if (opts & (OPT_t|OPT_p)) | ||
75 | + if (opts & (OPT_t|OPT_p|OPT_td)) | ||
76 | chp = concat_path_file(path, chp); | ||
77 | |||
78 | if (opts & OPT_u) { | ||
79 | -- | ||
80 | 2.11.0 | ||
81 | |||