Bug 752461 - Hide click-to-play overlays when choosing "never activate plugins.....
[gecko.git] / security / coreconf / cpdist.pl
blob9105bc1c85896371e81a3f24af8f6320140e24a3
1 #! /usr/local/bin/perl
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
14 # License.
16 # The Original Code is the Netscape security libraries.
18 # The Initial Developer of the Original Code is
19 # Netscape Communications Corporation.
20 # Portions created by the Initial Developer are Copyright (C) 1994-2000
21 # the Initial Developer. All Rights Reserved.
23 # Contributor(s):
25 # Alternatively, the contents of this file may be used under the terms of
26 # either the GNU General Public License Version 2 or later (the "GPL"), or
27 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 # in which case the provisions of the GPL or the LGPL are applicable instead
29 # of those above. If you wish to allow use of your version of this file only
30 # under the terms of either the GPL or the LGPL, and not to allow others to
31 # use your version of this file under the terms of the MPL, indicate your
32 # decision by deleting the provisions above and replace them with the notice
33 # and other provisions required by the GPL or the LGPL. If you do not delete
34 # the provisions above, a recipient may use your version of this file under
35 # the terms of any one of the MPL, the GPL or the LGPL.
37 # ***** END LICENSE BLOCK *****
38 require('coreconf.pl');
40 #######-- read in variables on command line into %var
42 &parse_argv;
44 ### do the copy
46 print STDERR "RELEASE TREE / MODULE = $var{RELEASE_TREE} $var{MODULE}\n";
50 # 1
51 if ($var{RELEASE} eq "") { exit; } # Can't do release here, so exit.
53 # 2
54 #if (! ($var{RELEASE} =~ /\//)) { # if no specific version is specified in RELEASE variable
55 # $component = $var{RELEASE};
57 #else { # if a subcomponent/version is given in the RELEASE variable
58 # $var{RELEASE} =~ m|^([^/]*)/|;
59 # $component = $1; # everything before the first slash;
60 # }
62 # 3
63 $path = $var{RELEASE};
66 # 4
67 # find out what directory we would create for 'today'
69 $year = (localtime)[5] + 1900;
70 $month = (localtime)[4] + 1;
71 $day = (localtime)[3];
72 $today = sprintf( "%d%02d%02d", $year, $month, $day );
74 # 5
75 # if version is null, then set the version to today.
76 if ($var{"RELEASE_VERSION"} eq "") {
77 $var{"RELEASE_VERSION"} = $today;
81 $version = $var{"RELEASE_VERSION"}; # set RELEASE_VERSION to passed in variable
84 # if version is today, then we will want to make a 'current' link.
86 if ($version eq $today) {
87 $create_current = 1;
91 # version can be a) passed in value from command line, b) value in manifest.mn
92 # or c) computed value such as '19970909'
95 $dir = "$var{'RELEASE_TREE'}/$path";
98 if (! (-e "$dir/$version" && -d "$dir/$version")) {
99 print "making dir $dir \n";
100 &rec_mkdir("$dir/$version");
105 print "version = $version\n";
106 print "path = $path\n";
107 print "var{release_tree} = $var{'RELEASE_TREE'}\n";
108 print "dir = $dir = RELEASE_TREE/path\n";
112 if ($create_current == 1) {
114 # unlinking and linking always occurs, even if the link is correct
115 print "unlinking $dir/current\n";
116 unlink("$dir/current");
118 print "putting version number $today into 'current' file..";
120 open(FILE,">$dir/current") || die " couldn't open current\n";
121 print FILE "$today\n";
122 close(FILE);
123 print " ..done\n"
127 &rec_mkdir("$dir/$version/$var{'RELEASE_MD_DIR'}");
128 &rec_mkdir("$dir/$version/$var{'RELEASE_XP_DIR'}");
133 foreach $jarfile (split(/ /,$var{FILES}) ) {
134 print STDERR "---------------------------------------------\n";
136 $jarinfo = $var{$jarfile};
138 ($jardir,$jaropts) = split(/\|/,$jarinfo);
140 if ($jaropts =~ /f/) {
141 print STDERR "Copying files $jardir....\n";
143 else {
144 print STDERR "Copying jar file $jarfile....\n";
147 print "jaropts = $jaropts\n";
149 if ($jaropts =~ /m/) {
150 $destdir = $var{"RELEASE_MD_DIR"};
151 print "found m, using MD dir $destdir\n";
153 elsif ($jaropts =~ /x/) {
154 $destdir = $var{"RELEASE_XP_DIR"};
155 print "found x, using XP dir $destdir\n";
157 else {
158 die "Error: must specify m or x in jar options in $jarinfo line\n";
162 $distdir = "$dir/$version/$destdir";
166 if ($jaropts =~ /f/) {
168 print "splitting: \"$jardir\"\n";
169 for $srcfile (split(/ /,$jardir)) {
171 #if srcfile has a slash
172 if ($srcfile =~ m|/|) {
173 #pull out everything before the last slash into $1
174 $srcfile =~ m|(.*)/|;
175 $distsubdir = "/$1";
176 print "making dir $distdir$distsubdir\n";
177 &rec_mkdir("$distdir$distsubdir");
179 print "copy: from $srcfile\n";
180 print " to $distdir$distsubdir\n";
181 $srcprefix = "";
182 if ($jaropts =~/m/) {
183 $srcprefix = "$var{'PLATFORM'}/";
185 system("cp $srcprefix$srcfile $distdir$distsubdir");
188 else {
189 $srcfile = "$var{SOURCE_RELEASE_PREFIX}/$jardir/$jarfile";
191 print "copy: from $srcfile\n";
192 print " to $distdir\n";
194 system("cp $srcfile $distdir");