source tree re-arrangement
authorMichael Wallner <mike@php.net>
Sun, 30 Jun 2013 19:23:07 +0000 (21:23 +0200)
committerMichael Wallner <mike@php.net>
Sun, 30 Jun 2013 19:56:59 +0000 (21:56 +0200)
14 files changed:
README.md
bin/btr
lib/btr/btr.mk [deleted file]
lib/btr/btr.sh
lib/btr/build/pecl.mk [new file with mode: 0644]
lib/btr/build/php.mk [new file with mode: 0644]
lib/btr/git.mk [deleted file]
lib/btr/mail.mk [deleted file]
lib/btr/pecl.mk [deleted file]
lib/btr/php.mk [deleted file]
lib/btr/report/mail.mk [new file with mode: 0644]
lib/btr/source/git.mk [new file with mode: 0644]
lib/btr/source/svn.mk [new file with mode: 0644]
lib/btr/svn.mk [deleted file]

index a2d16aca2e2150499ed3037f421cdc9f05a4e026..e0a929e2eb072f0da49496053261dd042ec908b8 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,14 +1,16 @@
 # btr
 
+A poor man's CI tool.
+
 ## BUILD TEST REPORT
 
 A simple tool to automate reporting of build and test results.
 
 ### Currently supported rulesets:
 
-* source: git, svn
-* build: php, pecl
-* report: mail
+* ***source:*** git, svn
+* ***build:*** php, pecl
+* ***report:*** mail
 
 #### Usage
 ```
diff --git a/bin/btr b/bin/btr
index 2eaeac818abb1c94bf2e355947e05339f065447c..5a6e190adced6a1e14282478674f82a5f0d1ef87 100755 (executable)
--- a/bin/btr
+++ b/bin/btr
@@ -15,11 +15,12 @@ setup
 
 if $VERBOSE
 then
-    show_conf
-    confirm "Do you want to continue?" || exit
+       show_conf
+       confirm "Do you want to continue?" || exit
 fi
 
-REPORT="$(make -s -C $BTRDIR -f $LIBDIR/$SOURCE_RULES.mk && make -s -C $BTRDIR -f $LIBDIR/$BUILD_RULES.mk)"
-make -s -C $BTRDIR -f $LIBDIR/$REPORT_RULES.mk REPORT="$REPORT"
+REPORT="$(make -s -C $BTRDIR -f $LIBDIR/source/$SOURCE_RULES.mk && \
+       make -s -C $BTRDIR -f $LIBDIR/build/$BUILD_RULES.mk)"
+make -s -C $BTRDIR -f $LIBDIR/report/$REPORT_RULES.mk REPORT="$REPORT"
 
 # vim: set noet
diff --git a/lib/btr/btr.mk b/lib/btr/btr.mk
deleted file mode 100644 (file)
index e461176..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-.PHONY: all source build report
-.SUFFIXES:
-export
-
-all: report
-
-source:
-
-# vim: set noet
index 16c9d6b6bacdccc277d4ad1ff113a4e8bfbf9593..75bb7cde9f73c5c9437bdb2a9519e098c0428483 100755 (executable)
 #!/bin/sh
 
 function help {
-    echo "btr v0.2.0, (c) Michael Wallner <mike@php.net>"
-    echo
-    echo "Usage: $(basename $0) [-hv] [<options>] <repository>"
-    echo
-    echo "    -h, --help      Display this help"
-    echo "    -v, --verbose   Be more verbose"
-    echo
-    echo "  Options:"
-    echo "    -s, --source=<rules>          Use the specified source ruleset"
-    echo "    -b, --build=<rules>           Use the specified build ruleset"
-    echo "    -r, --report=<rules>          Use the specifued report ruleset"
-    echo "    -B, --branch=<branch>         Checkout this branch"
-    echo "    -D, --directory=<directory>   Use this directory as work root"
-    echo "    -S, --suffix=<suffix>         Append suffix to the build name"
-    echo "    -C, --configure=<options>     Define \$CONFIGURE options"
-    echo
-    echo "  Rulesets:"
-    echo "    source: git, svn"
-    echo "    build:  php, pecl"
-    echo "    report: mail"
-    echo
-    exit
+       echo "btr v0.2.0, (c) Michael Wallner <mike@php.net>"
+       echo
+       echo "Usage: $(basename $0) [-hv] [<options>] <repository>"
+       echo
+       echo "  -h, --help        Display this help"
+       echo "  -v, --verbose   Be more verbose"
+       echo
+       echo "  Options:"
+       echo "  -s, --source=<rules>              Use the specified source ruleset"
+       echo "  -b, --build=<rules>                Use the specified build ruleset"
+       echo "  -r, --report=<rules>              Use the specifued report ruleset"
+       echo "  -B, --branch=<branch>            Checkout this branch"
+       echo "  -D, --directory=<directory>   Use this directory as work root"
+       echo "  -S, --suffix=<suffix>            Append suffix to the build name"
+       echo "  -C, --configure=<options>        Define \$CONFIGURE options"
+       echo
+       echo "  Rulesets:"
+       echo "  source: git, svn"
+       echo "  build:  php, pecl"
+       echo "  report: mail"
+       echo
+       exit
 }
 
 function parseopts {
-    local shortoptions="hvB:D:S:C:s:b:r:"
-    local longoptions="help,verbose,branch:,directory:,suffix:,configure:,source:,build:,report:"
-    local options=$(getopt \
-        --options "$shortoptions" \
-        --longoptions "$longoptions" \
-        -- "$@" \
-    )
+       local shortoptions="hvB:D:S:C:s:b:r:"
+       local longoptions="help,verbose,branch:,directory:,suffix:,configure:,source:,build:,report:"
+       local options=$(getopt \
+               --options "$shortoptions" \
+               --longoptions "$longoptions" \
+               -- "$@" \
+       )
 
-    if test $? -ne 0 ; then
-        help
-    fi
-    
-    eval set -- "$options"
-    
-    while test $# -gt 0
-    do
-        case "$1" in
-            -h|--help)
-                help
-                ;;
-            -v|--verbose)
-                VERBOSE=true
-                ;;
-            ####
-            -B|--branch)
-                BRANCH="$2"
-                shift
-                ;;
-            -D|--directory)
-                BTRDIR="$2"
-                shift
-                ;;
-            -S|--suffix)
-                SUFFIX="$2"
-                shift
-                ;;
-            -C|--configure)
-                CONFIGURE="$2"
-                shift
-                ;;
-            ####
-            -s|--source)
-                   case "$2" in
-                       git)
-                               SOURCE_RULES="git"
-                               test -z "$BRANCH" && BRANCH="master"
-                               ;;
-                           svn)
-                               SOURCE_RULES="svn"
-                               test -z "$BRANCH" && BRANCH="trunk"
-                               ;;
-                esac
-                shift
-                ;;
-            -b|--build)
-               case "$2" in
-                       php|pecl)
-                               BUILD_RULES="$2"
-                               ;;
-               esac
-               shift
-                ;;
-            -r|--report)
-               case "$2" in
-                       mail)
-                               REPORT_RULES="$2"
-                               ;;
-               esac
-               shift
-               ;;
-            ####
-            --)
-                SOURCE_URL="$2"
-                shift
-                ;;
-        esac
-        shift
-    done
+       if test $? -ne 0 ; then
+               help
+       fi
+       
+       eval set -- "$options"
+       
+       while test $# -gt 0
+       do
+               case "$1" in
+                       -h|--help)
+                               help
+                               ;;
+                       -v|--verbose)
+                               VERBOSE=true
+                               ;;
+                       ####
+                       -B|--branch)
+                               BRANCH="$2"
+                               shift
+                               ;;
+                       -D|--directory)
+                               BTRDIR="$2"
+                               shift
+                               ;;
+                       -S|--suffix)
+                               SUFFIX="$2"
+                               shift
+                               ;;
+                       -C|--configure)
+                               CONFIGURE="$2"
+                               shift
+                               ;;
+                       ####
+                       -s|--source)
+                               case "$2" in
+                                       git)
+                                               SOURCE_RULES="git"
+                                               test -z "$BRANCH" && BRANCH="master"
+                                               ;;
+                                       svn)
+                                               SOURCE_RULES="svn"
+                                               test -z "$BRANCH" && BRANCH="trunk"
+                                               ;;
+                               esac
+                               shift
+                               ;;
+                       -b|--build)
+                               case "$2" in
+                                       php|pecl)
+                                               BUILD_RULES="$2"
+                                               ;;
+                               esac
+                               shift
+                               ;;
+                       -r|--report)
+                               case "$2" in
+                                       mail)
+                                               REPORT_RULES="$2"
+                                               ;;
+                               esac
+                               shift
+                               ;;
+                       ####
+                       --)
+                               SOURCE_URL="$2"
+                               shift
+                               ;;
+               esac
+               shift
+       done
 }
 
 function error {
-    echo "$@" >&2
-    exit
+       echo "$@" >&2
+       exit
 }
 
 function setup {
-    if test -z "$SOURCE_URL" -o -z "$SOURCE_RULES" -o -z "$BUILD_RULES" -o -z "$REPORT_RULES"
-    then
-        help
-    fi
+       if test -z "$SOURCE_URL" -o -z "$SOURCE_RULES" -o -z "$BUILD_RULES" -o -z "$REPORT_RULES"
+       then
+               help
+       fi
 
-    export SOURCE_URL BRANCH SOURCE_RULES BUILD_RULES REPORT_RULES
+       export SOURCE_URL BRANCH SOURCE_RULES BUILD_RULES REPORT_RULES
 
-    if test -z "$BTRDIR"
-    then
-        export BTRDIR="/tmp/btr"
-    else
-        export BTRDIR=$(realpath "$BTRDIR")
-    fi
+       if test -z "$BTRDIR"
+       then
+               export BTRDIR="/tmp/btr"
+       else
+               export BTRDIR=$(realpath "$BTRDIR")
+       fi
 
-    export REPO=$(basename $(sed -re 's~^.*[/:]~~' <<<"$SOURCE_URL") .git)
-    export SAFE_BRANCH=$(tr ":" "_" <<<$(basename "$BRANCH"))
+       export REPO=$(basename $(sed -re 's~^.*[/:]~~' <<<"$SOURCE_URL") .git)
+       export SAFE_BRANCH=$(tr ":" "_" <<<$(basename "$BRANCH"))
 
-    if test -z "$SUFFIX"
-    then
-        export BUILD="$REPO@$SAFE_BRANCH"
-    else
-        export BUILD="$REPO@$SAFE_BRANCH-$SUFFIX"
-    fi
+       if test -z "$SUFFIX"
+       then
+               export BUILD="$REPO@$SAFE_BRANCH"
+       else
+               export BUILD="$REPO@$SAFE_BRANCH-$SUFFIX"
+       fi
 
-    export CLEAN_DIR="btr+clean-$REPO"
-    export BRANCH_DIR="btr+branch-$REPO@$SAFE_BRANCH"
-    export BUILD_DIR="btr+build-$BUILD"
-    export CONFIG_REPORT="btr+config-$BUILD-$DATE"
-    export BUILD_REPORT="btr+build-$BUILD-$DATE"
-    export TEST_REPORT="btr+tests-$BUILD-$DATE"
-    export LAST_REPORT=$(basename $(ls -t "$BTRDIR/btr+tests-$BUILD"* | tail -n1))
-    export REPORT=""
+       export CLEAN_DIR="btr+clean-$REPO"
+       export BRANCH_DIR="btr+branch-$REPO@$SAFE_BRANCH"
+       export BUILD_DIR="btr+build-$BUILD"
+       export CONFIG_REPORT="btr+config-$BUILD-$DATE"
+       export BUILD_REPORT="btr+build-$BUILD-$DATE"
+       export TEST_REPORT="btr+tests-$BUILD-$DATE"
+       export LAST_REPORT=$(basename $(ls -t "$BTRDIR/btr+tests-$BUILD"* | tail -n1))
+       export REPORT=""
 }
 
 function show_conf {
-    echo
-    echo "BTRDIR         = $BTRDIR"
-    echo "BINDIR         = $BINDIR"
-    echo "LIBDIR         = $LIBDIR"
-    echo "SOURCE_URL     = $SOURCE_URL"
-    echo "SOURCE_RULES   = $SOURCE_RULES"
-    echo "BUILD_RULES    = $BUILD_RULES"
-    echo "REPORT_RULES   = $REPORT_RULES"
-    echo "BRANCH         = $BRANCH"
-    echo "SAFE_BRANCH    = $SAFE_BRANCH"
-    echo "CLEAN_DIR      = $CLEAN_DIR"
-    echo "BRANCH_DIR     = $BRANCH_DIR"
-    echo "BUILD_DIR      = $BUILD_DIR"
-    echo "CONFIG_REPORT  = $CONFIG_REPORT"
-    echo "BUILD_REPORT   = $BUILD_REPORT"
-    echo "TEST_REPORT    = $TEST_REPORT"
-    echo "LAST_REPORT    = $LAST_REPORT"
-    echo
+       echo
+       echo "BTRDIR             = $BTRDIR"
+       echo "BINDIR             = $BINDIR"
+       echo "LIBDIR             = $LIBDIR"
+       echo "SOURCE_URL         = $SOURCE_URL"
+       echo "SOURCE_RULES   = $SOURCE_RULES"
+       echo "BUILD_RULES       = $BUILD_RULES"
+       echo "REPORT_RULES   = $REPORT_RULES"
+       echo "BRANCH             = $BRANCH"
+       echo "SAFE_BRANCH       = $SAFE_BRANCH"
+       echo "CLEAN_DIR   = $CLEAN_DIR"
+       echo "BRANCH_DIR         = $BRANCH_DIR"
+       echo "BUILD_DIR   = $BUILD_DIR"
+       echo "CONFIG_REPORT  = $CONFIG_REPORT"
+       echo "BUILD_REPORT   = $BUILD_REPORT"
+       echo "TEST_REPORT       = $TEST_REPORT"
+       echo "LAST_REPORT       = $LAST_REPORT"
+       echo
 }
 
 function confirm {
-    local CONTINUE
-    echo -n "$1 (y/N) "
-    read -r CONTINUE
-    case $CONTINUE in
-        y*|Y*)
-            echo
-            ;;
-        *)
-            exit -1
-            ;;
-    esac
+       local CONTINUE
+       echo -n "$1 (y/N) "
+       read -r CONTINUE
+       case $CONTINUE in
+               y*|Y*)
+                       echo
+                       ;;
+               *)
+                       exit -1
+                       ;;
+       esac
 }
 
 # vim: set noet
diff --git a/lib/btr/build/pecl.mk b/lib/btr/build/pecl.mk
new file mode 100644 (file)
index 0000000..545b835
--- /dev/null
@@ -0,0 +1,38 @@
+.PHONY: all
+.SUFFIXES:
+
+CONFIGS=$(wildcard $(BRANCH_DIR)/config*.m4 $(BRANCH_DIR)/*/config*.m4)
+
+all: $(TEST_REPORT)
+       TESTS_PASSED=$$(awk '/^Tests passed/{print $$4}' < $(TEST_REPORT)); \
+       TESTS_FAILED=$$(awk '/^Tests failed/{print $$4}' < $(TEST_REPORT)); \
+       if test -z "$(LAST_REPORT)"; then \
+               printf "%d/%d\n" $$TESTS_PASSED $$TESTS_FAILED; \
+       else \
+               LAST_PASSED=$$(awk '/^Tests passed/{print $$4}' < $(LAST_REPORT)); \
+               LAST_FAILED=$$(awk '/^Tests failed/{print $$4}' < $(LAST_REPORT)); \
+               DIFF_PASSED=$$(bc <<<"$$TESTS_PASSED - $$LAST_PASSED"); \
+               DIFF_FAILED=$$(bc <<<"$$TESTS_FAILED - $$LAST_FAILED"); \
+               printf "+%d/+%d\n" $$DIFF_PASSED $$DIFF_FAILED; \
+       fi;
+
+$(TEST_REPORT): $(BUILD_REPORT)
+       cd $(BUILD_DIR) && \
+       make test TESTS=../$(BRANCH_DIR)/$(TESTS) > ../$@
+
+$(BUILD_REPORT): $(CONFIG_REPORT)
+       cd $(BUILD_DIR) && \
+       make -j $(CPUS) > ../$@
+       
+$(CONFIG_REPORT): $(BRANCH_DIR)/configure $(BUILD_DIR)
+       cd $(BUILD_DIR) && \
+       ../$(BRANCH_DIR)/configure -C $(CONFIGURE) > ../$@
+
+$(BUILD_DIR):
+       mkdir -p $@
+       
+$(BRANCH_DIR)/configure: $(CONFIGS)
+       cd $(BRANCH_DIR) && \
+       phpize > /dev/null
+
+# vim: set noet
diff --git a/lib/btr/build/php.mk b/lib/btr/build/php.mk
new file mode 100644 (file)
index 0000000..84327d3
--- /dev/null
@@ -0,0 +1,38 @@
+.PHONY: all
+.SUFFIXES:
+
+CONFIGS=$(wildcard $(BRANCH_DIR)/ext/*/config*.m4)
+
+all: $(TEST_REPORT)
+       TESTS_PASSED=$$(awk '/^Tests passed/{print $$4}' < $(TEST_REPORT)); \
+       TESTS_FAILED=$$(awk '/^Tests failed/{print $$4}' < $(TEST_REPORT)); \
+       if test -z "$(LAST_REPORT)"; then \
+               printf "%d/%d\n" $$TESTS_PASSED $$TESTS_FAILED; \
+       else \
+               LAST_PASSED=$$(awk '/^Tests passed/{print $$4}' < $(LAST_REPORT)); \
+               LAST_FAILED=$$(awk '/^Tests failed/{print $$4}' < $(LAST_REPORT)); \
+               DIFF_PASSED=$$(bc <<<"$$TESTS_PASSED - $$LAST_PASSED"); \
+               DIFF_FAILED=$$(bc <<<"$$TESTS_FAILED - $$LAST_FAILED"); \
+               printf "+%d/+%d\n" $$DIFF_PASSED $$DIFF_FAILED; \
+       fi;
+
+$(TEST_REPORT): $(BUILD_REPORT)
+       cd $(BUILD_DIR) && \
+       make test TESTS=../$(BRANCH_DIR)/$(TESTS) > ../$@
+
+$(BUILD_REPORT): $(CONFIG_REPORT)
+       cd $(BUILD_DIR) && \
+       make -j $(CPUS) > ../$@
+       
+$(CONFIG_REPORT): $(BRANCH_DIR)/configure $(BUILD_DIR)
+       cd $(BUILD_DIR) && \
+       ../$(BRANCH_DIR)/configure -C $(CONFIGURE) > ../$@
+
+$(BUILD_DIR):
+       mkdir -p $@
+       
+$(BRANCH_DIR)/configure: $(BRANCH_DIR)/buildconf $(CONFIGS)
+       cd $(BRANCH_DIR) && \
+       ./buildconf > /dev/null
+
+# vim: set noet
diff --git a/lib/btr/git.mk b/lib/btr/git.mk
deleted file mode 100644 (file)
index 6ca93a9..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-.PHONY: pull all
-.SUFFIXES:
-
-all: $(BRANCH_DIR) pull
-       cd $(BRANCH_DIR) && \
-       git pull -q
-
-pull: $(CLEAN_DIR)
-       cd $(CLEAN_DIR) && \
-       git pull -q
-
-$(CLEAN_DIR):
-       git clone $(SOURCE_URL) $(CLEAN_DIR)
-
-$(BRANCH_DIR): $(CLEAN_DIR)
-       git-new-workdir $(CLEAN_DIR) $(BRANCH_DIR) $(BRANCH)
-
-# vim: set noet
diff --git a/lib/btr/mail.mk b/lib/btr/mail.mk
deleted file mode 100644 (file)
index 37b8a6c..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-.PHONY: all
-.SUFFIXES:
-
-all: 
-       MESSAGE=$$(printf "\nbtr %s %s\n\n-- \nbtr mail report\n" "$(BUILD)" "$(REPORT)"); \
-       mail -s "[btr] $(BUILD) $(REPORT)" \
-               -a $(CONFIG_REPORT) -a $(BUILD_REPORT) -a $(TEST_REPORT) \
-               $(USER) <<<"$$MESSAGE"
-
-# vim: set noet
diff --git a/lib/btr/pecl.mk b/lib/btr/pecl.mk
deleted file mode 100644 (file)
index 545b835..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-.PHONY: all
-.SUFFIXES:
-
-CONFIGS=$(wildcard $(BRANCH_DIR)/config*.m4 $(BRANCH_DIR)/*/config*.m4)
-
-all: $(TEST_REPORT)
-       TESTS_PASSED=$$(awk '/^Tests passed/{print $$4}' < $(TEST_REPORT)); \
-       TESTS_FAILED=$$(awk '/^Tests failed/{print $$4}' < $(TEST_REPORT)); \
-       if test -z "$(LAST_REPORT)"; then \
-               printf "%d/%d\n" $$TESTS_PASSED $$TESTS_FAILED; \
-       else \
-               LAST_PASSED=$$(awk '/^Tests passed/{print $$4}' < $(LAST_REPORT)); \
-               LAST_FAILED=$$(awk '/^Tests failed/{print $$4}' < $(LAST_REPORT)); \
-               DIFF_PASSED=$$(bc <<<"$$TESTS_PASSED - $$LAST_PASSED"); \
-               DIFF_FAILED=$$(bc <<<"$$TESTS_FAILED - $$LAST_FAILED"); \
-               printf "+%d/+%d\n" $$DIFF_PASSED $$DIFF_FAILED; \
-       fi;
-
-$(TEST_REPORT): $(BUILD_REPORT)
-       cd $(BUILD_DIR) && \
-       make test TESTS=../$(BRANCH_DIR)/$(TESTS) > ../$@
-
-$(BUILD_REPORT): $(CONFIG_REPORT)
-       cd $(BUILD_DIR) && \
-       make -j $(CPUS) > ../$@
-       
-$(CONFIG_REPORT): $(BRANCH_DIR)/configure $(BUILD_DIR)
-       cd $(BUILD_DIR) && \
-       ../$(BRANCH_DIR)/configure -C $(CONFIGURE) > ../$@
-
-$(BUILD_DIR):
-       mkdir -p $@
-       
-$(BRANCH_DIR)/configure: $(CONFIGS)
-       cd $(BRANCH_DIR) && \
-       phpize > /dev/null
-
-# vim: set noet
diff --git a/lib/btr/php.mk b/lib/btr/php.mk
deleted file mode 100644 (file)
index 84327d3..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-.PHONY: all
-.SUFFIXES:
-
-CONFIGS=$(wildcard $(BRANCH_DIR)/ext/*/config*.m4)
-
-all: $(TEST_REPORT)
-       TESTS_PASSED=$$(awk '/^Tests passed/{print $$4}' < $(TEST_REPORT)); \
-       TESTS_FAILED=$$(awk '/^Tests failed/{print $$4}' < $(TEST_REPORT)); \
-       if test -z "$(LAST_REPORT)"; then \
-               printf "%d/%d\n" $$TESTS_PASSED $$TESTS_FAILED; \
-       else \
-               LAST_PASSED=$$(awk '/^Tests passed/{print $$4}' < $(LAST_REPORT)); \
-               LAST_FAILED=$$(awk '/^Tests failed/{print $$4}' < $(LAST_REPORT)); \
-               DIFF_PASSED=$$(bc <<<"$$TESTS_PASSED - $$LAST_PASSED"); \
-               DIFF_FAILED=$$(bc <<<"$$TESTS_FAILED - $$LAST_FAILED"); \
-               printf "+%d/+%d\n" $$DIFF_PASSED $$DIFF_FAILED; \
-       fi;
-
-$(TEST_REPORT): $(BUILD_REPORT)
-       cd $(BUILD_DIR) && \
-       make test TESTS=../$(BRANCH_DIR)/$(TESTS) > ../$@
-
-$(BUILD_REPORT): $(CONFIG_REPORT)
-       cd $(BUILD_DIR) && \
-       make -j $(CPUS) > ../$@
-       
-$(CONFIG_REPORT): $(BRANCH_DIR)/configure $(BUILD_DIR)
-       cd $(BUILD_DIR) && \
-       ../$(BRANCH_DIR)/configure -C $(CONFIGURE) > ../$@
-
-$(BUILD_DIR):
-       mkdir -p $@
-       
-$(BRANCH_DIR)/configure: $(BRANCH_DIR)/buildconf $(CONFIGS)
-       cd $(BRANCH_DIR) && \
-       ./buildconf > /dev/null
-
-# vim: set noet
diff --git a/lib/btr/report/mail.mk b/lib/btr/report/mail.mk
new file mode 100644 (file)
index 0000000..37b8a6c
--- /dev/null
@@ -0,0 +1,10 @@
+.PHONY: all
+.SUFFIXES:
+
+all: 
+       MESSAGE=$$(printf "\nbtr %s %s\n\n-- \nbtr mail report\n" "$(BUILD)" "$(REPORT)"); \
+       mail -s "[btr] $(BUILD) $(REPORT)" \
+               -a $(CONFIG_REPORT) -a $(BUILD_REPORT) -a $(TEST_REPORT) \
+               $(USER) <<<"$$MESSAGE"
+
+# vim: set noet
diff --git a/lib/btr/source/git.mk b/lib/btr/source/git.mk
new file mode 100644 (file)
index 0000000..6ca93a9
--- /dev/null
@@ -0,0 +1,18 @@
+.PHONY: pull all
+.SUFFIXES:
+
+all: $(BRANCH_DIR) pull
+       cd $(BRANCH_DIR) && \
+       git pull -q
+
+pull: $(CLEAN_DIR)
+       cd $(CLEAN_DIR) && \
+       git pull -q
+
+$(CLEAN_DIR):
+       git clone $(SOURCE_URL) $(CLEAN_DIR)
+
+$(BRANCH_DIR): $(CLEAN_DIR)
+       git-new-workdir $(CLEAN_DIR) $(BRANCH_DIR) $(BRANCH)
+
+# vim: set noet
diff --git a/lib/btr/source/svn.mk b/lib/btr/source/svn.mk
new file mode 100644 (file)
index 0000000..49d94c4
--- /dev/null
@@ -0,0 +1,11 @@
+.PHONY: all
+.SUFFIXES:
+
+all: $(BRANCH_DIR)
+       cd $(BRANCH_DIR) && \
+       svn update -q
+
+$(BRANCH_DIR):
+       svn checkout $(SOURCE_URL)/$(BRANCH) $(BRANCH_DIR)
+
+# vim: set noet
diff --git a/lib/btr/svn.mk b/lib/btr/svn.mk
deleted file mode 100644 (file)
index 49d94c4..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-.PHONY: all
-.SUFFIXES:
-
-all: $(BRANCH_DIR)
-       cd $(BRANCH_DIR) && \
-       svn update -q
-
-$(BRANCH_DIR):
-       svn checkout $(SOURCE_URL)/$(BRANCH) $(BRANCH_DIR)
-
-# vim: set noet