1 |
commit: 958909e44147a89d77fb1e416f20aaa51148a550 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jun 27 08:59:02 2020 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 27 08:59:02 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=958909e4 |
7 |
|
8 |
qpkg: don't fail when pkgdir doesn't exist yet |
9 |
|
10 |
When we implicitly created pkgdir, also try to chmod it, instead of |
11 |
failing on permissions later. |
12 |
|
13 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
14 |
|
15 |
qpkg.c | 6 +++--- |
16 |
1 file changed, 3 insertions(+), 3 deletions(-) |
17 |
|
18 |
diff --git a/qpkg.c b/qpkg.c |
19 |
index 1494b45..5e55406 100644 |
20 |
--- a/qpkg.c |
21 |
+++ b/qpkg.c |
22 |
@@ -382,14 +382,14 @@ int qpkg_main(int argc, char **argv) |
23 |
(fd != -1 && (fstat(fd, &st) == -1 || !S_ISDIR(st.st_mode)))) |
24 |
{ |
25 |
errp("could not create temp bindir '%s'", qpkg_bindir); |
26 |
- } else { |
27 |
+ } |
28 |
+ if (fd >= 0) { |
29 |
/* fd is valid, pointing to a directory */ |
30 |
if (!restrict_chmod) |
31 |
if (fchmod(fd, 0750) < 0) |
32 |
errp("could not chmod(0750) temp bindir '%s'", qpkg_bindir); |
33 |
- } |
34 |
- if (fd >= 0) |
35 |
close(fd); |
36 |
+ } |
37 |
|
38 |
/* we have to change to the root so that we can feed the full paths |
39 |
* to tar when we create the binary package. */ |