ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/Requirements.pm
(Generate patch)

Comparing COMP/SCRAM/src/BuildSystem/Requirements.pm (file contents):
Revision 1.1.2.4 by williamc, Thu May 4 15:45:07 2000 UTC vs.
Revision 1.1.2.4.2.3 by williamc, Fri Aug 11 15:02:37 2000 UTC

# Line 2 | Line 2
2   #
3   # Interface
4   # ---------
5 < # new(file)     : new requirements doc
5 > # new(file,URLcache)     : new requirements doc
6   # setup(toolbox): set up the requirements into the specified toolbox object
7   # download(toolbox)    : download description files (into toolbox cache)
8   # tools()       : Return list of requirements (ordered)
# Line 10 | Line 10
10   # url(tool)     : return the url of a given tool
11  
12   package BuildSystem::Requirements;
13 < use ActiveDoc::SimpleDoc;
13 > use ActiveDoc::SimpleURLDoc;
14   use Utilities::Verbose;
15  
16   require 5.004;
# Line 21 | Line 21 | sub new {
21          my $self={};
22          bless $self, $class;
23          $self->{file}=shift;
24 +        $self->{cache}=shift;
25 +        $self->{mydocversion}="2.0";
26          $self->{Arch}=1;
27          push @{$self->{ARCHBLOCK}}, $self->{Arch};
28          $self->init($self->{file});
# Line 33 | Line 35 | sub setup {
35  
36          my $tool;
37          foreach $tool ( $self->tools() ) {
38 +          $self->verbose("Setting Up Tool $tool");
39            $toolbox->toolsetup($tool, $self->version($tool), $self->url($tool));
40          }
41   }
# Line 58 | Line 61 | sub init {
61          my $self=shift;
62          my $file=shift;
63  
64 <        my $switch=ActiveDoc::SimpleDoc->new();
64 >        my $switch=ActiveDoc::SimpleURLDoc->new($self->{cache});
65          $switch->filetoparse($file);
66          $switch->newparse("doc");
67          $switch->addtag("doc","Doc", \&Doc_start,$self,"",$self,"",$self);
68          $switch->newparse("ordering");
69 +        $switch->addbasetags("ordering");
70          $switch->addtag("ordering","Architecture",
71                                          \&Arch_Start,$self,
72                                          "", $self,
# Line 72 | Line 76 | sub init {
76                                          \&require_start,$self,
77                                          "", $self,
78                                          "", $self);
79 +
80          $self->{switch}=$switch;
81          @{$self->{tools}}=();
82          
# Line 79 | Line 84 | sub init {
84          # -- for backwards compatability only parse if we have a docversion
85          #    defined
86          if ( defined $self->{docversion} ) {
87 <          $self->{switch}->parse("ordering");
87 >          if ( $self->{docversion} eq $self->{mydocversion} ) {
88 >            $self->{switch}->parse("ordering");
89 >          }
90 >        }
91 >        else {
92 >          #print "wrong doc version - not parsing\n";
93          }
94   }
95  
96   sub download {
97          my $self=shift;
88        my $toolbox=shift;
98  
99          my $tool;
100          foreach $tool ( $self->tools() ) {
101            $self->verbose("Downloading ".$self->url($tool));
102 <          $toolbox->_download($self->url($tool));
102 >          # get into the cache
103 >          $self->{switch}->urlget($self->url($tool));
104          }
105   }
106  
# Line 114 | Line 124 | sub require_start {
124          
125          $self->{switch}->checktag( $name, $hashref, 'version');
126          $self->{switch}->checktag( $name, $hashref, 'name');
127 <        $self->{switch}->checktag( $name, $hashref, 'file');
127 >        $self->{switch}->checktag( $name, $hashref, 'url');
128          if ( $self->{Arch} ) {
129            push @{$self->{tools}}, $$hashref{'name'};
130            $self->{version}{$$hashref{'name'}}=$$hashref{'version'};
131 <          $self->{url}{$$hashref{'name'}}=$$hashref{'file'};
131 >          # -- make sure the full url is taken
132 >          my $urlobj=$self->{switch}->expandurl($$hashref{'url'});
133 >          $self->{url}{$$hashref{'name'}}=$urlobj->url();
134          }
135   }
136  
# Line 140 | Line 152 | sub Arch_End {
152          pop @{$self->{ARCHBLOCK}};
153          $self->{Arch}=$self->{ARCHBLOCK}[$#{$self->{ARCHBLOCK}}];
154   }
143

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines