1 |
W dniu pią, 10.11.2017 o godzinie 19∶21 -0500, użytkownik Michael |
2 |
Orlitzky napisał: |
3 |
> On 11/10/2017 04:36 PM, Damo Brisbane wrote: |
4 |
> > |
5 |
> > Re for...keepdir, I found removing it then the /var/log/fabio folders |
6 |
> > were not getting created, so keeping it in there. |
7 |
> |
8 |
> You need to tell the ebuild to create that directory one way or another. |
9 |
> The "dodir" function will create the directory, but without the ".keep" |
10 |
> file inside of it. However that may be "illegal" in this case; see below. |
11 |
> |
12 |
> |
13 |
> > http://www.calculate-linux.org/main/en/using_ebuild, says this of *keepdir*: |
14 |
> > |
15 |
> > *Creates (if necessary) a |.keep| file in the given directory so that it |
16 |
> > isn't auto-cleaned. Never create a |.keep| file yourself. If Portage |
17 |
> > changes how |keepdir| works, then creating the file yourself will break |
18 |
> > the package.* |
19 |
> |
20 |
> To my knowledge, no package manager will remove a non-empty directory, |
21 |
> nor will it remove anything that the package manager did not itself |
22 |
> create. To me that raises a question: why would I ever want to keep |
23 |
> around an (otherwise empty) directory that was created by the package |
24 |
> manager? |
25 |
> |
26 |
> I found this, |
27 |
> |
28 |
> https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-15100013.2.2 |
29 |
> |
30 |
> which states |
31 |
> |
32 |
> Behaviour upon encountering an empty directory is undefined. Ebuilds |
33 |
> must not attempt to install an empty directory. |
34 |
> |
35 |
> Certainly "keepdir" will make the directory non-empty, but with the |
36 |
> additional (unwanted) side-effect that the directory won't be removed |
37 |
> when the package is uninstalled. Thus "keepdir" doesn't seem like it was |
38 |
> intended to address that technicality. So, I have two questions now... |
39 |
|
40 |
Wrong. It creates a dotfile inside it, and removes it along with it. |
41 |
|
42 |
> |
43 |
> a) When would you want to use keepdir? |
44 |
|
45 |
Because it works. |
46 |
|
47 |
> |
48 |
> b) What's the right way to prevent a directory from being empty? Touch |
49 |
> a dummy file? |
50 |
|
51 |
Use keepdir. |
52 |
|
53 |
> |
54 |
> and a meta-question, |
55 |
> |
56 |
> c) Seriously, empty directories are undefined behavior? |
57 |
|
58 |
...and how could they be defined if a directory can be installed by |
59 |
multiple packages and has no explicit ownership? |
60 |
|
61 |
-- |
62 |
Best regards, |
63 |
Michał Górny |