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
+
+}
}
git_commit() {
+ . $BASEDIR/tools/make-check && check_sanity
+
git commit $*
[ "$?" -eq "0" ] || exiterror "git commit $* failed."
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
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
} # 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
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()
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
umask 022
# Set LFS Directory
- LFS=$BASEDIR/build_${MACHINE}/ipfire
+ LFS=$BASEDIR/build_${MACHINE}/${SNAME}
# Check /tools symlink
if [ -h $TOOLS_DIR ]; then
echo ""
echo "... and all this hard work for this:"
- du -bsh $BASEDIR/${SNAME}-${VERSION}.${MACHINE}.iso
+ ls -sh $BASEDIR/${SNAME}-${VERSION}.${MACHINE}.iso
}