summaryrefslogtreecommitdiff
path: root/solenv/bin/modules/installer/existence.pm
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2005-04-04 08:59:04 +0000
committerRüdiger Timm <rt@openoffice.org>2005-04-04 08:59:04 +0000
commit16e6380844877e4bf285ec9603e4f63268a57353 (patch)
tree7538be5893eec4bee801fd052b1c24d253120f30 /solenv/bin/modules/installer/existence.pm
parent231e49d5d50b6cd753c134f240d542a21288e962 (diff)
INTEGRATION: CWS nativefixer5 (1.2.306); FILE MERGED
2005/03/03 15:38:12 is 1.2.306.1: #i44003# creating inf file
Diffstat (limited to 'solenv/bin/modules/installer/existence.pm')
-rw-r--r--solenv/bin/modules/installer/existence.pm86
1 files changed, 84 insertions, 2 deletions
diff --git a/solenv/bin/modules/installer/existence.pm b/solenv/bin/modules/installer/existence.pm
index 6a0d3cc2855a..3b5ff7e2cf47 100644
--- a/solenv/bin/modules/installer/existence.pm
+++ b/solenv/bin/modules/installer/existence.pm
@@ -2,9 +2,9 @@
#
# $RCSfile: existence.pm,v $
#
-# $Revision: 1.2 $
+# $Revision: 1.3 $
#
-# last change: $Author: svesik $ $Date: 2004-04-20 12:26:44 $
+# last change: $Author: rt $ $Date: 2005-04-04 09:59:04 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -136,4 +136,86 @@ sub get_specified_file
return $onefile;
}
+#####################################################################
+# Returning a specified file as base for a new file,
+# defined by its "Name"
+#####################################################################
+
+sub get_specified_file_by_name
+{
+ my ($filesarrayref, $searchname) = @_;
+
+ my $foundfile = 0;
+ my $onefile;
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ $onefile = ${$filesarrayref}[$i];
+ my $filename = $onefile->{'Name'};
+
+ if ( $filename eq $searchname )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+
+ if (!($foundfile))
+ {
+ installer::exiter::exit_program("ERROR: Could not find file $searchname in list of files!", "get_specified_file_by_name");
+ }
+
+ return $onefile;
+}
+
+#####################################################################
+# Checking existence of a specific file, defined by its "Name"
+#####################################################################
+
+sub filename_exists_in_filesarray
+{
+ my ($filesarrayref, $searchname) = @_;
+
+ my $foundfile = 0;
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $filename = $onefile->{'Name'};
+
+ if ( $filename eq $searchname )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+
+ return $foundfile;
+}
+
+#####################################################################
+# Checking existence of a specific file, defined by its "gid"
+#####################################################################
+
+sub filegid_exists_in_filesarray
+{
+ my ($filesarrayref, $searchgid) = @_;
+
+ my $foundfile = 0;
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $filegid = $onefile->{'gid'};
+
+ if ( $filegid eq $searchgid )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+
+ return $foundfile;
+}
+
1;