[haiku-development] Re: Looking for feedback on enhancements for dealing with Mac keyboards with Haiku

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 27 Sep 2011 20:20:43 +0200

On 2011-09-27 at 06:23:46 [+0200], John Scipione <jscipione@xxxxxxxxx> wrote:
> On Mon, Sep 26, 2011 at 11:33 PM, Ingo Weinhold <ingo_weinhold@xxxxxx>wrote:
> > -- people might have other local files there (e.g. backup files generated
> > by editors).
> 
> Well, I suppose that we could exclude files in the directory (every
> directory really) that begin with ~ since that is a common way for editors
> to mark temporary files,

Yeah, or they suffix the files with "~" or ".bak" or ".*.swp" or ...

> but that is already a problem in the current
> HaikuImage (I think).

Yes, there are already several cases where CopyDirectoryToHaikuImage is used 
and a few more that use Glob (though at least mostly with a stricter pattern).

> Temp files certainly are a problem but they are not
> the problem I am trying to solve right now. If you want to solve that
> problem it would have to happen in a different ticket that specifically
> addresses that particular shortcoming of HaikuImage.
> 
> I could explicitly include each file to program more defensively; I know how
> to do that already. However, I believe that It is better to copy all the
> files in that directory over so that someone who comes along later won't
> have the same trouble that I had. Meaning someone will come along and add a
> keyboard layout file to that directory expecting it to show up in the keymap
> app and it wouldn't because they would have to also add the file explicitly
> to the HaikuImage. That is confusing.

The build system isn't intended for "someone who comes along". HaikuImage is 
the central place that defines what ends up in the image, so the general 
expectation should be that you have to edit that file, if you want to add 
something to the image.

> > Moreover, just because ATM all files contained in the directories should 
> > be
> > copied doesn't mean that this will be the case forever. If someone puts an
> > experimental layout there that is not ready for prime time or a Jamfile,
> > .gitignore, or ... is added for whatever reason, those would have to be
> > excluded from copying them to the image as well.
> 
> If you put an experimental layout file in that directory you want it to be
> included in the image. That's why you put it there. You don't commit that
> file to the repo if it isn't ready, but if you are doing testing, the file
> should be copied over so that it will show up in the keymap app so that you
> can, well, test it.

The purpose of the VCS is not to manage only stuff that is ready for prime 
time. Committing a work in progress is completely acceptable and even 
encouraged (unless it messes things up for other people) and it is simply not 
possible in the cases where CopyDirectoryToHaikuImage or Glob is used, since 
it would automatically end up in the image.

The encouraged method to add something to the image locally is to do that in 
your UserBuildConfig, BTW.

> > This kind of reverses the purpose of HaikuImage. It is supposed to define
> > the image contents, not what shouldn't be part of it.
> 
> This is the code I'd like to replace the keyboardLayout copying code with:
> 
> # Copy Keyboard Layout files including subdirectories
> CopyDirectoryToHaikuImage system data
> : [ FDirName $(HAIKU_TOP) data system data KeyboardLayouts ]
> : "KeyboardLayouts" : -x .svn ;
> 
> This will copy all files from the directory (minus the .svn/ dir) into the
> keyboardLayout directory in the image. So I am not defining what should not
> be part of the image contents, I am defining what should, everything except
> the previously mentioned brain-dead .svn/ dir.

Yes, everything except the .svn dir and later also except whatever other 
undesirables may crop up. Which is exactly my point: You no longer list the 
files that shall end up in the image, instead you have to list the exceptions.

CU, Ingo

Other related posts: