ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* texfont bad mode (755->0755) for mkdir, missing map line
@ 2001-11-13  0:28 George N. White III
  0 siblings, 0 replies; 7+ messages in thread
From: George N. White III @ 2001-11-13  0:28 UTC (permalink / raw)


I've just started using texfont, version=2000.12.14, (from the Sept. 14th
beta), and encountered a couple minor problems:

1) The line with mkdir:

  { my $str = shift ; mkdir $str, 0755 unless -d $str }

originally used a mode off '755', which gives bad permissions
for the directories texfont creates.

2)  The actual map files are always missing the first line shown in the
encoding-vendor-collection.map file.

I apologize if these issues were discussed on the list -- our mail has to
pass thru some of those systems run by backwards adminstrators from
which Nimbda got its name.

-- 
George N. White III <gnw3@acm.org> Bedford Institute of Oceanography


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: texfont bad mode (755->0755) for mkdir, missing map line
  2001-11-15  8:35     ` Hans Hagen
@ 2001-11-15 16:06       ` George N. White III
  0 siblings, 0 replies; 7+ messages in thread
From: George N. White III @ 2001-11-15 16:06 UTC (permalink / raw)
  Cc: George N. White III, ConTeXt mailing list

On Thu, 15 Nov 2001, Hans Hagen wrote:

> At 04:24 PM 11/14/2001 -0400, George N. White III wrote
>
> >The misplaced "0" appears in the line which strips any existing entries
> >for the current font ($thename) from $mapdata:
> >
> >        { $mapdata =~ s/^$thename\s.*?$//gmois ;
>
> ah, that's a stupid error, thanks for locating it. About the 'o' key, does
> it also optimized the replacement text, i.e., should i also change:
>
>   s/(--en.*\=)\?/$1$encoding/io ;

I wouldn't call it a stupid error -- it is all too easy to type that
'o' when writing perl code if you have a bunch of expressions where
the pattern doesn't change.

I think the 'o' flag only applies to the search pattern, but to be
sure I'd have to use the sources.

-- 
George N. White III <gnw3@acm.org> Bedford Institute of Oceanography


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: texfont bad mode (755->0755) for mkdir, missing map line
       [not found]   ` <Pine.GSO.4.40.0111141607490.23556-100000@emerald.bio.dfo.c a>
@ 2001-11-15  8:35     ` Hans Hagen
  2001-11-15 16:06       ` George N. White III
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2001-11-15  8:35 UTC (permalink / raw)
  Cc: ConTeXt mailing list

At 04:24 PM 11/14/2001 -0400, George N. White III wrote

>The misplaced "0" appears in the line which strips any existing entries
>for the current font ($thename) from $mapdata:
>
>        { $mapdata =~ s/^$thename\s.*?$//gmois ;

ah, that's a stupid error, thanks for locating it. About the 'o' key, does 
it also optimized the replacement text, i.e., should i also change:

  s/(--en.*\=)\?/$1$encoding/io ;

Thanks,

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: texfont bad mode (755->0755) for mkdir, missing map line
  2001-11-13  8:26 ` Hans Hagen
  2001-11-13 16:11   ` George N. White III
  2001-11-13 17:46   ` Olaf Weber
@ 2001-11-14 20:24   ` George N. White III
       [not found]   ` <Pine.GSO.4.40.0111141607490.23556-100000@emerald.bio.dfo.c a>
  3 siblings, 0 replies; 7+ messages in thread
From: George N. White III @ 2001-11-14 20:24 UTC (permalink / raw)
  Cc: George N. White III, ConTeXt mailing list

On Tue, 13 Nov 2001, Hans Hagen wrote:

> At 08:28 PM 11/12/2001 -0400, George N. White III wrote:
> >I've just started using texfont, version=2000.12.14, (from the Sept. 14th
> >beta), and encountered a couple minor problems:
> >
> >1) The line with mkdir:
> >
> >   { my $str = shift ; mkdir $str, 0755 unless -d $str }
> >
> >originally used a mode off '755', which gives bad permissions
> >for the directories texfont creates.
>
> so the 0 really means something (i thought that perl would see it as a
> number and drop leading 0's)
>
> >2)  The actual map files are always missing the first line shown in the
> >encoding-vendor-collection.map file.
>
> i'll send you the latest version so that you can test it;

A few minutes with "perl -d" reveals that the lost zero was actually just
misplaced and written as an "o".  The list of map file entries is stored
in two forms:

$mapdata -- list of new entries to be appended to the file
$maplist -- the list of entries for the current font collection

The misplaced "0" appears in the line which strips any existing entries
for the current font ($thename) from $mapdata:

       { $mapdata =~ s/^$thename\s.*?$//gmois ;

The effect the "o" is to tell perl to only compile the regular expression
once (e.g., assume that $thename never changes -- an important
optimization for certain loops).  This line strips out any existing entry
in the mapfile for font $thename, so that $mapdata can be appended to the
file without duplicating existing entries.  The result is that, when
creating a new map file, the first font will not appear in the map file.

I've gone into lots of detail here a) so the next time I see a similar
problem there will be an explanation in the archives, and b) so that
people who use texfont and have never written a perl script can see
that it is possible to tweak perl scripts when they go astray.

-- 
George N. White III <gnw3@acm.org> Bedford Institute of Oceanography


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: texfont bad mode (755->0755) for mkdir, missing map line
  2001-11-13  8:26 ` Hans Hagen
  2001-11-13 16:11   ` George N. White III
@ 2001-11-13 17:46   ` Olaf Weber
  2001-11-14 20:24   ` George N. White III
       [not found]   ` <Pine.GSO.4.40.0111141607490.23556-100000@emerald.bio.dfo.c a>
  3 siblings, 0 replies; 7+ messages in thread
From: Olaf Weber @ 2001-11-13 17:46 UTC (permalink / raw)
  Cc: George N. White III, ConTeXt mailing list

Hans Hagen writes:
> At 08:28 PM 11/12/2001 -0400, George N. White III wrote:

>> I've just started using texfont, version=2000.12.14, (from the Sept. 14th
>> beta), and encountered a couple minor problems:
>> 
>> 1) The line with mkdir:
>> 
>> { my $str = shift ; mkdir $str, 0755 unless -d $str }
>> 
>> originally used a mode off '755', which gives bad permissions
>> for the directories texfont creates.

> so the 0 really means something (i thought that perl would see it as a
> number and drop leading 0's)

Perl probably _is_ interpreting it as "just a number".  But the
leading zero means the number is in octal.  See perlnumber(1).

-- 
Olaf Weber

[M]ost likely other e-mail programs like Eudora are not designed to enable
virus replication.
     -- http://www.microsoft.com/mac/products/office/2001/virus_alert.asp#Faqs


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: texfont bad mode (755->0755) for mkdir, missing map line
  2001-11-13  8:26 ` Hans Hagen
@ 2001-11-13 16:11   ` George N. White III
  2001-11-13 17:46   ` Olaf Weber
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: George N. White III @ 2001-11-13 16:11 UTC (permalink / raw)
  Cc: George N. White III, ConTeXt mailing list

On Tue, 13 Nov 2001, Hans Hagen wrote:

> At 08:28 PM 11/12/2001 -0400, George N. White III wrote:
> >I've just started using texfont, version=2000.12.14, (from the Sept. 14th
> >beta), and encountered a couple minor problems:
> >
> >1) The line with mkdir:
> >
> >   { my $str = shift ; mkdir $str, 0755 unless -d $str }
> >
> >originally used a mode off '755', which gives bad permissions
> >for the directories texfont creates.
>
> so the 0 really means something (i thought that perl would see it as a
> number and drop leading 0's)

The 0 means the number is octal (unless followed by an 'x', which gives
hexadecimal).  The unix chmod command takes an octal mode (without the
leading '0'!), so it is customary to think of unix permissions in terms
of octal values:

  chmod ugo [filename|dirname]

   where u, g, and o are octal digits (e.g., 0-7),  where
        1=execute only
        2=write only
        4=read only

    u -- permission for users
    g -- permission for group
    o -- permission for others

  Directories need execute permission, so a typical mode value is
  644 for files and 755 for directories (6=2+4 gives read/write
  permission, 7=6+1 adds execute permission).

> >2)  The actual map files are always missing the first line shown in the
> >encoding-vendor-collection.map file.
>
> i'll send you the latest version so that you can test it;

Got it, and it is exactly the same as what I have been using (e.g.,
from the Sept. beta with 755->0755).  I'll try to track down the
reason for the missing map line.

-- 
George N. White III <gnw3@acm.org> Bedford Institute of Oceanography


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: texfont bad mode (755->0755) for mkdir, missing map line
       [not found] <Pine.GSO.4.40.0111122014370.12541-100000@emerald.bio.dfo.c a>
@ 2001-11-13  8:26 ` Hans Hagen
  2001-11-13 16:11   ` George N. White III
                     ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Hans Hagen @ 2001-11-13  8:26 UTC (permalink / raw)
  Cc: ConTeXt mailing list

At 08:28 PM 11/12/2001 -0400, George N. White III wrote:
>I've just started using texfont, version=2000.12.14, (from the Sept. 14th
>beta), and encountered a couple minor problems:
>
>1) The line with mkdir:
>
>   { my $str = shift ; mkdir $str, 0755 unless -d $str }
>
>originally used a mode off '755', which gives bad permissions
>for the directories texfont creates.

so the 0 really means something (i thought that perl would see it as a 
number and drop leading 0's)

>2)  The actual map files are always missing the first line shown in the
>encoding-vendor-collection.map file.

i'll send you the latest version so that you can test it;

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-11-15 16:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-13  0:28 texfont bad mode (755->0755) for mkdir, missing map line George N. White III
     [not found] <Pine.GSO.4.40.0111122014370.12541-100000@emerald.bio.dfo.c a>
2001-11-13  8:26 ` Hans Hagen
2001-11-13 16:11   ` George N. White III
2001-11-13 17:46   ` Olaf Weber
2001-11-14 20:24   ` George N. White III
     [not found]   ` <Pine.GSO.4.40.0111141607490.23556-100000@emerald.bio.dfo.c a>
2001-11-15  8:35     ` Hans Hagen
2001-11-15 16:06       ` George N. White III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).