--8323328-789273727-10957773679789
Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-789273727-1095777367=:29789"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323328-789273727-10957773679789
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Tue, 21 Sep 2004, Mauricio [iso-8859-1] FernŠŌdez wrote:

> On Tue, Sep 21, 2004 at 01:19:48PM +0900, trans.  (T. Onoma) wrote:
>> On Monday 20 September 2004 11:27 pm, Minero Aoki wrote:
>>> Try latest version of setup.rb (3.3.0).
>>
>> Oh. Almost forgot. Does setup.rb have Ara's hack #42 ?
>
> It has been doing shebang correction since mmm the beginning of time :-)

i know it's supposed to - but i can't seem to make it:


   jib:~/eg/ruby/tmp > for f in bin/*;do file $f;done
   bin/a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), forNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
   bin/a.pl: a perl  script text executable
   bin/a.rb: a ruby script text executable

   jib:~/eg/ruby/tmp > ruby setup.rb config --ruby-path=/dmsp/reference/bin/ruby --bin-dir=/home/ahoward/bin
   ---> bin
   <--- bin

   jib:~/eg/ruby/tmp > ruby setup.rb setup
   ---> bin
   <--- bin

   jib:~/eg/ruby/tmp > ruby setup.rb install
   ---> bin
   mkdir -p /home/ahoward/bin/
   install a.out /home/ahoward/bin/
   install a.rb /home/ahoward/bin/
   install a.pl /home/ahoward/bin/
   <--- bin

   jib:~/eg/ruby/tmp > cat /home/ahoward/bin/a.rb
   #!/usr/bin/env ruby
   puts 42



??  what am i doing wrong  ??


but:


   jib:~/eg/ruby/tmp > ruby install.rb -b ~/bin/
   bin/a.pl -> /home/ahoward/bin/a.pl
   chmod 0755 /home/ahoward/bin/a.pl
   bin/a.rb -> /home/ahoward/bin/a.rb
   chmod 0755 /home/ahoward/bin/a.rb
   bin/a.out -> /home/ahoward/bin/a.out
   chmod 0755 /home/ahoward/bin/a.out


   jib:~/eg/ruby/tmp > cat /home/ahoward/bin/a.rb
   #!/dmsp/reference/bin/ruby
   #!/usr/bin/env ruby
   puts 42


also, the commandline parsing in setup.rb is very dangerous.


when i was playing around i did this:

   jib:~/eg/ruby/tmp > ruby setup.rb config --ruby-path=`which ruby` --bin-dir ~/bin
   config: --bin-dir requires argument
   Try 'ruby setup.rb --help' for detailed usage.


oops, forget the '='s

   jib:~/eg/ruby/tmp > ruby setup.rb config --ruby-path=`which ruby` --bin-dir=~/bin
   ---> bin
   <--- bin


   jib:~/eg/ruby/tmp > ruby setup.rb setup
   ---> bin
   <--- bin

looks good

   jib:~/eg/ruby/tmp > ruby setup.rb install
   ---> bin
   mkdir -p ~/bin/
   install a.out ~/bin/
   install a.rb ~/bin/
   install a.pl ~/bin/
   ---> bin/~
   mkdir -p ~/bin/~
   ---> bin/~/bin
   mkdir -p ~/bin/~/bin
   install a.out ~/bin/~/bin
   install a.rb ~/bin/~/bin
   install a.pl ~/bin/~/bin
   ---> bin/~/bin/~
   mkdir -p ~/bin/~/bin/~
   ---> bin/~/bin/~/bin
   mkdir -p ~/bin/~/bin/~/bin
   setup.rb:396:in `mkdir_p': Interrupt    from setup.rb:394:in `each_index'
           from setup.rb:394:in `mkdir_p'
           from setup.rb:1159:in `install_files'
           from setup.rb:1140:in `install_dir_bin'
           from setup.rb:1292:in `__send__'
           from setup.rb:1292:in `traverse'
           from setup.rb:1290:in `dive_into'
           from setup.rb:1290:in `traverse'
            ... 25 levels...
           from setup.rb:644:in `__send__'
           from setup.rb:644:in `invoke'
           from setup.rb:616:in `invoke'
           from setup.rb:1323


yikes - i've started making a recursive directory structure.  this was my own
fault:  because i said

   --bin-dir=~/bin

the shell could not expand the '~' and i gave it '~/bin' instead of
'/home/ahoward/bin' as bin-dir.  for some reason this resulted in the the
recursive dir hierarchy being made - i haven't checked to figure out why.  my
point is that configure lines will often contain shell meta characters, and
that having to slam them up against the '=' sign can result in suprising
behaviour.  it would probably be better if setup.rb used getoptlong or
optparse for this bit of code since they allow the

   --bin-dir ~/bin

syntax.

that being said, setup.rb is about a million times better than install.rb; if
i can figure out the shebang problem i will probably migrate too.

regards.


-a
--
===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| A flower falls, even though we love it;
| and a weed grows, even though we do not love it. 
|   --Dogen
===============================================================================
--8323328-789273727-10957773679789--
--8323328-789273727-10957773679789--