Re: [Wesnoth-dev] Warning -- I am about to break the Windows and MacOS ports!

2007-05-14 Thread Isaac Clerencia
On Monday 14 May 2007 21:35:04 Eric S. Raymond wrote:
> > If it is really a problem we should probably use some more conventional
> > filenames like _main.cfg instead of %main.cfg for example.
>
> Alas, it appears the ls(1) sort algorithm ignores all leading
> non-alphanumerics.
It depends on your system locale, when depending on the sort order it's always 
better to set your locale to C.

[EMAIL PROTECTED]:/tmp/test
% LC_ALL=en_US.UTF-8 ls
bar  foo  _foo
[EMAIL PROTECTED]:/tmp/test
% LC_ALL=C ls
_foo  bar  foo

-- 
Warp Networks | [EMAIL PROTECTED]| http://warp.es
Debian| [EMAIL PROTECTED] | http://www.debian.org

___
Wesnoth-dev mailing list
Wesnoth-dev@gna.org
https://mail.gna.org/listinfo/wesnoth-dev


Re: [Wesnoth-dev] Warning -- I am about to break the Windows and MacOS ports!

2007-05-14 Thread Eric S. Raymond
John McNabb <[EMAIL PROTECTED]>:
> Why not just have a single file name, main.cfg, and if it exists only
> process it automagically?  Internally the main.cfg could define any
> order that is needed.  Do we really need to have some sort of
> automatic ordering of a whole bunch of files? 

%final.cfg is intened to handle cases like the units/ and terrain-graphics
directories, where you want (for example) to be able to drop in a new unit 
.cfg and have it just work.  That is, you *don't* want to have to do surgery
on a local %main.cfg.

An alternative to %final.cfg would be to specify that directory
wildcarding from *within the directory itself* ignores %main.cfg, so
that within units/%main.cfg you could say {units} to pull in
everything else in the directory without recursively including %main.cfg
and blowing up.

%final.cfg is the one that can be done in a completely OS-independent
way, though, so the gain from removing it would be low.  It's %main.cfg 
that needs a Windows port patch.

(On further inspection, it applears we don't actually need any OS X-specific
changes.  That was difficult to see because the code is a tangle of #ifdefs.)
-- 
http://www.catb.org/~esr/";>Eric S. Raymond

___
Wesnoth-dev mailing list
Wesnoth-dev@gna.org
https://mail.gna.org/listinfo/wesnoth-dev


Re: [Wesnoth-dev] Warning -- I am about to break the Windows and MacOS ports!

2007-05-14 Thread John McNabb
Why not just have a single file name, main.cfg, and if it exists only
process it automagically?  Internally the main.cfg could define any
order that is needed.  Do we really need to have some sort of
automatic ordering of a whole bunch of files?  I suspect that there is
some IRC conversation that this added goal of auto-processing multiple
files has come from, since it does not seem to be necessary to achieve
the goal you originally stated in your email.  I actually think that
automatically processing a bunch of files instead of only one is a bad
idea for a bunch of reasons, which you might already have discussed
and dismissed, but I would be curious to know what the reasoning for
this additional goal is.

John (aka Darth Fool)

On 5/14/07, Eric S. Raymond <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> > I've done a quick test at work under Windows XP, i could create a %main.cfg
> > file.
>
> The next step should a fix for the get_files_in_dir() to make it detect
> and handle %main.cfg as Unix does.
>
> > If it is really a problem we should probably use some more conventional
> > filenames like _main.cfg instead of %main.cfg for example.
>
> Alas, it appears the ls(1) sort algorithm ignores all leading
> non-alphanumerics.  I'm reluctantly arriving at the conclusion that we
> may have to either (a) abandon the goal of making these special
> filenames sort first, or (b) use digit-led names like 00-main.cfg
>
> Will Windows choke on "00-main.cfg"?
> --
> http://www.catb.org/~esr/";>Eric S. Raymond
>
> ___
> Wesnoth-dev mailing list
> Wesnoth-dev@gna.org
> https://mail.gna.org/listinfo/wesnoth-dev
>


-- 
---
"In theory, theory and practice are the same,
 but in practice they're different."
---
John W. C. McNabb
---

___
Wesnoth-dev mailing list
Wesnoth-dev@gna.org
https://mail.gna.org/listinfo/wesnoth-dev


Re: [Wesnoth-dev] Warning -- I am about to break the Windows and MacOS ports!

2007-05-14 Thread Eric S. Raymond
[EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> I've done a quick test at work under Windows XP, i could create a %main.cfg
> file.

The next step should a fix for the get_files_in_dir() to make it detect 
and handle %main.cfg as Unix does.

> If it is really a problem we should probably use some more conventional
> filenames like _main.cfg instead of %main.cfg for example.

Alas, it appears the ls(1) sort algorithm ignores all leading
non-alphanumerics.  I'm reluctantly arriving at the conclusion that we
may have to either (a) abandon the goal of making these special
filenames sort first, or (b) use digit-led names like 00-main.cfg

Will Windows choke on "00-main.cfg"?
-- 
http://www.catb.org/~esr/";>Eric S. Raymond

___
Wesnoth-dev mailing list
Wesnoth-dev@gna.org
https://mail.gna.org/listinfo/wesnoth-dev


Re: [Wesnoth-dev] Warning -- I am about to break the Windows and MacOS ports!

2007-05-14 Thread Benoit . TIMBERT
On Mon, May 14, 2007 at 12:18:16PM -0400, Eric S. Raymond wrote:
> I have written and tested Unix support in the WML preprocessor for two
> extensions:
> 
> %final.cfg:   if a directory named 'dir' contains a %final.cfg, then
>   when processing the files in dir is invoked by the 
>   construct {dir}, %final.cfg will be processed last.
>   (The order in which the other files will be processed
>   remains unspecified.)
> 
> %main.cfg:if a directory named 'dir' contains a %main.cfg, then
>   when processing the files in dir is invoked by the 
>   construct {dir}, *only* %main.cfg will be processed
>   automatically.  (It may of course include other files.)
> 
> If a directory has both a %main.cfg and a %final.cfg, the %final.cfg
> will be ignored.
> 
> The reason for these extensions is to allow directories of .cfg
> files to be self-contained packages.  Thus, a campaign named
> "Battle for Fubar" need no longer consist of a Battle_for_Fubar.cfg
> and Battle_for_Fubar subdirectory, but can now consist of the 
> Battle_for_Fubar subdirectory containing a %main.cfg.
> 
> There are three issues with this, one cosmetic and two fundamental:
> 
> 1. The cosmetic issue is that I chose these special names to sort
>to the beginning of ls listings.  Sadly, they don't.  Therefore the
>special names are likely to have to change.
> 
> 2. I don't know what special names are acceptable under Windows and
>MacOS.
> 
> 3. get_files_in_dir() needs port patches to implement %main.cfg under
>Windows and Mac OS X.  As soon as I commit patches that use these
>features, *those ports are going to break*.
> 
> Note to the persons responsible for these ports: please make the small
> patches needed to enable %main.cfg support under your OS.  Please
> write it in terms of the symbol MAINCFG, because the name might change.

Well if % isn't supported by some filesystems, it's starting to be messy...
If some developers / packager / whatever use such filesystem it might even be
a problem for svn checkout...
I've done a quick test at work under Windows XP, i could create a %main.cfg
file.

If it is really a problem we should probably use some more conventional
filenames like _main.cfg instead of %main.cfg for example.

___
Wesnoth-dev mailing list
Wesnoth-dev@gna.org
https://mail.gna.org/listinfo/wesnoth-dev


[Wesnoth-dev] Warning -- I am about to break the Windows and MacOS ports!

2007-05-14 Thread Eric S. Raymond
I have written and tested Unix support in the WML preprocessor for two
extensions:

%final.cfg:   if a directory named 'dir' contains a %final.cfg, then
  when processing the files in dir is invoked by the 
  construct {dir}, %final.cfg will be processed last.
  (The order in which the other files will be processed
  remains unspecified.)

%main.cfg:if a directory named 'dir' contains a %main.cfg, then
  when processing the files in dir is invoked by the 
  construct {dir}, *only* %main.cfg will be processed
  automatically.  (It may of course include other files.)

If a directory has both a %main.cfg and a %final.cfg, the %final.cfg
will be ignored.

The reason for these extensions is to allow directories of .cfg
files to be self-contained packages.  Thus, a campaign named
"Battle for Fubar" need no longer consist of a Battle_for_Fubar.cfg
and Battle_for_Fubar subdirectory, but can now consist of the 
Battle_for_Fubar subdirectory containing a %main.cfg.

There are three issues with this, one cosmetic and two fundamental:

1. The cosmetic issue is that I chose these special names to sort
   to the beginning of ls listings.  Sadly, they don't.  Therefore the
   special names are likely to have to change.

2. I don't know what special names are acceptable under Windows and
   MacOS.

3. get_files_in_dir() needs port patches to implement %main.cfg under
   Windows and Mac OS X.  As soon as I commit patches that use these
   features, *those ports are going to break*.

Note to the persons responsible for these ports: please make the small
patches needed to enable %main.cfg support under your OS.  Please
write it in terms of the symbol MAINCFG, because the name might change.
-- 
http://www.catb.org/~esr/";>Eric S. Raymond

Ideology, politics and journalism, which luxuriate in failure, are
impotent in the face of hope and joy.
-- P. J. O'Rourke

___
Wesnoth-dev mailing list
Wesnoth-dev@gna.org
https://mail.gna.org/listinfo/wesnoth-dev