Changeset 10704


Ignore:
Timestamp:
2005-10-07T10:01:18+13:00 (19 years ago)
Author:
kjdon
Message:

more fixes from jens

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/expand_macros.pl

    r10607 r10704  
    33##################################################################################
    44#                                                                                #
    5 # expand_macros.pl -- recursively expand greenstone macros / 1080805 - 4010905   #
     5# expand_macros.pl -- recursively expand greenstone macros / 1080805 - 1050905   #
    66#                                                                                #
    77# Copyright (C) 2005 Jens Wille <j_wille at gmx.net>                             #
     
    6363# KNOWN BUGS:
    6464#
    65 # - (paged-)read will quit the program if not scrolled until the end of the
    66 #   (sufficiently large) file
     65# - for a sufficiently large file (> 12288 bytes == 12 k) (paged-)read will quit
     66#   the program if not scrolled until the end of the file => SIGPIPE: broken pipe!
     67#   SOLVED: the PIPE signal will simply be IGNOREd
    6768#
    6869
     
    8485
    8586my $NAME    = basename $0;
    86 my $VERSION = '0.2';
     87my $VERSION = '0.21';
    8788
    8889
     
    135136  'interactive' => 0,
    136137  'paged'       => 0,
    137   'pager'       => 'less',
    138   'histfile'    => catfile(tmpdir, 'expand_macros.hist'),
     138  'pager'       => $ENV{'PAGER'} || 'less',
     139  'histfile'    => catfile($ENV{'GSDLTMPDIR'} || tmpdir, 'expand_macros.hist'),
    139140  'histsize'    => 100,
    140141  'macro_dirs'  => [catdir($ENV{'GSDLHOME'}, 'macros')],
     
    356357  # interactive browse mode
    357358
     359  # ignore 'broken pipe' error
     360  $SIG{'PIPE'} = 'IGNORE';
     361
    358362  # get the pager executable
    359363  # no need to test if not in "paged" mode
     
    11091113        $ARG{'paged'}      = 1 if $paged;
    11101114
    1111         print_output("$file:\n\n", @lines);
     1115        #print_output("$file:\n\n", @lines);
     1116        print_output(@lines);
    11121117
    11131118        $ARG{'paged'}      = $previous_paged;
Note: See TracChangeset for help on using the changeset viewer.