summaryrefslogtreecommitdiffstats
path: root/etc/phpshellsessions
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@sullrich-MacBookPro.local>2009-04-03 17:40:32 -0400
committerScott Ullrich <sullrich@sullrich-MacBookPro.local>2009-04-03 17:40:32 -0400
commite623dd70fb0af18f13a88f594c2c0a95918f6fdf (patch)
tree8d67701b7e4efa2d014de55300ec741df5b8009b /etc/phpshellsessions
parent05f6a2671d5838c12bce2101c45182815c12e306 (diff)
downloadpfsense-e623dd70fb0af18f13a88f594c2c0a95918f6fdf.zip
pfsense-e623dd70fb0af18f13a88f594c2c0a95918f6fdf.tar.gz
Sync
Diffstat (limited to 'etc/phpshellsessions')
-rw-r--r--etc/phpshellsessions/cvssync39
1 files changed, 30 insertions, 9 deletions
diff --git a/etc/phpshellsessions/cvssync b/etc/phpshellsessions/cvssync
index 461811f..238f5d0 100644
--- a/etc/phpshellsessions/cvssync
+++ b/etc/phpshellsessions/cvssync
@@ -58,6 +58,7 @@ if($command_split[2]) {
foreach($branches as $branchname => $branchdesc) {
echo "{$branchname} \t {$branchdesc}\n";
}
+ echo "\nOr alternatively you may enter a custom branch URL.\n\n";
$branch = readline("> ");
echo "\n";
} else {
@@ -78,8 +79,24 @@ foreach($branches as $branchname => $branchdesc) {
$found = true;
}
if(!$found) {
- echo "\nInvalid branch.\n";
- exit;
+ if(isURL($branch)) {
+ echo "\n";
+ echo "NOTE: $branch was not found.\n\n";
+ $command = readline("Is this a custom GIT URL? [y]? ");
+ if(strtolower($command) == "y" or $command == "") {
+ $GIT_REPO = $branch;
+ $command = readline("Checkout which branch [master]? ");
+ if($command == "")
+ $branch = "master";
+ if($command)
+ $branch = $command;
+ $found = true;
+ }
+ }
+ if(!$found) {
+ echo "\nNo valid branch found. Exiting.\n\n";
+ exit;
+ }
}
if($branch == "RESTORE" && $g['platform'] == "pfSense") {
@@ -113,7 +130,7 @@ if(is_dir("$CODIR/pfSenseGITREPO")) {
exec("cd $CODIR/pfSenseGITREPO && git merge $branch");
} else {
exec("mkdir -p $CODIR/pfSenseGITREPO");
- echo "Executing cd $CODIR/pfSenseGITREPO && git clone $GIT_REPO pfSenseGITREPO";
+ echo "Executing cd $CODIR/pfSenseGITREPO && git clone $GIT_REPO pfSenseGITREPO\n";
exec("cd $CODIR/pfSenseGITREPO && git clone $GIT_REPO pfSenseGITREPO");
if(is_dir("$CODIR/pfSenseGITREPO/pfSense"))
exec("mv $CODIR/pfSenseGITREPO/pfSense $CODIR/pfSenseGITREPO/pfSenseGITREPO");
@@ -124,12 +141,7 @@ if(is_dir("$CODIR/pfSenseGITREPO")) {
if($branch == "master") {
exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout master");
} else {
- $current_branch=`git branch | grep $branch`;
- if($current_branch == "") {
- exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout -b $branch origin/$branch");
- } else {
- exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout $branch");
- }
+ exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout -b $branch origin/$branch");
}
exec("mkdir -p /tmp/lighttpd/cache/compress/");
@@ -201,4 +213,13 @@ function post_cvssync_commands() {
echo "\n";
}
+function isUrl($url = "") {
+ if($url)
+ if(strstr($url, "rcs.pfsense.org") or
+ strstr($url, "mainline") or
+ strstr($url, ".git"))
+ return true;
+ return false;
+}
+
conf_mount_ro();
OpenPOWER on IntegriCloud