Skip site navigation (1)Skip section navigation (2)
Date:      Thu,  7 Mar 2002 22:24:28 -0500 (EST)
From:      parv_@yahoo.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/35659: x11-fonts/webfonts extract fails
Message-ID:  <20020308032428.2D38650B81@moo.holy.cow>

next in thread | raw e-mail | index | archive | help

>Number:         35659
>Category:       ports
>Synopsis:       x11-fonts/webfonts extract fails
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 07 19:30:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     parv
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
>Environment:
System: FreeBSD moo.holy.cow 4.5-STABLE

using cabextract-0.2 w/ recently cvsup'd ports tree

>Description:

 "make extract" fails for x11-fonts/webfonts w/ this message...

===>  Extracting for webfonts-0.21
>How-To-Repeat:

try make extract target in webfonts w/ cabextract 0.2 

>Fix:

TEMPORARY fix:
--------------
- set EXTRACT_BEFORE_ARGS to nothing in the Makefile
- "make extract"
- ignore the error message of move failure
- "cd work"
- "touch -f .extract_done.webfonts-0.21"
- run the perl program below, may be overkill

#! /usr/bin/perl -w

use strict;

# modules to move & parse file name
use File::Basename;
use File::Copy;

# noisy option controls how much output is generated.
#  0   only fatal error messages are generated; marked by
#      '*'
#  1   as 0, plus non-fatal error messages are shown;
#      marked by '#'
#  2   default.  as 1, plus converted file names are
#      shown; marked by '-'
#  3   as 2, plus okay/unchanged old file names are
#      shown; marked by '-'
#
# if lowercase is non zero, on [a-z] characters are used for file names
# otherwise [a-zA-Z] are used
#

my ($noisy, $lowercase) = (2, 1);

my $valid_alpha;

if ( $lowercase ) { $valid_alpha = join('', ('a' .. 'z')) }
else              { $valid_alpha = join('', ('a' .. 'z', 'A' .. 'Z')) }

foreach (@ARGV)
{
  my ($old_file,$path) = fileparse($_,'');

  ## sanity check

  die "\* destination, $path, is either not a directory or is not writable, exiting... \n"
    unless (-d $path || -w $path);

  unless ( -e $path . $old_file )
  {
    warn("# ${path}${old_file} doesn't exist, skipping...\n")
      if ( $noisy >= 1 );

    next;
  }

  # see if the old name is okay; if so skip it...
  #
  if ( $old_file !~ m#[^\d\Q${valid_alpha}_-.\E]# )
  {
    print "- ok  ${path}${old_file} ...\n"
      if ( $noisy >= 3 );

    next;
  }


  ## calculate new file name

  my $new_file = $old_file;

  $new_file =~ tr [A-Z] [a-z] if ($lowercase);

  # very unlikely scenario that _current_ file name will be same
  # as the calculated one from this _current_ name
  #
  if ( $old_file eq $new_file )
  {
    warn("# calculated new name seem to be same as the old;\n   ${path}${old_file} is not moved...\n")
      if ( $noisy >= 1 );

    next;
  }

  # calculated name has higher probability of not existing. so
  # deal w/ that case first
  #
  if ( ! -e $path . $new_file )
  {
    move_file($path . $old_file, $path . $new_file);
    next;
  }

  warn("# ${path}${new_file} already exists, ${path}${old_file} skipped ...\n")
    if ( $noisy >= 1 );

}

print "...done\n" if ( $noisy );


## subroutines

sub move_file
{
  my ($old,$new) = @_;

  print "- $old  ->  $new ... \n"
    if ( $noisy >= 1 );

  move("$old","$new")
    || die "\* couldn't move $old to $new : $! \n" ;

  return;
}


__END__


- "mv * webfonts-0.2/"
- "cd .."
- run rest of make targets as usual

>Release-Note:
>Audit-Trail:
>Unformatted:
 >> Checksum OK for webfonts/andale32.exe.
 >> Checksum OK for webfonts/trebuc32.exe.
 >> Checksum OK for webfonts/georgi32.exe.
 >> Checksum OK for webfonts/verdan32.exe.
 >> Checksum OK for webfonts/comic32.exe.
 >> Checksum OK for webfonts/arialb32.exe.
 >> Checksum OK for webfonts/impact32.exe.
 >> Checksum OK for webfonts/arial32.exe.
 >> Checksum OK for webfonts/times32.exe.
 >> Checksum OK for webfonts/courie32.exe.
 >> Checksum OK for webfonts/webdin32.exe.
 ===>   webfonts-0.21 depends on executable: ttmkfdir - found
 ===>   webfonts-0.21 depends on executable: cabextract - found
 ===>   webfonts-0.21 depends on shared library: X11.6 - found
 --lowercase: No such file or directory
 *** Error code 1
 
 Stop in /source/ports/x11-fonts/webfonts.
 *** Error code 1
 
 
 ..."make -d v extract 2>&1 | grep EXTRACT | sort -bdf | uniq" gives...
 
 Command:REAL_EXTRACT = yes
 Global:EXTRACT_AFTER_ARGS = 
 Global:EXTRACT_BEFORE_ARGS = --lowercase --quiet
 Global:EXTRACT_CMD = ${LOCALBASE}/bin/cabextract
 Global:EXTRACT_COOKIE = ${WRKDIR}/.extract_done.${PKGNAME}
 Global:EXTRACT_ONLY = ${_DISTFILES}
 Global:EXTRACT_SUFX = .tar.gz
 
 
 ...if "lowercase" and "quiet" are the options being passed to
 cabextract, i don't see those two options in my manpage.  only option
 is "v" for file listing only not actual extraction.
 
 commenting out "EXTRACT_BEFORE_ARGS" in the Makefile doesn't help,
 as another option "dc" is passed, supposedly, to cabextract.
 
 setting EXTRACT_BEFORE_ARGS to nothing helps, but then a move fails
 because mv tries to move nonexistent work/licen.txt to
 work/webfonts; however work/Licen.TXT exists.  that's what, i
 suppose, EXTRACT_BEFORE_ARGS would have taken care of it.  that
 just, however, doesn't work as indicated above.
 
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020308032428.2D38650B81>