From c7be363ef34d1228ad3d1d1aeba4911fbde1242f Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Fri, 16 Nov 2012 08:50:36 +0000 Subject: Move logging out of the makefile So that it's possible to run the same scripts from the shell. --- diff --git a/Makefile b/Makefile index 31bd5a2..6a10830 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ -TIMESTAMP := $(shell date +%Y%m%d-%H%M%S) -LOGFILE = $(CURDIR)/logs/build-$(TIMESTAMP).log SCRIPTS = $(CURDIR)/scripts COMMANDS = $(CURDIR)/commands LOG = $(SCRIPTS)/log-command @@ -21,7 +19,7 @@ check-system: $(COMMANDS)/check-system $(ARGS) build: check-system - $(LOG) "$(COMMANDS)/build" $(LOGFILE) + $(COMMANDS)/build run: x11-utils $(SCRIPTS)/shell/start-sugar diff --git a/commands/build b/commands/build index 99f3048..b90f0fa 100755 --- a/commands/build +++ b/commands/build @@ -1,8 +1,12 @@ -#!/usr/bin/python -u +#!/bin/bash -import common +commandsdir=`dirname "$0"` +rootdir=`dirname "$commandsdir"` +helpersdir=$commandsdir/helpers -from devbot import build +timestamp=`date +%Y%m%d-%H%M%S` +logfile=$rootdir/logs/build-$timestamp.log -common.setup() -build.build() +PYTHONPATH=$commandsdir $helpersdir/build | tee -a $logfile + +exit ${PIPESTATUS[0]} diff --git a/commands/helpers/build b/commands/helpers/build new file mode 100755 index 0000000..99f3048 --- /dev/null +++ b/commands/helpers/build @@ -0,0 +1,8 @@ +#!/usr/bin/python -u + +import common + +from devbot import build + +common.setup() +build.build() diff --git a/scripts/log-command b/scripts/log-command deleted file mode 100755 index a2fc61d..0000000 --- a/scripts/log-command +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -exec $1 | tee -a $2 - -exit ${PIPESTATUS[0]} -- cgit v0.9.1