From: Michael Tremer Date: Thu, 10 Apr 2008 14:16:34 +0000 (+0200) Subject: Was working on our buildscripts. X-Git-Tag: v3.0-alpha1~1047 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ce0b818fe0c1069d761805e878ecfb7b41cda52;p=ipfire-3.x.git Was working on our buildscripts. 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. --- diff --git a/tools/make-check b/tools/make-check index 4653d780d..d9f8f76fb 100644 --- a/tools/make-check +++ b/tools/make-check @@ -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 + +} diff --git a/tools/make-git b/tools/make-git index c88a78336..11ef6f0ad 100644 --- a/tools/make-git +++ b/tools/make-git @@ -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 diff --git a/tools/make-include b/tools/make-include index 0615d1966..6abbb3a54 100644 --- a/tools/make-include +++ b/tools/make-include @@ -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 } diff --git a/tools/make-interactive b/tools/make-interactive index fcee343f8..fe0a83bcd 100644 --- a/tools/make-interactive +++ b/tools/make-interactive @@ -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