summaryrefslogtreecommitdiff
path: root/solenv/bin/deliver.pl
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-12-08 13:29:09 +0000
committerRüdiger Timm <rt@openoffice.org>2008-12-08 13:29:09 +0000
commit450368eab9ac1f8b2d9ced2bf375ea04df11eb8b (patch)
treebc699a822f32a8715bb38f9a70efe794da625a23 /solenv/bin/deliver.pl
parent0a5fc047cfa930e5187e2a7ecc3e192369409eb5 (diff)
CWS-TOOLING: integrate CWS rt35
2008-12-02 08:25:35 +0100 rt r264658 : Do not print useless outdated version info. checkdeliver: store errors to file to ease later analysis. 2008-12-01 17:40:03 +0100 rt r264622 : #i96749# Only copy when file exists 2008-12-01 15:28:07 +0100 rt r264610 : #i96749# Avoid collisions when creating zip archive of files delivered into common tree. 2008-11-28 13:20:52 +0100 rt r264545 : #i90846# Old 'cmake' makefile, must be obsolete since ages. 2008-11-28 13:18:12 +0100 rt r264544 : #i90846# Remove old StarDivision copyright notices.
Diffstat (limited to 'solenv/bin/deliver.pl')
-rwxr-xr-xsolenv/bin/deliver.pl19
1 files changed, 17 insertions, 2 deletions
diff --git a/solenv/bin/deliver.pl b/solenv/bin/deliver.pl
index ae00334fcea4..1d84977b959c 100755
--- a/solenv/bin/deliver.pl
+++ b/solenv/bin/deliver.pl
@@ -11,7 +11,7 @@ eval 'exec perl -wS $0 ${1+"$@"}'
#
# $RCSfile: deliver.pl,v $
#
-# $Revision: 1.130 $
+# $Revision$
#
# This file is part of OpenOffice.org.
#
@@ -47,7 +47,7 @@ use File::Spec;
( $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
-$id_str = ' $Revision: 1.130 $ ';
+$id_str = ' $Revision$ ';
$id_str =~ /Revision:\s+(\S+)\s+\$/
? ($script_rev = $1) : ($script_rev = "-");
@@ -1218,6 +1218,13 @@ sub zip_files
$work_file = get_tempfilename() . ".zip";
die "Error: temp file $work_file already exists" if ( -e $work_file);
zipped_path_extension($zip_file, $work_file, $ext, 1) if ( -e $zip_file );
+ } elsif ( $zip_file eq $common_zip_file) {
+ # Zip file in common tree: work on uniq copy to avoid collisions
+ $work_file = $zip_file;
+ $work_file =~ s/\.zip$//;
+ $work_file .= (sprintf('%s.%d-%d', $to, $$, time())) . ".zip";
+ die "Error: temp file $work_file already exists" if ( -e $work_file);
+ copy($zip_file, $work_file) if ( -e $zip_file );
} else {
# No pre processing necessary, working directly on solver.
$work_file = $zip_file;
@@ -1256,6 +1263,14 @@ sub zip_files
if (( -e $work_file ) && ($work_file ne $zip_file)) {
unlink $work_file;
}
+ } elsif ( $zip_file eq $common_zip_file) {
+ # rename work file back
+ if ( -e $work_file ) {
+ if (! rename($work_file, $zip_file)) {
+ print_error("can't rename temporary file to $zip_file: $!",0);
+ unlink $work_file;
+ }
+ }
}
}
}