On 8/19/2011 4:58 PM, Rainer Meier wrote:
Hi Donny and others,

On 19.08.2011 23:23, Donny Brooks wrote:
You are exactly right. I only had the catch all as we had previously had some pc's that we didn't care to setup proper hostnames as they were only in the setup bay for a day then out in the field never to return, or get updates for that matter. The reason I had two for my pc is I was testing something but the duplicate has been removed. I have solved the issue I think by removing the default entry and placing it in the \\management\wpkg\hosts.xml file. But now that we don't really have a "need" for the default entry I have removed it
altogether.

Honestly I am not really happy with the result of this thread. Although Donny seems to be happy now. I think you have discovered a potential bug or at least something which is not clearly defined yet.


In one of your posts you showed that even renaming one file to zz-default.xml it does not appear at the end. The only thing which always appears at the end is the xml file from the root folder (e.g. hosts.xml is read last, always).

This is due to the fact that historically the XML files were read by a WSH function. But it looks nobody ever challenged it and nobody even noticed that this WSH function does not assure any sort order. So the files might be read in random order actually.

In most cases this is fine, but as the contents are evaluated in order too, it makes sense to have the read order of the files defined clearly.

That's why I've made a small modification to address the issue.

Some tests before the change:

Reading XML file: //skynet/RemInst/wpkg.offline/hosts/2-hostb.xml
Reading XML file: //skynet/RemInst/wpkg.offline/hosts/10-hosty.xml
Reading XML file: //skynet/RemInst/wpkg.offline/hosts/1-host1.xml
Reading XML file: //skynet/RemInst/wpkg.offline/hosts/20-hostx.xml
Reading XML file: //skynet/RemInst/wpkg.offline/hosts.xml

As you can see reading 2-hostb.xml first is unexpected. Actually I think I've created this file last - so it's rather sorted by creation date than by file name which I regard as a bug.
I am using Samba 3.6 with SMB2 protocol on Gentoo Linux as a server bwt.

After my modification it reads as follows:

Reading XML file: //skynet/RemInst/wpkg.offline/hosts/1-host1.xml
Reading XML file: //skynet/RemInst/wpkg.offline/hosts/10-hosty.xml
Reading XML file: //skynet/RemInst/wpkg.offline/hosts/2-hostb.xml
Reading XML file: //skynet/RemInst/wpkg.offline/hosts/20-hostx.xml
Reading XML file: //skynet/RemInst/wpkg.offline/hosts.xml

Which is correct (when assuming literal sort order).


I've checked in the changes for you to perform some tests too:

Changes 2011-08-19, v1.2.1-RC8 by Rainer Meier <r.meier (at) wpkg.org>
FIX: XML files read from directories (e.g. hosts/*.xml, profiles/*.xml or
packages/*.xml) have not been explcitly sorted. So the order of reading
     was depending on the OS and not strictly defined.
Now all files are added to an array which is sorted in literal (ASCII) order. Keep in mind if you number your files that sort oder is literally
     and not numerically. So if you name your files "1.xml, 2,xml, 3.xml,
     10.xml, 11.xml, 20.xml" then the sort order will be:
     - 1.xml
     - 10.xml
     - 11.xml
     - 2.xml
     - 20.xml
     - 3.xml
     To prevent this try keeping the same amount of digits:
     - 01.xml
     - 02.xml
     - 03.xml
     - 10.xml
     - 11.xml
     - 20.xml
Thanks to Donny Brooks who seems to have noticed first that the ordering
     somehow goes wrong for him.


Download RC8 from the SVN repository: <http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.2/>

br,
Rainer
Glad I could help out some Rainer. I was not sure if it was a bug or some setting on my system. Since I am using linux on the server end I may be a little different from other users. I will download the latest and see how it works. Thanks for all you do!

Donny B.
-------------------------------------------------------------------------
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
_______________________________________________
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users

Reply via email to