]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
Was working on our buildscripts.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Apr 2008 14:16:34 +0000 (16:16 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Apr 2008 14:16:34 +0000 (16:16 +0200)
We don't show the version field if there cannot be a version.
We also have a very small sanity check that examines the rootfiles
for valid entries, only.
At last, we check if we have some required tools for building the
distro.

tools/make-check
tools/make-git
tools/make-include
tools/make-interactive

index 4653d780d1bf8ded65eff697343de149c149bc2c..d9f8f76fbf3bd4ad832eee046baca409613ea455 100644 (file)
@@ -80,3 +80,30 @@ check_build() {
        check_common "ncftp Client"                                             "echo \"quit\" | ncftp --version | head -n1"
        check_common "GNU which"                                                        "which --version | head -n1"
 }
+
+check_rootfiles() {
+
+       if grep -n ^/ $BASEDIR/src/rootfiles/*/*; then
+               exiterror "Please check your rootfiles! There are trailing slashes."
+       fi
+
+       if grep -n ^+ $BASEDIR/src/rootfiles/*/*; then
+               exiterror "Please check your rootfiles for trailing pluses."
+       fi
+
+       if grep -n ^$ $BASEDIR/src/rootfiles/*/*; then
+               exiterror "Please check your rootfiles for empty lines."
+       fi
+
+}
+
+
+check_sanity() {
+
+       echo -ne "Checking sanity of working directory..."
+
+       check_rootfiles
+
+       beautify message DONE
+
+}
index c88a7833642c4951e7fe0e66053e5fa17078d34d..11ef6f0ad97536ecda03d48cc61457bf156caac1 100644 (file)
@@ -56,6 +56,8 @@ git_push() {
 }
 
 git_commit() {
+       . $BASEDIR/tools/make-check && check_sanity
+
        git commit $*
        
        [ "$?" -eq "0" ] || exiterror "git commit $* failed."
@@ -72,7 +74,9 @@ git_commit() {
        exiterror "\"$REPLY\" is not a valid answer."
 }
 
-git_diff(){
+git_diff() {
+       . $BASEDIR/tools/make-check && check_sanity
+
        echo -ne "Make a local diff to last revision"
        git diff HEAD > ipfire-diff-$(date +'%Y-%m-%d-%H:%M').diff
        evaluate 1
index 0615d1966589b9dff6a4f6749b8143e20c6aa2be..6abbb3a546f8f4fab4705978936d4028c933faa1 100644 (file)
@@ -253,12 +253,15 @@ beautify()
                        do
                                SET_VER_COL_REAL=`position_cursor $TIME_COL $PKG_VER -3`
 
-                               if [ "$OPTIONS" == "" ]; then
-                                       echo -ne "${PROGRAM}${SET_VER_COL}[ ${BOLD}${SET_VER_COL_REAL}${PKG_VER}"
-                                       echo -ne "${NORMAL} ]${SET_RESULT_COL}"
+                               echo -ne "${PROGRAM}"
+                               if ! [ "$OPTIONS" == "" ]; then
+                                       echo -ne "${SET_OPT_COL}[ ${BOLD}${OPTIONS}${NORMAL} ]"
+                               fi
+
+                               if [ "${PKG_VER}" == "${SNAME}" ] || [ "${PKG_VER}" == "LFS" ]; then
+                                       echo -ne "${SET_RESULT_COL}"
                                else
-                                       echo -ne "${PROGRAM}${SET_OPT_COL}[ ${BOLD}${OPTIONS}"
-                                       echo -ne "${NORMAL} ]${SET_VER_COL}[ ${BOLD}${SET_VER_COL_REAL}${PKG_VER}"
+                                       echo -ne "${SET_VER_COL}[ ${BOLD}${SET_VER_COL_REAL}${PKG_VER}"
                                        echo -ne "${NORMAL} ]${SET_RESULT_COL}"
                                fi
                        done
@@ -315,7 +318,7 @@ get_pkg_ver()
 } # End of get_pkg_ver()
 
 stdumount() {
-       sleep 1 # Wait one second for finish of processes
+       sleep 0.3 # Wait one second for finish of processes
        for fs in `mount | grep $BASEDIR/build_${MACHINE} | awk '{print $3}'`; do
                umount $fs #2>/dev/null;
        done
@@ -323,15 +326,11 @@ stdumount() {
 
 exiterror() {
        stdumount
-       for i in `seq 0 7`; do
-           if ( losetup /dev/loop${i} 2>/dev/null | grep -q "/install/images" ); then
-               losetup -d /dev/loop${i} 2>/dev/null
-           fi;
-       done
        
        beautify message FAIL
  
        echo -ne "${FAIL}ERROR${NORMAL}: ${BOLD}$*${NORMAL}\n"
+       [ -z "$LOGFILE" ] || \
        echo "       Check $LOGFILE for errors if applicable"
        exit 1
 } # End of exiterror()
@@ -539,7 +538,7 @@ prepareenv() {
        export LOGFILE
        mkdir -p $BASEDIR/log_${MACHINE}/01_toolchain 2>/dev/null
        mkdir -p $BASEDIR/log_${MACHINE}/02_base 2>/dev/null
-       mkdir -p $BASEDIR/log_${MACHINE}/03_ipfire 2>/dev/null
+       mkdir -p $BASEDIR/log_${MACHINE}/03_${SNAME} 2>/dev/null
        mkdir -p $BASEDIR/log_${MACHINE}/04_misc 2>/dev/null
        mkdir -p $BASEDIR/log_${MACHINE}/05_installer 2>/dev/null
        mkdir -p $BASEDIR/log_${MACHINE}/06_packages 2>/dev/null
@@ -623,7 +622,7 @@ prepareenv() {
        umask 022
 
        # Set LFS Directory
-       LFS=$BASEDIR/build_${MACHINE}/ipfire
+       LFS=$BASEDIR/build_${MACHINE}/${SNAME}
        
        # Check /tools symlink
        if [ -h $TOOLS_DIR ]; then
@@ -753,5 +752,5 @@ build() {
        
        echo ""
        echo "... and all this hard work for this:"
-       du -bsh $BASEDIR/${SNAME}-${VERSION}.${MACHINE}.iso
+       ls -sh $BASEDIR/${SNAME}-${VERSION}.${MACHINE}.iso
 }
index fcee343f8adc6949e982fffd0e349d903d203574..fe0a83bcd8151b8d9d6c97f21a8eb6b4d7a43d98 100644 (file)
@@ -21,6 +21,8 @@
 
 case "$1" in
 build)
+       # check for prerequisites
+       . $BASEDIR/tools/make-check && check_build
        # compile the distro right now
        build
        # beeps when finished