From 488c6541711c86e021a38b53247e6ac47e89f538 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 25 Nov 2008 10:54:02 -0500 Subject: Remove the old SystemTap_Tapset_Reference. --- doc/SystemTap_Tapset_Reference/extractxml.pl | 137 --------------------------- 1 file changed, 137 deletions(-) delete mode 100755 doc/SystemTap_Tapset_Reference/extractxml.pl (limited to 'doc/SystemTap_Tapset_Reference/extractxml.pl') diff --git a/doc/SystemTap_Tapset_Reference/extractxml.pl b/doc/SystemTap_Tapset_Reference/extractxml.pl deleted file mode 100755 index 492a29cb..00000000 --- a/doc/SystemTap_Tapset_Reference/extractxml.pl +++ /dev/null @@ -1,137 +0,0 @@ -#! /usr/bin/perl -# Generates xml files from tapset .stp files. -# Copyright (C) 2008 Red Hat Inc. -# -# This file is part of systemtap, and is free software. You can -# redistribute it and/or modify it under the terms of the GNU General -# Public License (GPL); either version 2, or (at your option) any -# later version. - -use strict; -use warnings; - -use Cwd 'abs_path'; -use File::Copy; -use File::Find; -use File::Path; -use Text::Wrap; -use IO::File; -use POSIX qw(tmpnam); - -my $XMLHEADER = - "\n" - . "\n" - ."\n" - . "\n" - . "\n" - . "\n" - . "\n" -; -my $XMLFOOTER = - "\n" - . "\n" - ."\n"; - -my $XML_CHAPTER_HEADER = - "\n" - . "\n" - . "\n"; - -my $XML_CHAPTER_FOOTER = ""; - -my $inputdir; -if ($#ARGV >= 0) { - $inputdir = $ARGV[0]; -} else { - $inputdir = "."; -} -$inputdir = abs_path($inputdir); - -my $outputdir; -if ($#ARGV >= 1) { - $outputdir = $ARGV[1]; -} else { - $outputdir = $inputdir; -} -$outputdir = abs_path($outputdir); - -#attempt to create the output directory -if ($inputdir ne $outputdir) { - if (! -d "$outputdir") { - mkpath("$outputdir", 1, 0711); - } -} - -my %scripts = (); - -print "Extracting xml from .stp files in $inputdir...\n"; -find(\&extract_xml, $inputdir); - - -# Output list of extracted xml files -my $tapsetxml = "$outputdir/Tapset_Reference.xml"; -open (TAPSETXML, ">$tapsetxml") - || die "couldn't open $tapsetxml: $!"; -print "Creating $tapsetxml...\n"; -print TAPSETXML $XMLHEADER; - -my $tapset; -foreach $tapset (sort keys %scripts) { - print TAPSETXML "\n" - -} -print TAPSETXML $XMLFOOTER; -close (TAPSETXML); - - -sub extract_xml { - my $file = $_; - my $filename = $File::Find::name; - my $ofile; - my $ofilefullt; - my $ofilefull; - - if (-f $file && $file =~ /\.stp$/) { - open FILE, $file or die "couldn't open '$file': $!\n"; - - $ofilefullt = tmpnam(); - open OFILET, ">$ofilefullt" or die "couldn't open '$ofilefullt': $!\n"; - - print "Extracting xml from $filename...\n"; - - while () { - print OFILET if s/\s*\/\/\///; - } - close OFILET; - close FILE; - - #If xml was extracted make a .xml file - if (-s $ofilefullt) { - #get rid of the inputdir part and .stp, add .xml - # chop off the search dir prefix. - $inputdir =~ s/\/$//; - $ofile = substr $filename, (length $inputdir) + 1; - $ofile =~ s/.stp/.xml/; - $ofile =~ s/\//_/g; - $scripts{$ofile} = $ofile; - print "$ofile\n"; - $ofilefull = "$outputdir/$ofile"; - open OFILE, ">$ofilefull" - or die "couldn't open '$ofilefull': $!\n"; - open OFILET, "$ofilefullt" - or die "couldn't open '$ofilefullt': $!\n"; - print OFILE "$XML_CHAPTER_HEADER"; - while () { - print OFILE ; - } - print OFILE "$XML_CHAPTER_FOOTER"; - close OFILET; - close OFILE; - } - unlink($ofilefullt); - } -} -- cgit