source: git/sw.sh @ 3033f0

spielwiese
Last change on this file since 3033f0 was 3033f0, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
FIX: 'git show' - shows too much :( - use 'git log' instead
  • Property mode set to 100755
File size: 2.9 KB
Line 
1#!/bin/sh
2
3PWD=`pwd`
4BRANCH="spielwiese"
5CFGOPTIONS="--with-gmp=yes"
6MKOPTIONS="-j9"
7# tempdir (absolute path!)
8SW="$PWD/SW"
9
10# we try to use log instead of consequent --quiet
11LOG="$PWD/`date`.log"
12
13# log or no log?
14echo >> $LOG || LOG="/dev/null"
15
16echo "DATE: `date`" >> $LOG
17
18CleanUp() 
19{
20  echo "Deleting tempdir: $SW" >> $LOG
21  rm -f -R $SW 1>> $LOG 2>&1
22}
23
24Build()
25{
26  echo "Generating configure... " >> $LOG
27  ./for_Hans_with_love.sh 1>> $LOG 2>&1  || { echo "Error: cannot run 'for_Hans_with_love.sh'" >> $LOG; CleanUp; exit 1; } 
28 
29  [ -f ./configure ] || { echo "Error: cannot find './configure'" >> $LOG; return 1; } 
30
31  echo "Running './configure \"$CFGOPTIONS\" \"$@\"'... " >> $LOG
32  ./configure "$CFGOPTIONS" "$@" 1>> $LOG 2>&1  || { echo "Error: could not run './configure \"$CFGOPTIONS\" \"$@\"'" >> $LOG; return 1; } 
33
34  echo "Making... " >> $LOG
35  make "$MKOPTIONS" 1>> $LOG 2>&1  || { echo "Error: could not run 'make \"$MKOPTIONS\"'"5 >> $LOG; return 1; } 
36}
37
38Check()
39{
40  echo "Checking... " >> $LOG
41  make -k -i check 1>> $LOG 2>&1
42
43  echo "Test Result: $?" >> $LOG
44
45  [ -x libpolys/tests ] && { echo "The content of the test directory: " >> $LOG; ls -la libpolys/tests 1>> $LOG 2>&1; }
46}
47
48
49Reset()
50{
51  echo "git reset/clean to the untouched state... " >> $LOG
52  git reset --hard HEAD 1>> $LOG 2>&1 || echo "Error: could not git reset to HEAD..." >> $LOG 
53  git clean -f -d -x 1>> $LOG 2>&1 || echo "Error: could not git clean..." >> $LOG 
54
55##  #should be VERY clean now...
56##  git status -uall  >> $LOG
57}
58
59
60echo "Creating empty tempdir: $SW" >> $LOG
61[ -d $SW ] && { echo "Error: $SW exists... cleaning up..." >> $LOG; CleanUp; }
62
63mkdir -p $SW || { echo "Error: cannot create tempdir: $SW" >> $LOG;  exit 1; }
64
65[ -d $SW ] || { echo "Error: cannot find tempdir '$SW'" >> $LOG; CleanUp; exit 1; } 
66[ ! -x $SW ] && { chmod u+rwx $SW 1>> $LOG 2>&1 || { echo "Error: cannot set rxw permissions for $SW" >> $LOG;  exit 1; }; }
67
68echo "Clonning... " >> $LOG
69git clone -v -b $BRANCH --depth 1 -- git://git.berlios.de/singular $SW 1>> $LOG 2>&1 || { echo "Error: cannot git clone..." >> $LOG; CleanUp; exit 1; } 
70
71cd $SW  || { echo "Error: cannot cd to the tempdir: $SW" >> $LOG; CleanUp; exit 1; } 
72
73# latest commit?
74git log -1 HEAD >> $LOG 
75
76[ -x ./for_Hans_with_love.sh ] || { echo "Error: cannot find './for_Hans_with_love.sh '" >> $LOG; CleanUp; exit 1; } 
77
78
79# test two cases dynamic & static:
80#  --enable-p-procs-static Enable statically compiled p_Procs-modules
81#  --enable-p-procs-dynamic Enable dynamically compiled p_Procs-modules
82
83echo "Trying static version... " >> $LOG
84Build "--enable-p-procs-static" || { echo "Error: could not build with '--enable-p-procs-static'" >> $LOG; } && Check
85
86# return git repo to the untouched state:
87Reset
88
89echo "Trying dynamic version... " >> $LOG
90Build "--enable-p-procs-dynamic" || { echo "Error: could not build with '--enable-p-procs-dynamic'" >> $LOG; } && Check
91
92cd - || { CleanUp; exit 1; } 
93
94CleanUp && exit 0 || exit 1
Note: See TracBrowser for help on using the repository browser.