Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-15 Thread Neil Mitchell
On Mon, Jan 10, 2011 at 10:17 PM, Neil Mitchell ndmitch...@gmail.com wrote:
 If so, I'll make a new release that just changes the
 file creation mask to the above during hoogle data (and sets it back
 after).

Thanks to Erik's help testing preview versions I've now released
Hoogle 4.1.4 that sets the file creation mask appropriately.

Thanks, Neil

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-15 Thread Ivan Lazar Miljenovic
On 15 January 2011 22:53, Neil Mitchell ndmitch...@gmail.com wrote:
 On Mon, Jan 10, 2011 at 10:17 PM, Neil Mitchell ndmitch...@gmail.com wrote:
 If so, I'll make a new release that just changes the
 file creation mask to the above during hoogle data (and sets it back
 after).

 Thanks to Erik's help testing preview versions I've now released
 Hoogle 4.1.4 that sets the file creation mask appropriately.

Shouldn't data like this really go in /var rather than /usr ?  To
quote Wikipedia [1]: /var/: Variable files—files whose content is
expected to continually change during normal operation of the
system—such as logs, spool files, and temporary e-mail files.

[1]: http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-15 Thread Neil Mitchell
 Thanks to Erik's help testing preview versions I've now released
 Hoogle 4.1.4 that sets the file creation mask appropriately.

 Shouldn't data like this really go in /var rather than /usr ?  To
 quote Wikipedia [1]: /var/: Variable files—files whose content is
 expected to continually change during normal operation of the
 system—such as logs, spool files, and temporary e-mail files.

The Hoogle databases are expected to change very rarely - most users
will install them when they install Hoogle. A small number will update
them occasionally as the packages update. I'm using the Cabal datadir
to store the databases, but does Cabal provide a more sensible place
to put them? As a Windows user, I'm happy to defer to what Posix
system users want.

Thanks, Neil

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-15 Thread Joachim Breitner
Hi,

Am Samstag, den 15.01.2011, 13:38 + schrieb Neil Mitchell:
  Thanks to Erik's help testing preview versions I've now released
  Hoogle 4.1.4 that sets the file creation mask appropriately.
 
  Shouldn't data like this really go in /var rather than /usr ?  To
  quote Wikipedia [1]: /var/: Variable files—files whose content is
  expected to continually change during normal operation of the
  system—such as logs, spool files, and temporary e-mail files.
 
 The Hoogle databases are expected to change very rarely - most users
 will install them when they install Hoogle. A small number will update
 them occasionally as the packages update. I'm using the Cabal datadir
 to store the databases, but does Cabal provide a more sensible place
 to put them? As a Windows user, I'm happy to defer to what Posix
 system users want.

shouldn’t they change with every library update? In that case, maybe
that should be managed by cabal, similar to how cabal can update your
haddock index at ~/.cabal/share/doc/index.html.

(Such an infrastructure would be nice for other people as well, e.g.
leksah).

But I might misunderstand how hoogle works and what the databases are
for.

Greetings,
Joachim

-- 
Joachim nomeata Breitner
  mail: m...@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nome...@joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nome...@debian.org


signature.asc
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-15 Thread Neil Mitchell
Hi Joachim,

 The Hoogle databases are expected to change very rarely - most users
 will install them when they install Hoogle. A small number will update
 them occasionally as the packages update. I'm using the Cabal datadir
 to store the databases, but does Cabal provide a more sensible place
 to put them? As a Windows user, I'm happy to defer to what Posix
 system users want.

 shouldn’t they change with every library update? In that case, maybe
 that should be managed by cabal, similar to how cabal can update your
 haddock index at ~/.cabal/share/doc/index.html.

Yes, that's exactly how it should work. All we need is someone to do
the work :-) There is a bug tracking the progress on this issue here:
http://code.google.com/p/ndmitchell/issues/detail?id=80 - but its a
reasonable amount of work, touching lots of different parts of the
Haskell infra.

Thanks, Neil

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-10 Thread Erik de Castro Lopo
Neil Mitchell wrote:

 Should all files created by hoogle data always have world
 read/execute? I'm not sure what the Unix conventions are - would that
 be reasonable? 

The files created by the 'hoogle data' command in /usr/share/hoogle
should probably all be world readable. The directories should all
be world readable and world executable (ie allow anyone to chdir
into it).

 If so, I'll make a new release that just changes the
 file creation mask to the above during hoogle data (and sets it back
 after).

That makes sense. If you have a darcs repo of the code (or even a
tarball), I can check it before create a package.

Cheers,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-10 Thread Neil Mitchell
 If so, I'll make a new release that just changes the
 file creation mask to the above during hoogle data (and sets it back
 after).

 That makes sense. If you have a darcs repo of the code (or even a
 tarball), I can check it before create a package.

That would be very useful. I'll try and update the darcs version
tomorrow and let you know when it's done.

Thanks, Neil

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-09 Thread Neil Mitchell
Hi Erik,

I'll release Hoogle 4.1.3 with a fix later today.

Thanks, Neil

On Sun, Jan 9, 2011 at 5:07 AM, Erik de Castro Lopo
mle...@mega-nerd.com wrote:
 Hi all,

 I'm testing out hoogle 4.1.2 on Debian Linux and getting the
 following when trying to update the local hoogle databases:

    erik  sudo hoogle data
    Starting default
    Starting keyword
    hoogle: keyword.txt: commitAndReleaseBuffer: invalid argument
    (Invalid or incomplete multibyte or wide character)

 My LANG related envorinment variables are set as follows:

    erik  env | grep LANG
    LANG=en_AU.UTF-8
    GDM_LANG=en_AU.UTF-8
    LANGUAGE=en_AU.UTF-8
    LC_LANG=en_AU.UTF-8

 When faced with a similar problem while working on Ben Lippmeier's
 compiler, I fixed this by replacing all instances of readFile with
 readUtf8File which is defined as:

    readUtf8File :: FilePath - IO String
    readUtf8File filePath
     = do   h - openFile filePath ReadMode
            hSetEncoding h utf8
            hSetEncoding stdout utf8
            hGetContents h

 Is it possible to fix this without hacking the hoogles sources?
 I'd like to package hoogle for Debian, but first I need to get
 it working.

 Cheers,
 Erik
 --
 --
 Erik de Castro Lopo
 http://www.mega-nerd.com/

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-09 Thread Neil Mitchell
Hi Erik,

Hoogle 4.1.3 is now released, which reads and writes Hoogle input
files in UTF8 throughout. Please let me know if this doesn't fix your
problem.

Thanks, Neil

On Sun, Jan 9, 2011 at 11:22 AM, Neil Mitchell ndmitch...@gmail.com wrote:
 Hi Erik,

 I'll release Hoogle 4.1.3 with a fix later today.

 Thanks, Neil

 On Sun, Jan 9, 2011 at 5:07 AM, Erik de Castro Lopo
 mle...@mega-nerd.com wrote:
 Hi all,

 I'm testing out hoogle 4.1.2 on Debian Linux and getting the
 following when trying to update the local hoogle databases:

    erik  sudo hoogle data
    Starting default
    Starting keyword
    hoogle: keyword.txt: commitAndReleaseBuffer: invalid argument
    (Invalid or incomplete multibyte or wide character)

 My LANG related envorinment variables are set as follows:

    erik  env | grep LANG
    LANG=en_AU.UTF-8
    GDM_LANG=en_AU.UTF-8
    LANGUAGE=en_AU.UTF-8
    LC_LANG=en_AU.UTF-8

 When faced with a similar problem while working on Ben Lippmeier's
 compiler, I fixed this by replacing all instances of readFile with
 readUtf8File which is defined as:

    readUtf8File :: FilePath - IO String
    readUtf8File filePath
     = do   h - openFile filePath ReadMode
            hSetEncoding h utf8
            hSetEncoding stdout utf8
            hGetContents h

 Is it possible to fix this without hacking the hoogles sources?
 I'd like to package hoogle for Debian, but first I need to get
 it working.

 Cheers,
 Erik
 --
 --
 Erik de Castro Lopo
 http://www.mega-nerd.com/

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-09 Thread Erik de Castro Lopo
Neil Mitchell wrote:

 Hoogle 4.1.3 is now released, which reads and writes Hoogle input
 files in UTF8 throughout. Please let me know if this doesn't fix your
 problem.

Thanks Neil for the quick response. That definitely has fixed thet
problem.

The next problem is that hoogle installed as a Debian package would
install as root as /usr/bin/hoogle. Then, when I run hoogle data it
wants to install the database at /usr/share/hoogle/hoogle-4.1.3/databases
which fails because I'm not running as root. So, to install the databases
I need to run sudo hoogle data (which is acceptable), but then an
unprivelidge user can't run hoogle because they don't have read permission
on the database.

The solution would be to set the umask before writing the databases.
Something like (untested):

import System.Posx


-- Set umask to world read/execute. Save old umask for
-- restoration later.
oldumask - setFileCreationMask 0o022


If you need help with this, let me know.

Cheers,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-09 Thread Neil Mitchell
Hi Erik,

 The next problem is that hoogle installed as a Debian package would
 install as root as /usr/bin/hoogle. Then, when I run hoogle data it
 wants to install the database at /usr/share/hoogle/hoogle-4.1.3/databases
 which fails because I'm not running as root. So, to install the databases
 I need to run sudo hoogle data (which is acceptable), but then an
 unprivelidge user can't run hoogle because they don't have read permission
 on the database.

 The solution would be to set the umask before writing the databases.
 Something like (untested):

    import System.Posx


    -- Set umask to world read/execute. Save old umask for
    -- restoration later.
    oldumask - setFileCreationMask 0o022

Should all files created by hoogle data always have world
read/execute? I'm not sure what the Unix conventions are - would that
be reasonable? If so, I'll make a new release that just changes the
file creation mask to the above during hoogle data (and sets it back
after).

Thanks, Neil

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] hoogle command line program on Linux

2011-01-08 Thread Erik de Castro Lopo
Hi all,

I'm testing out hoogle 4.1.2 on Debian Linux and getting the
following when trying to update the local hoogle databases:

erik  sudo hoogle data
Starting default
Starting keyword
hoogle: keyword.txt: commitAndReleaseBuffer: invalid argument
(Invalid or incomplete multibyte or wide character)

My LANG related envorinment variables are set as follows:

erik  env | grep LANG
LANG=en_AU.UTF-8
GDM_LANG=en_AU.UTF-8
LANGUAGE=en_AU.UTF-8
LC_LANG=en_AU.UTF-8

When faced with a similar problem while working on Ben Lippmeier's
compiler, I fixed this by replacing all instances of readFile with
readUtf8File which is defined as:

readUtf8File :: FilePath - IO String
readUtf8File filePath
 = do   h - openFile filePath ReadMode
hSetEncoding h utf8
hSetEncoding stdout utf8
hGetContents h

Is it possible to fix this without hacking the hoogles sources?
I'd like to package hoogle for Debian, but first I need to get
it working.

Cheers,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe