Skip to content

Commit 3c8ee71

Browse files
committedJan 17, 2012
Ready for 7.10.25 development.
1 parent 9ba3022 commit 3c8ee71

File tree

4 files changed

+1093
-775
lines changed

4 files changed

+1093
-775
lines changed
 

‎docs/changelog/7.x.x.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
7.10.25
2+
13
7.10.24
24
- fixed #12318: asset error causes asset manager to fail
35
- fixed #12308: error message used scalar as reference

‎docs/previousVersion.sql

+967-774
Large diffs are not rendered by default.
+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#!/usr/bin/env perl
2+
3+
#-------------------------------------------------------------------
4+
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
5+
#-------------------------------------------------------------------
6+
# Please read the legal notices (docs/legal.txt) and the license
7+
# (docs/license.txt) that came with this distribution before using
8+
# this software.
9+
#-------------------------------------------------------------------
10+
# http://www.plainblack.com info@plainblack.com
11+
#-------------------------------------------------------------------
12+
13+
our ($webguiRoot);
14+
15+
BEGIN {
16+
$webguiRoot = "../..";
17+
unshift (@INC, $webguiRoot."/lib");
18+
}
19+
20+
use strict;
21+
use Getopt::Long;
22+
use WebGUI::Session;
23+
use WebGUI::Storage;
24+
use WebGUI::Asset;
25+
26+
27+
my $toVersion = '7.10.25';
28+
my $quiet; # this line required
29+
30+
31+
my $session = start(); # this line required
32+
33+
# upgrade functions go here
34+
35+
finish($session); # this line required
36+
37+
38+
#----------------------------------------------------------------------------
39+
# Describe what our function does
40+
#sub exampleFunction {
41+
# my $session = shift;
42+
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
43+
# # and here's our code
44+
# print "DONE!\n" unless $quiet;
45+
#}
46+
47+
48+
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
49+
50+
#----------------------------------------------------------------------------
51+
# Add a package to the import node
52+
sub addPackage {
53+
my $session = shift;
54+
my $file = shift;
55+
56+
print "\tUpgrading package $file\n" unless $quiet;
57+
# Make a storage location for the package
58+
my $storage = WebGUI::Storage->createTemp( $session );
59+
$storage->addFileFromFilesystem( $file );
60+
61+
# Import the package into the import node
62+
my $package = eval {
63+
my $node = WebGUI::Asset->getImportNode($session);
64+
$node->importPackage( $storage, {
65+
overwriteLatest => 1,
66+
clearPackageFlag => 1,
67+
setDefaultTemplate => 1,
68+
} );
69+
};
70+
71+
if ($package eq 'corrupt') {
72+
die "Corrupt package found in $file. Stopping upgrade.\n";
73+
}
74+
if ($@ || !defined $package) {
75+
die "Error during package import on $file: $@\nStopping upgrade\n.";
76+
}
77+
78+
return;
79+
}
80+
81+
#-------------------------------------------------
82+
sub start {
83+
my $configFile;
84+
$|=1; #disable output buffering
85+
GetOptions(
86+
'configFile=s'=>\$configFile,
87+
'quiet'=>\$quiet
88+
);
89+
my $session = WebGUI::Session->open($webguiRoot,$configFile);
90+
$session->user({userId=>3});
91+
my $versionTag = WebGUI::VersionTag->getWorking($session);
92+
$versionTag->set({name=>"Upgrade to ".$toVersion});
93+
return $session;
94+
}
95+
96+
#-------------------------------------------------
97+
sub finish {
98+
my $session = shift;
99+
updateTemplates($session);
100+
my $versionTag = WebGUI::VersionTag->getWorking($session);
101+
$versionTag->commit;
102+
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
103+
$session->close();
104+
}
105+
106+
#-------------------------------------------------
107+
sub updateTemplates {
108+
my $session = shift;
109+
return undef unless (-d "packages-".$toVersion);
110+
print "\tUpdating packages.\n" unless ($quiet);
111+
opendir(DIR,"packages-".$toVersion);
112+
my @files = readdir(DIR);
113+
closedir(DIR);
114+
my $newFolder = undef;
115+
foreach my $file (@files) {
116+
next unless ($file =~ /\.wgpkg$/);
117+
# Fix the filename to include a path
118+
$file = "packages-" . $toVersion . "/" . $file;
119+
addPackage( $session, $file );
120+
}
121+
}
122+
123+
#vim:ft=perl

‎lib/WebGUI.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package WebGUI;
22

33

4-
our $VERSION = '7.10.24';
4+
our $VERSION = '7.10.25';
55
our $STATUS = 'stable';
66

77

0 commit comments

Comments
 (0)
Please sign in to comment.