Ok, I just looked at line 307 to 344, where the 'case' is and then one  
could get the idea that create and overwrite was the same action. :)
But these pointers bring new light over the "issue". However, I think I  
should have created the hints array and then just intersected it with  
hintsAllowed and opts_available like:

requested_actions=$(Hints_For $file)
allowed_requested_actions=$(Array_Intersect $opts_available $hintsAllowed)
available_allowed_requested_actions=$(Array_Intersect  
$allowed_requested_actions $opts_available)

just for readability (but this code is nothing I've tested, so it might  
not work).

The docs are really good, but I didn't know of that doc, so I tried to  
figure out what was happening, just by looking at the code (but it wasn't  
going that well :) )

A thought: perhaps settings directed by hints should produce a different  
output (I know I'm drifting slightly ot here)? An example:

]UpdateSettings openssh
UpdateSettings: Current and default settings are different

  1      mod: Settings/ssh/moduli
  2      mod: Settings/ssh/ssh_config
  3      mod: Settings/ssh/sshd_config
  4      del: Settings/ssh/ssh_host_dsa_key
  5      del: Settings/ssh/ssh_host_dsa_key.pub
  6      del: Settings/ssh/ssh_host_key
  7      del: Settings/ssh/ssh_host_key.pub
  8      del: Settings/ssh/ssh_host_rsa_key
  9      del: Settings/ssh/ssh_host_rsa_key.pub
10      del: Settings/ssh/ssh_prng_cmds

[...]
UpdateSettings: Not deleting Settings/ssh/ssh_host_dsa_key
UpdateSettings: Not deleting Settings/ssh/ssh_host_dsa_key.pub
UpdateSettings: Not deleting Settings/ssh/ssh_host_key
UpdateSettings: Not deleting Settings/ssh/ssh_host_key.pub
UpdateSettings: Not deleting Settings/ssh/ssh_host_rsa_key
UpdateSettings: Not deleting Settings/ssh/ssh_host_rsa_key.pub
UpdateSettings: Not deleting Settings/ssh/ssh_prng_cmds

I cut away the "mod" parts as I didn't have any hints for them, but for  
the ssh_host* files I had the hint "skip", but perhaps the files should  
not be listed in the first list, or just a note that the behavoiur for  
those files are already decided by hints? Same thing with the log  
messages, the user might wonder why the files wheren't deleted (or  
created/updated/anything).

/Jonas

On Wed, 22 Nov 2006 20:42:57 +0100, Dan <[EMAIL PROTECTED]> wrote:

> I just double-checked the UpdateSettings source and confirmed this.
>
> Take a look at lines 260 thru 279. UpdateSettings builds an
> opts_available array based on $difftype. 'create' is only added if
> the file doesn't already exist in /Programs/Foo/Settings. Further
> down (289), hints are only used if they're in the opts_available
> array. So, even though the create action and the overwrite action are
> technically the same, a 'create' hint will only have an effect on
> UpdateSettings' behavior when current is missing.
>
> The docs I linked to have the available hints broken into categories
> along with a description of when each one is available, or you could
> just read the source now that you know where to look :)
>
>
>> Assuming everything still works the way I documented it long long
>> ago, create doesn't overwrite. "overwrite" overwrites.
>>
>> UpdateSettings determines what it can do before it determines what it
>> should do. If a file already exists, "create" won't be possible, so a
>> create hint will be ignored.
>>
>> http://gobo.kundor.org/wiki/UpdateSettings#Update_Commands
>>
>>
>>
>>> I tried to find a hint, but it seems like there is no "use default
>>> when
>>> current is missing". The hints "create" and "overwrite" both do the
>>> same
>>> thing and "skip" does nothing. I'd like "create" not to overwrite
>>> if the
>>> file already exist, or have I missed something?
>>>
>>> --
>>> /Jonas
>>>
>>> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
>>> _______________________________________________
>>> gobolinux-devel mailing list
>>> gobolinux-devel@lists.gobolinux.org
>>> http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel
>>
>> _______________________________________________
>> gobolinux-devel mailing list
>> gobolinux-devel@lists.gobolinux.org
>> http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel
>
> _______________________________________________
> gobolinux-devel mailing list
> gobolinux-devel@lists.gobolinux.org
> http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
_______________________________________________
gobolinux-devel mailing list
gobolinux-devel@lists.gobolinux.org
http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel

Reply via email to