|
From: <hzu...@ra...> - 2004-01-28 22:51:10
|
On 01/28/2004 08:37:06 AM Bruce Smith wrote: >> does anyone have a problem with it, when I pre-select all the files in >> upgrade-config per default? >> >> I just upgraded my server at home and it was still too much work. ;-) > >I think we should set some things by default, and not others. > >For example, files in /etc/init.d/ should NOT be selected by default >since they are most likely updates that should not be overwritten. I would also not select any files which were created in 1980, since this means they didn't get modified. Heiko |
|
From: <hzu...@ra...> - 2004-01-31 15:22:49
|
On 01/28/2004 05:47:18 PM Friedrich Lobenstock wrote: >Bruce Smith wrote on 28.01.2004 14:37 MET: >>>does anyone have a problem with it, when I pre-select all the files in >>>upgrade-config per default? [...] >> >> I think we should set some things by default, and not others. >> >> For example, files in /etc/init.d/ should NOT be selected by default >> since they are most likely updates that should not be overwritten. > >But the firewall.rules file should of course be selected as >that is usually the most important part on any DL, isn't it? ;-) Good point. Heiko |
|
From: Friedrich L. <fl...@fl...> - 2004-01-31 15:30:37
|
hzu...@ra... wrote on 29.01.2004 14:57 MET: > On 01/28/2004 05:47:18 PM Friedrich Lobenstock wrote: > >>Bruce Smith wrote on 28.01.2004 14:37 MET: >> >>>>does anyone have a problem with it, when I pre-select all the files in >>>>upgrade-config per default? [...] >>> >>>I think we should set some things by default, and not others. >>> >>>For example, files in /etc/init.d/ should NOT be selected by default >>>since they are most likely updates that should not be overwritten. >> >>But the firewall.rules file should of course be selected as >>that is usually the most important part on any DL, isn't it? ;-) > > Good point. Shouldn't we move firewall.rules to /etc/sysconfig/network? /etc/sysconfig will propably be always be selected for upgrade. -- MfG / Regards Friedrich Lobenstock ____________________________________________________________________ Friedrich Lobenstock Linux Services Lobenstock URL: http://www.lsl.at/ Email: fl...@fl... ____________________________________________________________________ |
|
From: Heiko Z. <he...@zu...> - 2004-01-31 16:06:17
|
Friedrich Lobenstock wrote: > hzu...@ra... wrote on 29.01.2004 14:57 MET: > >> On 01/28/2004 05:47:18 PM Friedrich Lobenstock wrote: >> >>> Bruce Smith wrote on 28.01.2004 14:37 MET: >>> >>>>> does anyone have a problem with it, when I pre-select all the files in >>>>> upgrade-config per default? [...] >>>> >>>> >>>> I think we should set some things by default, and not others. >>>> >>>> For example, files in /etc/init.d/ should NOT be selected by default >>>> since they are most likely updates that should not be overwritten. >>> >>> >>> But the firewall.rules file should of course be selected as >>> that is usually the most important part on any DL, isn't it? ;-) >> >> >> Good point. > > > Shouldn't we move firewall.rules to /etc/sysconfig/network? > /etc/sysconfig will propably be always be selected for upgrade. > That's a good thought, I would agree to this. Of course upgrade-config needs to take care of this. Heiko |
|
From: Bruce S. <bw...@ar...> - 2004-01-31 22:52:04
|
> > Shouldn't we move firewall.rules to /etc/sysconfig/network? > > /etc/sysconfig will propably be always be selected for upgrade. > > That's a good thought, I would agree to this. > Of course upgrade-config needs to take care of this. It is a script. An init script. All the other init scripts are in init.d. I guess it could go either place... :-) As far as default files to be selected in update-config, I think we should make a table of files (and maybe directories) that are initially selected, and leave everything else turned off. I REALLY don't want to make a mistake and select anything by default that shouldn't be. A novice may not know what a file is, and ass-u-me that since we defaulted it to be copied that it should be. - BS |
|
From: Friedrich L. <fl...@fl...> - 2004-02-01 01:59:30
|
Bruce Smith wrote on 31.01.2004 23:52 MET: >>>Shouldn't we move firewall.rules to /etc/sysconfig/network? >>>/etc/sysconfig will propably be always be selected for upgrade. >> >>That's a good thought, I would agree to this. >>Of course upgrade-config needs to take care of this. > > > It is a script. An init script. It's the "config file" of /etc/init.d/firewall, isn't it? :-) > All the other init scripts are in init.d. > I guess it could go either place... :-) Was just a thought to make it more intuitive to see which files will propably need migration/copying from version to version. > As far as default files to be selected in update-config, I think we > should make a table of files (and maybe directories) that are initially > selected, and leave everything else turned off. > > I REALLY don't want to make a mistake and select anything by default > that shouldn't be. A novice may not know what a file is, and ass-u-me > that since we defaulted it to be copied that it should be. Absolutely right. -- MfG / Regards Friedrich Lobenstock ____________________________________________________________________ Friedrich Lobenstock Linux Services Lobenstock URL: http://www.lsl.at/ Email: fl...@fl... ____________________________________________________________________ |
|
From: Bruce S. <bw...@ar...> - 2004-02-01 02:23:22
|
> >>>Shouldn't we move firewall.rules to /etc/sysconfig/network? > >>>/etc/sysconfig will propably be always be selected for upgrade. > >> > >>That's a good thought, I would agree to this. > >>Of course upgrade-config needs to take care of this. > > > > It is a script. An init script. > > It's the "config file" of /etc/init.d/firewall, isn't it? :-) It's that too! :-) > > All the other init scripts are in init.d. > > I guess it could go either place... :-) > > Was just a thought to make it more intuitive to see which files > will propably need migration/copying from version to version. I don't know which place is better. It's easier to leave it alone. :-) > > As far as default files to be selected in update-config, I think we > > should make a table of files (and maybe directories) that are initially > > selected, and leave everything else turned off. > > > > I REALLY don't want to make a mistake and select anything by default > > that shouldn't be. A novice may not know what a file is, and ass-u-me > > that since we defaulted it to be copied that it should be. > > Absolutely right. What's the most efficient way to check each file against a large list of filenames in a script? I'm thinking a bunch of lines like this isn't the best. [ $i = file1 ] && ..." [ $i = file2 ] && ..." [ $i = file3 ] && ..." .... Or a big long case statement? case $i in file1 | file2 | file3 | ... ) Or putting all the files to check in a text file, and doing a: "[ $(grep -xc $i filelist.txt) -eq 1 ] && ..." Or something else? The grep example is the cleanest bash code, but what about performance? The upgrade-config script is already a little slow, and I'm more concerned about speed than how it looks. (my guess is still grep, but I'd like hear other thoughts) - BS |
|
From: Friedrich L. <fl...@fl...> - 2004-02-01 10:55:53
|
Bruce Smith wrote on 01.02.2004 03:23 MET:
>>>>>Shouldn't we move firewall.rules to /etc/sysconfig/network?
>>>>>/etc/sysconfig will propably be always be selected for upgrade.
>>>>
>>>All the other init scripts are in init.d.
>>>I guess it could go either place... :-)
>>
>>Was just a thought to make it more intuitive to see which files
>>will propably need migration/copying from version to version.
>
> I don't know which place is better.
> It's easier to leave it alone. :-)
Ok.
> What's the most efficient way to check each file against a large list of
> filenames in a script?
>
> I'm thinking a bunch of lines like this isn't the best.
> [ $i = file1 ] && ..."
> [ $i = file2 ] && ..."
> [ $i = file3 ] && ..."
> ....
>
> Or a big long case statement?
> case $i in
> file1 | file2 | file3 | ... )
>
> Or putting all the files to check in a text file, and doing a:
> "[ $(grep -xc $i filelist.txt) -eq 1 ] && ..."
grep -qx $i filelist.txt &&
or
if grep -qx $i filelist.txt; then
....
fi
>
> Or something else?
>
> The grep example is the cleanest bash code, but what about performance?
> The upgrade-config script is already a little slow, and I'm more
> concerned about speed than how it looks.
>
> (my guess is still grep, but I'd like hear other thoughts)
I think you could try the following (filelist.txt becomes selectlist):
# build candidate list (a list of all available files)
....... >> /tmp/candidates
# calculate intersection of candidate list with select list
TO_SELECT=$(sort /tmp/candidates selectlist | uniq -d)
for SELECT in $TO_SELECT; do
# cycle through all the files that should be selected per default
...set variables...
done
"uniq -d" gives you those lines of both files that are equal,
so you will get exactly a list of file that exist in the current
config which should be selected per default.
--
MfG / Regards
Friedrich Lobenstock
____________________________________________________________________
Friedrich Lobenstock Linux Services Lobenstock
URL: http://www.lsl.at/ Email: fl...@fl...
____________________________________________________________________
|
|
From: Heiko Z. <he...@zu...> - 2004-02-01 15:55:16
|
Friedrich Lobenstock wrote: > Bruce Smith wrote on 01.02.2004 03:23 MET: > >>>>>> Shouldn't we move firewall.rules to /etc/sysconfig/network? >>>>>> /etc/sysconfig will propably be always be selected for upgrade. >>>>> >>>>> >>>> All the other init scripts are in init.d. >>>> I guess it could go either place... :-) >>> >>> >>> Was just a thought to make it more intuitive to see which files >>> will propably need migration/copying from version to version. >> >> >> I don't know which place is better. >> It's easier to leave it alone. :-) > > > Ok. > > >> What's the most efficient way to check each file against a large list of >> filenames in a script? >> >> I'm thinking a bunch of lines like this isn't the best. >> [ $i = file1 ] && ..." >> [ $i = file2 ] && ..." >> [ $i = file3 ] && ..." >> .... >> >> Or a big long case statement? case $i in >> file1 | file2 | file3 | ... ) >> >> Or putting all the files to check in a text file, and doing a: >> "[ $(grep -xc $i filelist.txt) -eq 1 ] && ..." > > > grep -qx $i filelist.txt && > > or > > if grep -qx $i filelist.txt; then > .... > fi > >> >> Or something else? >> >> The grep example is the cleanest bash code, but what about performance? >> The upgrade-config script is already a little slow, and I'm more >> concerned about speed than how it looks. >> >> (my guess is still grep, but I'd like hear other thoughts) > > > I think you could try the following (filelist.txt becomes selectlist): > > # build candidate list (a list of all available files) > ....... >> /tmp/candidates > > # calculate intersection of candidate list with select list > TO_SELECT=$(sort /tmp/candidates selectlist | uniq -d) > > for SELECT in $TO_SELECT; do > # cycle through all the files that should be selected per default > ...set variables... > done > > "uniq -d" gives you those lines of both files that are equal, > so you will get exactly a list of file that exist in the current > config which should be selected per default. I blame it on the early time, but I'm confused now.... Anyhow, you also need to check the filedate, you can exclude all the 1980 ones. This should further reduce possible errors. Heiko |
|
From: Friedrich L. <fl...@fl...> - 2004-02-01 16:32:29
|
Heiko Zuerker wrote on 01.02.2004 16:50 MET: > Friedrich Lobenstock wrote: > >> Bruce Smith wrote on 01.02.2004 03:23 MET: >> >>> The grep example is the cleanest bash code, but what about performance? >>> The upgrade-config script is already a little slow, and I'm more >>> concerned about speed than how it looks. >>> >>> (my guess is still grep, but I'd like hear other thoughts) >> >> I think you could try the following (filelist.txt becomes selectlist): >> >> # build candidate list (a list of all available files) >> ....... >> /tmp/candidates >> >> # calculate intersection of candidate list with select list >> TO_SELECT=$(sort /tmp/candidates selectlist | uniq -d) >> >> for SELECT in $TO_SELECT; do >> # cycle through all the files that should be selected per default >> ...set variables... >> done >> >> "uniq -d" gives you those lines of both files that are equal, >> so you will get exactly a list of file that exist in the current >> config which should be selected per default. > > > I blame it on the early time, but I'm confused now.... > > Anyhow, you also need to check the filedate, you can exclude all the > 1980 ones. This should further reduce possible errors. Ok, to clarify this, I thought this is clear but if you only add the files with date > 1980 to the /tmp/candidates files the result should be what you want. PS: I don't have to tell you that you should run mktemp to create a temporary file (see sample code in "man 1 mktemp") instead of using /tmp/candidates which was just used to be descriptive. -- MfG / Regards Friedrich Lobenstock ____________________________________________________________________ Friedrich Lobenstock Linux Services Lobenstock URL: http://www.lsl.at/ Email: fl...@fl... ____________________________________________________________________ |