~ubuntu-branches/ubuntu/saucy/dhelp/saucy-proposed

« back to all changes in this revision

Viewing changes to doc/dhelp2dwww.pl

  • Committer: Bazaar Package Importer
  • Author(s): Esteban Manchado Velázquez
  • Date: 2007-10-20 17:35:26 UTC
  • Revision ID: james.westby@ubuntu.com-20071020173526-q1ekqfek5tlctsn1
Tags: 0.5.25
* Maintainer change.
* Rewrite dhelp_parse in Ruby. This fixes some bugs and avoids many problems
  (Closes: #21678, #268487, #62454, #312950, #442943, #444429, #193428).
* This release should be a drop-in replacement for the C version, and still
  uses the same database and internal format.
* It also adds a Ruby library, to allow other developers to write other
  programs that read and/or update the dhelp databases.
* Use "http://localhost" for CGI script URLs (Closes: #114588).
* Removed misleading dot from example (Closes: #381804).
* Uses sensible-browser instead of having its own configuration system
  (Closes: #146002, #162518, #381805, #217162, #430590).
* Clean up the HTML a bit (Closes: #438973, #134567, #115306).
* Remove references to obsolete script dh_dhelp (Closes: #369459).
* Raise title limit from 49 to 100 characters (Closes: #102393).
* Depend on doc-base, to make sure packages have their documentation
  available for dhelp (Closes: #314733, #368035).
* Wait a couple of seconds before exiting, after a fatal error, to make sure
  the user can read the error message (Closes: #35097).
* Make documentation index files world-readable, regardless of current umask
  (Closes: #158792, #430474, #430505).
* Remove obsolete script dhelp2dwww.pl, and references to it
  (Closes: #364245).
* Remove "dangerous" environment variables from dsearch, to avoid taint
  problems (Closes: #389944).
* Strip blanks from .dhelp field values (Closes: #133218).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
2
 
 
3
 
# Copyright (c) 1998 by Marco Budde (Budde@tu-harburg.de)
4
 
# GNU General Public License
5
 
 
6
 
##################################################
7
 
#  converts a .dhelp file to a .dwww-index file  #
8
 
#                                                #
9
 
#      usage:  dhelp2dwww <dwww section>         #      
10
 
##################################################
11
 
 
12
 
 
13
 
##############
14
 
#    main    #
15
 
##############
16
 
 
17
 
print ".dhelp -> .dwww-index\n";
18
 
 
19
 
$pwd = `pwd`;
20
 
$pwd =~ /.*?\/usr\/doc\/(.*)/;
21
 
$pwd = $1;
22
 
 
23
 
open (IN, "< .dhelp") or die "can't open .dhelp!\n";
24
 
open (OUT, "> .dwww-index") or die "can't open .dwww-index!\n";
25
 
 
26
 
while ($zw = <IN>)
27
 
{
28
 
  $descrip = '';
29
 
  while ($zw !~ /<\/item>/)
30
 
  {
31
 
    $linkname = $1 if ($zw =~ /<linkname>(.*)/);
32
 
    $filename = $1 if ($zw =~ /<filename>(.*)/);
33
 
    if ($zw =~ /<description>/)
34
 
    {
35
 
      while ($zw !~ /<\/description>/)
36
 
      { 
37
 
        $zw = <IN>;
38
 
        $descrip = $descrip . $zw if ($zw !~ /<\/description>/);
39
 
      }
40
 
    }
41
 
    $zw = <IN>;
42
 
  }
43
 
  print OUT "#section $ARGV[0]\n";
44
 
  print OUT "<dt><a href=\"$pwd/$filename\">$linkname</a>\n";  
45
 
  print OUT "<dd>$descrip\n";
46
 
}
47
 
 
48
 
close (IN);
49
 
close (OUT);