From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,f9ac708f2d6004e X-Google-Attributes: gid1164f8,public X-Google-Thread: 10b612,f9ac708f2d6004e X-Google-Attributes: gid10b612,public X-Google-ArrivalTime: 1993-02-03 01:20:40 PST Xref: sparky comp.sys.dec:7260 comp.unix.ultrix:9649 Path: sparky!uunet!olivea!charnel!rat!usc.edu!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!news.netmbx.de!Germany.EU.net!mcsun!julienas!ircam!fingerhu From: fingerhu@ircam.fr (Michel Fingerhut) Newsgroups: comp.sys.dec,comp.unix.ultrix Subject: Re: Online, Internet-Accessible Product Information Message-ID: <1993Feb3.092040.23086@ircam.fr> Date: 3 Feb 93 09:20:40 GMT References: <1jpmk4INNsph@usenet.pa.dec.com> <1993Feb2.104350.1540@ircam.fr> Organization: IRCAM, Paris (France) I wrote: >I hacked a perl script that goes through all the SPRs and extracts their >title and hardware and software requirements. If there is enough demand, >I'll post either the list or the script. Well, by popular demand (>1) here is the script. The list is far too long to post. Suggestions to me by email, complaints to /dev/null (this _is_ a hack). -------------------------------- chop ----------------------------------- #!/usr/local/bin/perl # # Copyright (c) 1993 by IRCAM # All rights reserved. # # For any information regarding this and other IRCAM software, please # send email to: # manager@ircam.fr # # # mkindex %I% IRCAM %G% # # Make tbl index of SPDs # Options: # -d output raw [g]roff file in /tmp/index.$$ # -l output processed file to printer # none preview # # Modification history # # 21-Jan-93 - Michel Fingerhut (fingerhu@ircam.fr) # $[ = 1; # set array base to 1 $, = ' '; # set output field separator $\ = "\n"; # set output record separator ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$dst) = localtime(time); %month= ( 1, 'Jan', 2, 'Feb', 3, 'Mar', 4, 'Apr', 5, 'May', 6, 'Jun', 7, 'Jul', 8, 'Aug', 9, 'Sep', 10, 'Oct', 11, 'Nov', 12, 'Dec'); $date= sprintf("%2d-%s-%d", $mday, $month{$mon+1}, $year); $options = ':dlv'; # for getopts $usage = "Usage: $0 [-v]\n"; # if failed #------------------------------------------------------------------------------ # #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Keyword tables -- key is pattern, value is stuff to stick in #------------------------------------------------------------------------------ %hard= ( "vax", "Vax", "decstation","DECstation", "decsystem", "DECsystem", "tops-10", "Tops-10 system", "tops-20", "Tops-20 system", "kl10", "KL10", "ki10", "KI10", "ks10", "KS10", "risc", "Risc", "pdp", "PDP", "alpha", "Alpha", "stem-10", "Dec-10", "stem-20", "Dec-20", "11mds", "11MDS", "rt-11", "RT-11 config", "macsys-rt","MACSYS-RT", "rsx-11", "RSX-11 config", "cts-500", "CTS-500", "rsts", "RSTS config", "unibux", "Unibus-based config", "ias ", "IAS OS config", ); %soft= ( "ultrix", "Ultrix", "rsts", "RSTS", "vms", "VMS", "osf", "OSF", "rt-11", "RT-11", "tops", "TOPS", "rsx", "RSX", "sco", "SCO Unix", ) ; # parse arguments require 'getopts.pl'; &Getopts($options) || die $usage ; # parse the arguments # -v: print version and exit if (defined $opt_v) { print '%I% IRCAM %G%'; exit; } $out= $opt_d? ">/tmp/index.$$" : ($opt_l? "| groff -me -t -l" : "| groff -me -t | ghostview -"); open (TABLE, $out) || die "Can't open table for output: $!\n"; print TABLE ".TS H"; print TABLE "center box;"; print TABLE "c | cw(8c) | ce | ce"; print TABLE "l | l | l | l."; print TABLE "SPD TITLE SOFT HARD"; print TABLE "="; print TABLE ".TH"; foreach $spd (<*>) { next if $spd !~ /^\d.*\d$/; open(SPD, $spd) || die "Can't open $spd: $!\n"; &extract; close(SPD); } print TABLE ".TE"; close TABLE; #------------------------------------------------------------------------------ # #------------------------------------------------------------------------------ sub extract { while () { chop; s/^\s+//; undef $title; if (/.*PRODUCT NAME[:\s]*(.*)/ || /(.*\S)\s*SPD \d\d\.\d\d\.\d\d$/ || /(.*\S)\s*SPD$/) { ($title= $1) =~ s/\s*SPD.*//i; $title =~ s/^\s+//; while (1) { chop($_ = ); s/^\s+//; s/^\d\d\.\d\d\.\d\d\s*//; last if $_ eq ""; $title .= " $_"; } &extract1; $software =~ s/, $//; $hardware =~ s/, $//; printf TABLE "%s\tT{\n%s\nT}\tT{\n%s\nT}\tT{\n%s\nT}\n", $spd, $title, $software, $hardware; return; } } } #------------------------------------------------------------------------------ # #------------------------------------------------------------------------------ sub extract1 { while () { chop; s/^\s+//; &hardware if /HARDWARE REQUIRE/; &software if /PREREQUISITE SOFTWARE|SOFTWARE REQUIREMENTS/; } } #------------------------------------------------------------------------------ # #------------------------------------------------------------------------------ sub software { undef $software; while () { chop; s/^\s+//; return if /^[A-Z\s]{10,}/; foreach $p (keys %soft) { $software .= "$soft{$p}, " if /$p/i && $software !~ /$soft{$p}/; } } } #------------------------------------------------------------------------------ # #------------------------------------------------------------------------------ sub hardware { undef $hardware; while () { chop; s/^\s+//; return if /^[A-Z\s]{10,}/; foreach $p (keys %hard) { $hardware .= "$hard{$p}, " if /$p/i && $hardware !~ /$hard{$p}/; } } }