1 |
So, mornings are smarter than evenings (it's Estonian saying) ...at night, I |
2 |
thought more about this filesystem thing and found that it simply answers |
3 |
all needs, actually. Now I did read some messages here and thought how it |
4 |
could be made real simple, at least as I understand this word. Yesterday I |
5 |
searched if custom filesystems could have custom functionality and did not |
6 |
find any, so I wrote this list of big bunch of classes, which might be |
7 |
overkill as I think now. |
8 |
|
9 |
First thing about that indexing - if you dont create daemon nor filesystem, |
10 |
you can create commands "emerge --indexon", "emerge --indexoff", "emerge |
11 |
--indexrenew". Then, index is renewed on "emerge --sync" and such, but when |
12 |
user changes files manually, she has to renew index manually - not much |
13 |
asked, isn't it? If someone is going to open the cover of her computer, she |
14 |
will take the responsibility to know some basic things about electricity and |
15 |
that they should change smth in bios after adding and removing some parts of |
16 |
computer. Maybe it should even be "emerge --commithandmadechanges", which |
17 |
will index or do some other things, which are needed after handmade changes. |
18 |
More such things might emerge in future, I guess. |
19 |
|
20 |
But about filesystem... |
21 |
|
22 |
Consider such thing that when you have filesystem, you might have some |
23 |
directory, which you could not list, but where you can read files. Imagine |
24 |
some function, which is able to encode and decode queryes into filesystem |
25 |
format. |
26 |
|
27 |
If you have such function: search(packagename, "dependencies") you can write |
28 |
it as file path: |
29 |
/cgi-bin/search/packagename/dependencies - and packagename can be encoded by |
30 |
replacing some characters with some codes and separating long strings with |
31 |
/. Also, you could have API, which has one file in directory, from where you |
32 |
can read some tmp filename, then write your query to that file and read the |
33 |
result from the same or similarly-named file with different extension. So, |
34 |
FS provides some ways to create custom queries - actually that idea came |
35 |
because there was idea of creating FS as cgi server on LUFS page, thus this |
36 |
"cgi-bin" starting here is to simplify. I think it's similar to how files in |
37 |
/dev/ directory behave - you open some file and start writing and reading, |
38 |
but this file actually is zero-sized and contains nothing. |
39 |
|
40 |
Under such case, API could be written to provide this filesystem and nothing |
41 |
more. If it is custom-mapped filesystem, then it could provide search and |
42 |
such directories, which can be used by portage and others. If not, it would |
43 |
work as it used to. |
44 |
|
45 |
So, having filesystem, which contains such stuff (i call this subdir "dev" |
46 |
here): |
47 |
|
48 |
- /dev/search - write your query here and read the result. |
49 |
- /dev/search/searchstring - another way for user to just read some |
50 |
listings with her custom script. |
51 |
- /portage/directory/category/packagename/depslist.dev - contains dynamic |
52 |
list of package dependencies. |
53 |
- /dev/version - some integer, which will grow every time any change to |
54 |
portage tree is made. |
55 |
|
56 |
Then, other functions would be added eventually. |
57 |
|
58 |
Now, things simple: |
59 |
|
60 |
- Create standard filesystem, which can be used to contain portage tree. |
61 |
- Add all nessecary notifications to change and update files. |
62 |
- *Mount this filesystem to the same dir, where actual files are placed - |
63 |
if it's not mounted, portage will almost not notice this (so in emergency, |
64 |
things are just slower). You can navigate to a directory, then mount new one |
65 |
- I am not on linux box right now, but if I remember correctly, you can use |
66 |
files in real directory after mounting smth other there in such way.* |
67 |
- Create indexes and other stuff. |
68 |
|
69 |
2008/11/24 Fabian Groffen <grobian@g.o> |
70 |
|
71 |
> On 24-11-2008 10:34:28 +0100, René 'Necoro' Neumann wrote: |
72 |
> > tvali schrieb: |
73 |
> > > There is daemon, which notices about filesystem changes - |
74 |
> > > http://pyinotify.sourceforge.net/ would be a good choice. |
75 |
> > |
76 |
> > Disadvantage: Has to run all the time (I see already some people crying: |
77 |
> > "oh noez. not yet another daemon..."). |
78 |
> |
79 |
> ... and it is Linux only, which spoils the fun. |
80 |
> |
81 |
> |
82 |
> -- |
83 |
> Fabian Groffen |
84 |
> Gentoo on a different level |
85 |
> |
86 |
> |
87 |
|
88 |
|
89 |
-- |
90 |
tvali |
91 |
|
92 |
Kuskilt foorumist: http://www.cooltests.com - kui inglise keelt oskad. |
93 |
Muide, üle 120 oled väga tark, üle 140 oled geenius, mingi 170 oled ju mingi |
94 |
täica pea nagu prügikast... |