From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qg3ox-0002pX-3t for garchives@archives.gentoo.org; Sun, 10 Jul 2011 23:53:55 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7864521C174; Sun, 10 Jul 2011 23:53:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3B0F121C174 for ; Sun, 10 Jul 2011 23:53:48 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 980FB2AC162 for ; Sun, 10 Jul 2011 23:53:47 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id CC0EC8003D for ; Sun, 10 Jul 2011 23:53:46 +0000 (UTC) From: "Liam McLoughlin" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Liam McLoughlin" Message-ID: <1bae2a947fb5db183361f3cda1440d0192abec3a.hexxeh@gentoo> Subject: [gentoo-commits] proj/gentoaster:master commit in: / X-VCS-Repository: proj/gentoaster X-VCS-Files: create_image.sh daemon.php status.php X-VCS-Directories: / X-VCS-Committer: hexxeh X-VCS-Committer-Name: Liam McLoughlin X-VCS-Revision: 1bae2a947fb5db183361f3cda1440d0192abec3a Date: Sun, 10 Jul 2011 23:53:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 5e4a23181b8cde69a5af0d38186001ae commit: 1bae2a947fb5db183361f3cda1440d0192abec3a Author: Liam McLoughlin hexxeh net> AuthorDate: Sun Jul 10 23:53:34 2011 +0000 Commit: Liam McLoughlin hexxeh net> CommitDate: Sun Jul 10 23:53:34 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoaster.gi= t;a=3Dcommit;h=3D1bae2a94 Added compress flag to build tool --- create_image.sh | 13 +++++++++++-- daemon.php | 2 +- status.php | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/create_image.sh b/create_image.sh index 0cc7f4f..94004a8 100755 --- a/create_image.sh +++ b/create_image.sh @@ -29,6 +29,7 @@ RUNNING_DIRECTORY=3D$(cd `dirname $0` && pwd) DEFINE_string 'config' '' 'configuration to build from'=20 DEFINE_string 'proxy' '' 'HTTP proxy to use for emerges' DEFINE_boolean 'cachedkernel' false 'use a cached kernel (shortens build= time)' +DEFINE_boolean 'compress' false 'compressed the finished image' =20 FLAGS "$@" || exit 1 eval set -- "${FLAGS_ARGV}" @@ -263,21 +264,29 @@ case "${OUTPUT_FORMAT}" in ;; "vbox" ) echo "Converting image from RAW to VDI" &>> ${LOG_FILE} - qemu-img convert -O vdi ${IMAGE_NAME} ${BUILD_ID}.vdi || handle_error = "Error converting disk image to VDI format" + qemu-img convert -O vdi ${IMAGE_NAME} ${BUILD_ID}.vdi &>> ${LOG_FILE} = || handle_error "Error converting disk image to VDI format" rm -rf ${IMAGE_NAME} IMAGE_OUT=3D"${BUILD_ID}.vdi" ;; "vmware" ) echo "Converting image from RAW to VMDK" &>> ${LOG_FILE} - qemu-img convert -O vmdk ${IMAGE_NAME} ${BUILD_ID}.vmdk || handle_erro= r "Error converting disk image to VMDK format" + qemu-img convert -O vmdk ${IMAGE_NAME} ${BUILD_ID}.vmdk &>> ${LOG_FILE= } || handle_error "Error converting disk image to VMDK format" rm -rf ${IMAGE_NAME} IMAGE_OUT=3D"${BUILD_ID}.vmdk" ;; esac + mv ${IMAGE_OUT} ${IMAGES_OUTPUT_PATH}/${IMAGE_OUT} || handle_error "Erro= r moving finished image" mv ${LOG_FILE} ${IMAGES_OUTPUT_PATH}/${BUILD_ID}.log || handle_error "Er= ror moving log file" +LOG_FILE=3D"${IMAGES_OUTPUT_PATH}/${BUILD_ID}.log" rm -rf ${IMAGE_WORK_PATH} || handle_error "Error removing working direct= ory" =20 +if [[ ${FLAGS_compress} -eq ${FLAGS_TRUE} ]]; then + cd ${IMAGES_OUTPUT_PATH} + tar czvf "${BUILD_ID}.tar.gz" "${IMAGE_OUT}" &>> ${LOG_FILE} || handle_= error "Error compressing image" + IMAGE_OUT=3D"${BUILD_ID}.tar.gz" +fi + echo "Step 23: Image build completed!" echo "Your image is here: ${IMAGES_OUTPUT_PATH}/${IMAGE_OUT}" echo "Your log file is here: ${IMAGES_OUTPUT_PATH}/${BUILD_ID}.log" diff --git a/daemon.php b/daemon.php index 3665abc..af7143b 100644 --- a/daemon.php +++ b/daemon.php @@ -45,7 +45,7 @@ if(is_writable($build_path)) { chdir($build_path); file_put_contents("config.ini", $configuration_string); - $tool_args =3D "--config config.ini"; + $tool_args =3D "--config config.ini --compress"; $process_handle =3D popen($gentoaster_path."/".$tool_name." ".$tool_= args." 2>&1", "r"); =20 $nonstatus_output =3D ""; diff --git a/status.php b/status.php index f5b5da0..e5624dd 100644 --- a/status.php +++ b/status.php @@ -20,7 +20,7 @@ } else { $result =3D mysql_query("SELECT returncode, result FROM builds WHERE = id =3D '".mysql_real_escape_string($argv[1])."'"); $jobres =3D mysql_fetch_array($result); - if($jobres[0] !=3D NULL) { + if($jobres[0] !=3D=3D NULL) { echo "Job returned with code ".$jobres[0].": ".$jobres[1]."\n"; } else { echo "Job failed\n";