From 1cc34c2cef806704afec464e77bf57ca95df63e4 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 24 Jan 2009 21:58:21 -0500 Subject: [PATCH] Operate similar to builder scripts for GIT checkouts --- etc/phpshellsessions/cvssync | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/etc/phpshellsessions/cvssync b/etc/phpshellsessions/cvssync index bbf139e953..e41d37438c 100644 --- a/etc/phpshellsessions/cvssync +++ b/etc/phpshellsessions/cvssync @@ -113,7 +113,11 @@ if(is_dir("$CODIR/pfSenseGITREPO")) { exec("cd $CODIR/pfSenseGITREPO && git fetch"); exec("cd $CODIR/pfSenseGITREPO && git merge $branch"); } else { - exec("cd $CODIR && git clone $GIT_REPO pfSenseGITREPO"); + exec("cd $CODIR/pfSenseGITREPO && git clone $GIT_REPO pfSenseGITREPO"); + if(is_dir("$CODIR/pfSenseGITREPO/pfSense")) + exec("mv $CODIR/pfSenseGITREPO/pfSense $CODIR/pfSenseGITREPO/pfSenseGITREPO") + if(is_dir("$CODIR/pfSenseGITREPO/mainline")) + exec("mv $CODIR/pfSenseGITREPO/mainline $CODIR/pfSenseGITREPO/pfSenseGITREPO") } if($branch == "master") { @@ -121,17 +125,17 @@ if($branch == "master") { } else { $current_branch=`git branch | grep $BRANCHTAG`; if($current_branch == "") { - exec("cd $CODIR/pfSenseGITREPO && git checkout -b $BRANCHTAG origin/$BRANCHTAG"); + exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout -b $BRANCHTAG origin/$BRANCHTAG"); } else { - exec("cd $CODIR/pfSenseGITREPO && git checkout $BRANCHTAG"); + exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout $BRANCHTAG"); } } exec("mkdir -p /tmp/lighttpd/cache/compress/"); // Nuke CVS and pfSense tarballs -exec("cd ${CODIR}/pfSenseGITREPO/ && find . -name CVS -exec rm -rf {} \; 2>/dev/null"); -exec("cd ${CODIR}/pfSenseGITREPO/ && find . -name pfSense.tgz -exec rm {} \; 2>/dev/null"); +exec("cd ${CODIR}/pfSenseGITREPO/pfSenseGITREPO && find . -name CVS -exec rm -rf {} \; 2>/dev/null"); +exec("cd ${CODIR}/pfSenseGITREPO/pfSenseGITREPO && find . -name pfSense.tgz -exec rm {} \; 2>/dev/null"); // Remove files that we do not want to overwrite the system with exec("rm ${CODIR}/pfSenseGITREPO/usr/local/www/trigger_initial_wizard 2>/dev/null"); @@ -155,9 +159,9 @@ exec("rm -f ${CODIR}/pfSenseGITREPO/etc/syslog.conf 2>/dev/null"); echo "===> Installing new files...\n"; if($g['platform'] == "pfSense") - $command = "cd $CODIR/pfSenseGITREPO ; tar -cpf - . | (cd / ; tar -Uxpf -)"; + $command = "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO ; tar -cpf - . | (cd / ; tar -Uxpf -)"; else - $command = "cd $CODIR/pfSenseGITREPO ; tar -cpf - . | (cd / ; tar -xpf -) 2>/dev/null"; + $command = "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO ; tar -cpf - . | (cd / ; tar -xpf -) 2>/dev/null"; exec($command); post_cvssync_commands();