ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/ToolCache.pm
Revision: 1.6
Committed: Tue Oct 18 14:59:26 2011 UTC (13 years, 6 months ago) by muzaffar
Content type: text/plain
Branch: MAIN
CVS Tags: V2_2_5_pre2, V2_2_5_pre1, V2_2_4, V2_2_4_pre9, V2_2_4_pre8, V2_2_4_pre7, V2_2_4_pre6, V2_2_4_pre5, V2_2_4_pre4, V2_2_4_pre3, V2_2_4_pre2, V2_2_4_pre1, HEAD
Changes since 1.5: +0 -3 lines
Log Message:
removed cvs $id statement

File Contents

# Content
1 #____________________________________________________________________
2 # File: ToolCache.pm
3 #____________________________________________________________________
4 #
5 # Author: Shaun Ashby <Shaun.Ashby@cern.ch>
6 # Copyright: 2003 (C) Shaun Ashby
7 #
8 #--------------------------------------------------------------------
9 package BuildSystem::ToolCache;
10 require 5.004;
11
12 use Exporter;
13 @ISA=qw(Exporter);
14 #
15 sub new()
16 {
17 my $proto=shift;
18 my $class=ref($proto) || $proto;
19 my $self={};
20 $self->{SETUP}={};
21 bless $self,$class;
22 return $self;
23 }
24
25 sub setup()
26 {
27 my $self=shift;
28 return $self->{SETUP};
29 }
30
31 sub name()
32 {
33 my $self = shift;
34 # Set the name of the cache file:
35 @_ ? $self->{CACHENAME} = shift #
36 : $self->{CACHENAME};
37 }
38
39 sub dirty()
40 {
41 my $self = shift;
42 $self->{internal}{dirty}=1;
43 }
44
45 sub isdirty()
46 {
47 my $self = shift;
48 my $dirty = $self->{internal}{dirty} || 0;
49 return $dirty;
50 }
51
52 sub writecache()
53 {
54 my $self=shift;
55 if (exists $self->{internal}{dirty})
56 {
57 my $file=$self->{CACHENAME};
58 delete $self->{internal};
59 use Cache::CacheUtilities;
60 &Cache::CacheUtilities::write($self,$file);
61 }
62 }
63
64 1;
65