1 |
On Thu, Feb 06, 2003 at 07:53:53PM -0800, Matt Tucker wrote: |
2 |
[..] |
3 |
> Briefly, the patch implements the following features: |
4 |
> |
5 |
> * Alter config file handling (keeping current versions). |
6 |
> * Auto-migrate ._cfg files to new structure during Portage upgrade. |
7 |
> * Auto-replace unchanged config files when new versions are |
8 |
> installed. |
9 |
> * New FEATURE config_automerge tells Portage to automatically merge |
10 |
> config file changes into the current file. Finding a conflict |
11 |
> aborts this merge. |
12 |
> * Implement etc-update in python. |
13 |
> * Fully implement 'menu' mode in etc-update (using dialog). |
14 |
> Requires pythondialog |
15 |
> <http://bugs.gentoo.org/show_bug.cgi?id=15238>. |
16 |
> * Support 3-way diffs/merges in etc-update. |
17 |
|
18 |
Very cool. This is almost enough to actually use CVS for files in /etc, |
19 |
or at least RCS. The reason why RCS might be needed instead of CVS is |
20 |
illustrated using file: |
21 |
|
22 |
galen:/etc# find \! -type d | xargs file | egrep -v |
23 |
'text|empty|source|symbolic link' |
24 |
./ld.so.cache: data |
25 |
./ssh/ssh_host_key: data |
26 |
./mail/aliases.db: Berkeley DB (Hash, version |
27 |
7, native byte-order) |
28 |
./ioctl.save: data |
29 |
./X11/app-defaults/XF86Cfg: Bennet Yee's "face" format |
30 |
./X11/rstart/rstartd.real: ELF 32-bit LSB executable, |
31 |
Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked |
32 |
(uses shared libs), stripped |
33 |
./X11/xdm/chooser: ELF 32-bit LSB executable, |
34 |
Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked |
35 |
(uses shared libs), stripped |
36 |
./cups/ppd/hp1220c.ppd: PPD file, ve |
37 |
./cups/ppds.dat: data |
38 |
|
39 |
Note that CVS is not fond of symlinks, but tollerates them as long as they |
40 |
are not in the CVS database. Suggest two trivial functions to manage |
41 |
this: one which prunes nonexistant files from .cvsignore, and one which |
42 |
ensures that any symlinks get listed. |
43 |
|
44 |
CVS does not gracefully cope with binary data. Obviously certain files |
45 |
here are generated automatically and would also get .cvsignore'd. ELF |
46 |
binaries have absolutely zero place in /etc, according to the FHS, |
47 |
however. |
48 |
|
49 |
RCS would allow config file management without dealing with these issues |
50 |
since you'd only maintain RCS files for those things you actually care |
51 |
about. I would consider this more a bandaid though, I would prefer that |
52 |
etc-update have a config option to maintain .cvsignore files for you so |
53 |
that your CONFIG_PROTECT directories may trivially be stored in CVS, using |
54 |
a helper tool which a sysadmin can use themselves if they like. In this |
55 |
way, etc-update would merge changes into a temp file, let you edit it, and |
56 |
then overwrite your existing file as an atomic operation. When you're |
57 |
done, check the results into CVS for safe-keeping. |
58 |
|
59 |
|
60 |
CVS vendor tags are also an option, however they are more complex to work |
61 |
with in my experience and fewer people will be able to do it well. Doing |
62 |
the merge into the working copy in the CONFIG_PROTECT'd directory is |
63 |
probably easier for people. If the files are also checked in with a |
64 |
vendor tag, that'll just make it easier for tools an sysadmins which grok |
65 |
more advanced CVS usage. |
66 |
|
67 |
|
68 |
I haven't yet looked over your patch extensively (and do not trust myself |
69 |
to not screw something up at this hour), but I figured I'd offer my |
70 |
comments anyway. Take them with a Syberian salt mine if they seem to be |
71 |
missing something obvious. =) |
72 |
|
73 |
|
74 |
[..] |
75 |
> One other thing I wanted to point out is that I renamed portage.py to |
76 |
> portage/__init__.py and added the new functionality in |
77 |
> portage/config_protect.py. This change will allow the portage module to |
78 |
> eventually be broken up into separate smaller modules. I think this |
79 |
> would be a good thing from a maintenance standpoint. |
80 |
|
81 |
A good plan, I think, looking at the file in question. |
82 |
|
83 |
-- |
84 |
Joseph Carter <knghtbrd@×××.org> I swallowed your goldfish |
85 |
|
86 |
<Overfiend> Don't come crying to me about your "30 minute compiles"!! I |
87 |
have to build X uphill both ways! In the snow! With bare |
88 |
feet! And we didn't have compilers! We had to translate the |
89 |
C code to mnemonics OURSELVES! |
90 |
<Overfiend> And I was 18 before we even had assemblers! |