From bc2ec90354bf1a7a924926b16c9409f3cc12c2b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Hern=C3=A1ndez-Novich?= Date: Mon, 9 Jun 2008 15:35:43 +0000 Subject: [PATCH] Make sure $webguiRoot is setup consistently in all upgrade scripts. All the scripts had a hardcoded use lib "../../lib" and "../.." on Session method calls. This was changed to a BEGIN prologue where @INC gets $webguiRoot added, and the method calls use $webguiRoot instead. This eases the creation of patches for filesystem reorganization of WebGUI files (e.g. for Debian packaging). --- docs/upgrades/upgrade_7.4.21-7.5.0.pl | 10 ++++++++-- docs/upgrades/upgrade_7.5.0-7.5.1.pl | 10 ++++++++-- docs/upgrades/upgrade_7.5.1-7.5.2.pl | 10 ++++++++-- docs/upgrades/upgrade_7.5.10-7.5.11.pl | 10 ++++++++-- docs/upgrades/upgrade_7.5.2-7.5.3.pl | 10 ++++++++-- docs/upgrades/upgrade_7.5.3-7.5.4.pl | 10 ++++++++-- docs/upgrades/upgrade_7.5.4-7.5.5.pl | 10 ++++++++-- docs/upgrades/upgrade_7.5.5-7.5.6.pl | 10 ++++++++-- docs/upgrades/upgrade_7.5.6-7.5.7.pl | 10 ++++++++-- docs/upgrades/upgrade_7.5.7-7.5.8.pl | 10 ++++++++-- docs/upgrades/upgrade_7.5.8-7.5.9.pl | 10 ++++++++-- docs/upgrades/upgrade_7.5.9-7.5.10.pl | 10 ++++++++-- 12 files changed, 96 insertions(+), 24 deletions(-) diff --git a/docs/upgrades/upgrade_7.4.21-7.5.0.pl b/docs/upgrades/upgrade_7.4.21-7.5.0.pl index c3fe2a8a8..481c6a246 100644 --- a/docs/upgrades/upgrade_7.4.21-7.5.0.pl +++ b/docs/upgrades/upgrade_7.4.21-7.5.0.pl @@ -8,7 +8,13 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib "../../lib"; +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + use strict; use Getopt::Long; use WebGUI::Session; @@ -550,7 +556,7 @@ sub start { 'configFile=s'=>\$configFile, 'quiet'=>\$quiet ); - my $session = WebGUI::Session->open("../..",$configFile); + my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion}); diff --git a/docs/upgrades/upgrade_7.5.0-7.5.1.pl b/docs/upgrades/upgrade_7.5.0-7.5.1.pl index 5eaafe102..93913fdf4 100644 --- a/docs/upgrades/upgrade_7.5.0-7.5.1.pl +++ b/docs/upgrades/upgrade_7.5.0-7.5.1.pl @@ -8,7 +8,13 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib "../../lib"; +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + use strict; use Getopt::Long; use WebGUI::Session; @@ -83,7 +89,7 @@ sub start { 'configFile=s'=>\$configFile, 'quiet'=>\$quiet ); - my $session = WebGUI::Session->open("../..",$configFile); + my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion}); diff --git a/docs/upgrades/upgrade_7.5.1-7.5.2.pl b/docs/upgrades/upgrade_7.5.1-7.5.2.pl index c6451de4e..c25cf54c2 100644 --- a/docs/upgrades/upgrade_7.5.1-7.5.2.pl +++ b/docs/upgrades/upgrade_7.5.1-7.5.2.pl @@ -8,7 +8,13 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib "../../lib"; +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + use strict; use Getopt::Long; use WebGUI::Session; @@ -73,7 +79,7 @@ sub start { 'configFile=s'=>\$configFile, 'quiet'=>\$quiet ); - my $session = WebGUI::Session->open("../..",$configFile); + my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion}); diff --git a/docs/upgrades/upgrade_7.5.10-7.5.11.pl b/docs/upgrades/upgrade_7.5.10-7.5.11.pl index 1350355bc..cca241620 100644 --- a/docs/upgrades/upgrade_7.5.10-7.5.11.pl +++ b/docs/upgrades/upgrade_7.5.10-7.5.11.pl @@ -8,7 +8,13 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib "../../lib"; +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + use strict; use Getopt::Long; use WebGUI::Session; @@ -1700,7 +1706,7 @@ sub start { 'configFile=s'=>\$configFile, 'quiet'=>\$quiet ); - my $session = WebGUI::Session->open("../..",$configFile); + my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion}); diff --git a/docs/upgrades/upgrade_7.5.2-7.5.3.pl b/docs/upgrades/upgrade_7.5.2-7.5.3.pl index 65a5493e9..604c6dce5 100644 --- a/docs/upgrades/upgrade_7.5.2-7.5.3.pl +++ b/docs/upgrades/upgrade_7.5.2-7.5.3.pl @@ -8,7 +8,13 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib "../../lib"; +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + use strict; use Getopt::Long; use WebGUI::Session; @@ -63,7 +69,7 @@ sub start { 'configFile=s'=>\$configFile, 'quiet'=>\$quiet ); - my $session = WebGUI::Session->open("../..",$configFile); + my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion}); diff --git a/docs/upgrades/upgrade_7.5.3-7.5.4.pl b/docs/upgrades/upgrade_7.5.3-7.5.4.pl index e178dd776..aad566ee9 100644 --- a/docs/upgrades/upgrade_7.5.3-7.5.4.pl +++ b/docs/upgrades/upgrade_7.5.3-7.5.4.pl @@ -8,7 +8,13 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib "../../lib"; +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + use strict; use Getopt::Long; use WebGUI::Session; @@ -124,7 +130,7 @@ sub start { 'configFile=s'=>\$configFile, 'quiet'=>\$quiet ); - my $session = WebGUI::Session->open("../..",$configFile); + my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion}); diff --git a/docs/upgrades/upgrade_7.5.4-7.5.5.pl b/docs/upgrades/upgrade_7.5.4-7.5.5.pl index 61b9e44a1..2bbd1d45a 100644 --- a/docs/upgrades/upgrade_7.5.4-7.5.5.pl +++ b/docs/upgrades/upgrade_7.5.4-7.5.5.pl @@ -8,7 +8,13 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib "../../lib"; +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + use strict; use Getopt::Long; use WebGUI::Session; @@ -113,7 +119,7 @@ sub start { 'configFile=s'=>\$configFile, 'quiet'=>\$quiet ); - my $session = WebGUI::Session->open("../..",$configFile); + my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion}); diff --git a/docs/upgrades/upgrade_7.5.5-7.5.6.pl b/docs/upgrades/upgrade_7.5.5-7.5.6.pl index 55133b6ec..efe37f1f4 100644 --- a/docs/upgrades/upgrade_7.5.5-7.5.6.pl +++ b/docs/upgrades/upgrade_7.5.5-7.5.6.pl @@ -8,7 +8,13 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib "../../lib"; +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + use strict; use Getopt::Long; use WebGUI::Session; @@ -224,7 +230,7 @@ sub start { 'configFile=s'=>\$configFile, 'quiet'=>\$quiet ); - my $session = WebGUI::Session->open("../..",$configFile); + my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion}); diff --git a/docs/upgrades/upgrade_7.5.6-7.5.7.pl b/docs/upgrades/upgrade_7.5.6-7.5.7.pl index d82e5a8ed..afb2b7331 100644 --- a/docs/upgrades/upgrade_7.5.6-7.5.7.pl +++ b/docs/upgrades/upgrade_7.5.6-7.5.7.pl @@ -8,7 +8,13 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib "../../lib"; +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + use strict; use Getopt::Long; use WebGUI::Session; @@ -62,7 +68,7 @@ sub start { 'configFile=s'=>\$configFile, 'quiet'=>\$quiet ); - my $session = WebGUI::Session->open("../..",$configFile); + my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion}); diff --git a/docs/upgrades/upgrade_7.5.7-7.5.8.pl b/docs/upgrades/upgrade_7.5.7-7.5.8.pl index dbb49c6f4..bd6a8a1f8 100644 --- a/docs/upgrades/upgrade_7.5.7-7.5.8.pl +++ b/docs/upgrades/upgrade_7.5.7-7.5.8.pl @@ -8,7 +8,13 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib "../../lib"; +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + use strict; use Getopt::Long; use WebGUI::Session; @@ -162,7 +168,7 @@ sub start { 'configFile=s'=>\$configFile, 'quiet'=>\$quiet ); - my $session = WebGUI::Session->open("../..",$configFile); + my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion}); diff --git a/docs/upgrades/upgrade_7.5.8-7.5.9.pl b/docs/upgrades/upgrade_7.5.8-7.5.9.pl index 534d0ada6..2dca1e41a 100644 --- a/docs/upgrades/upgrade_7.5.8-7.5.9.pl +++ b/docs/upgrades/upgrade_7.5.8-7.5.9.pl @@ -8,7 +8,13 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib "../../lib"; +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + use strict; use Getopt::Long; use WebGUI::Session; @@ -107,7 +113,7 @@ sub start { 'configFile=s'=>\$configFile, 'quiet'=>\$quiet ); - my $session = WebGUI::Session->open("../..",$configFile); + my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion}); diff --git a/docs/upgrades/upgrade_7.5.9-7.5.10.pl b/docs/upgrades/upgrade_7.5.9-7.5.10.pl index faf1a4ade..24bbc5746 100644 --- a/docs/upgrades/upgrade_7.5.9-7.5.10.pl +++ b/docs/upgrades/upgrade_7.5.9-7.5.10.pl @@ -8,7 +8,13 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib "../../lib"; +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + use strict; use Getopt::Long; use WebGUI::Session; @@ -93,7 +99,7 @@ sub start { 'configFile=s'=>\$configFile, 'quiet'=>\$quiet ); - my $session = WebGUI::Session->open("../..",$configFile); + my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion});