Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-06-14 19:54:16 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-06-14 19:54:53 (GMT)
commit51e2d72c322d8aee6c9bcc6dfc2941abd443fb12 (patch)
treeb8b7808fcb679228b01b06e61368c1a38c114631
parentb3d05dd224ee8d01307e2e079f6955b9581df90c (diff)
Add a bug-report command
This generates logs that will be useful for debugging.
-rw-r--r--.gitignore2
-rw-r--r--Makefile17
-rw-r--r--README15
-rw-r--r--logs/README1
-rwxr-xr-xscripts/bug-report26
5 files changed, 50 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index b23eed5..945eb90 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
*~
build/
source/
+logs/*.log
+logs/all-logs.tar.bz2
diff --git a/Makefile b/Makefile
index d3f1a7b..9f26760 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+TIMESTAMP := $(shell date +%Y%m%d-%H%M%S)
+LOGFILE = $(CURDIR)/logs/build-$(TIMESTAMP).log
SCRIPTS = $(CURDIR)/scripts
JHBUILD = $(CURDIR)/build/bin/jhbuild -f $(SCRIPTS)/jhbuildrc
@@ -6,7 +8,7 @@ submodules:
git submodule update
check-system:
- $(SCRIPTS)/check-system
+ script -ae -c "$(SCRIPTS)/check-system" $(LOGFILE)
install-jhbuild: submodules check-system
cd $(SCRIPTS)/jhbuild ; \
@@ -14,19 +16,22 @@ install-jhbuild: submodules check-system
make ; make install
build-activities: submodules
- $(JHBUILD) run $(SCRIPTS)/build-activity terminal
+ $(JHBUILD) run $(SCRIPTS)/build-activity terminal | tee -a $(LOGFILE)
build-glucose: install-jhbuild check-system
- $(JHBUILD) build
+ script -ae -c "$(JHBUILD) build" $(LOGFILE)
build: build-glucose build-activities
build-%:
- $(JHBUILD) buildone $*
+ script -ae -c "$(JHBUILD) buildone $*" $(LOGFILE)
run:
xinit $(SCRIPTS)/xinitrc -- :2
+bug-report:
+ @$(SCRIPTS)/bug-report
+
clean:
- rm -rf source
- rm -rf build
+ rm -rf source build
+ rm -f logs/*.log all-logs.tar.bz2
diff --git a/README b/README
index eb9edc6..d538f4c 100644
--- a/README
+++ b/README
@@ -25,14 +25,19 @@ That should be all you need to have sugar running!
= Commands reference =
-make build Build everything.
-make run Run sugar.
-make build-[module] Build a single module.
-make clean Delete build artifacts and sources.
+make build Build everything.
+make run Run sugar.
+make build-[module] Build a single module.
+make clean Delete build artifacts and sources.
+make bug-report Generate a bug report.
= Report bugs =
-For now just send an email to Daniel Narvaez <dwnarvaez@gmail.com>. I expect a lot of tweaks will be necessary before this is stable. In the future distributions upgrades will also be problematic. We need the build to work out of the box 99% of the time for everyone, so if stuff breaks don't please don't be shy and always report a bug (patches are appreciated of course but not required). If you install an activity and it doesn't work, that might also be a sugar-build bug, in doubt just report it.
+I expect a lot of tweaks will be necessary before this is stable. In the future distributions upgrades will also be problematic. We need the build to work out of the box 99% of the time for everyone, so if stuff breaks don't please don't be shy and always report a bug (patches are appreciated of course but not required). If you install an activity and it doesn't work, that might also be a sugar-build bug, in doubt just report it.
+
+To generate bug report information
+
+ make bug-report
= Rationale =
diff --git a/logs/README b/logs/README
new file mode 100644
index 0000000..93cc99d
--- /dev/null
+++ b/logs/README
@@ -0,0 +1 @@
+Build logs
diff --git a/scripts/bug-report b/scripts/bug-report
new file mode 100755
index 0000000..05f02ec
--- /dev/null
+++ b/scripts/bug-report
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+scriptsdir=`dirname "$0"`
+rootdir=`dirname "$scriptsdir"`
+buildlogsdir=$rootdir/logs
+sugarlogsdir=~/.sugar/default/logs
+tarfile=$buildlogsdir/all-logs.tar.bz2
+
+tarcommand="tar cfj $tarfile"
+
+if [ -d $buildlogsdir ]; then
+ buildlogs=`cd $buildlogsdir; find *.log`
+ tarcommand="$tarcommand -C $buildlogsdir $buildlogs"
+fi
+
+if [ -d $sugarlogsdir ]; then
+ sugarlogs=`cd $sugarlogsdir; find *.log`
+ tarcommand="$tarcommand -C $sugarlogsdir $sugarlogs"
+fi
+
+$tarcommand
+
+echo
+echo "Send an email to Daniel Narvaez <dwnarvaez@gmail.com>."
+echo "Attach the $tarfile file."
+echo