]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - make.sh
core117: Ship latest updates of syslogging
[ipfire-2.x.git] / make.sh
diff --git a/make.sh b/make.sh
index de2d9aeadea1b07c1b646bb7baed5e1caa61e636..5f619d30b392b383eef0f545638de632390f8d14 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -52,27 +52,33 @@ else
        INTERACTIVE=false
 fi
 
-## Screen Dimentions
-# Find current screen size
-if [ -z "${COLUMNS}" ]; then
-       COLUMNS=$(stty size)
-       COLUMNS=${COLUMNS##* }
-fi
+# Sets or adjusts pretty formatting variables
+resize_terminal() {
+       ## Screen Dimentions
+       # Find current screen size
+       COLUMNS=$(tput cols)
+
+       # When using remote connections, such as a serial port, stty size returns 0
+       if ! ${INTERACTIVE} || [ "${COLUMNS}" = "0" ]; then
+               COLUMNS=80
+       fi
 
-# When using remote connections, such as a serial port, stty size returns 0
-if ! ${INTERACTIVE} || [ "${COLUMNS}" = "0" ]; then
-       COLUMNS=80
-fi
+       # Measurements for positioning result messages
+       OPTIONS_WIDTH=20
+       TIME_WIDTH=12
+       STATUS_WIDTH=8
+       NAME_WIDTH=$(( COLUMNS - OPTIONS_WIDTH - TIME_WIDTH - STATUS_WIDTH ))
+       LINE_WIDTH=$(( COLUMNS - STATUS_WIDTH ))
 
-## Measurements for positioning result messages
-OPTIONS_WIDTH=20
-TIME_WIDTH=12
-STATUS_WIDTH=8
-NAME_WIDTH=$(( COLUMNS - OPTIONS_WIDTH - TIME_WIDTH - STATUS_WIDTH ))
-LINE_WIDTH=$(( COLUMNS - STATUS_WIDTH ))
+       TIME_COL=$(( NAME_WIDTH + OPTIONS_WIDTH ))
+       STATUS_COL=$(( TIME_COL + TIME_WIDTH ))
+}
 
-TIME_COL=$(( COLUMNS - TIME_WIDTH - STATUS_WIDTH ))
-STATUS_COL=$(( COLUMNS - STATUS_WIDTH ))
+# Initially setup terminal
+resize_terminal
+
+# Call resize_terminal when terminal is being resized
+trap "resize_terminal" WINCH
 
 # Define color for messages
 BOLD="\\033[1;39m"
@@ -316,12 +322,7 @@ print_package() {
        fi
 
        printf "%-$(( ${NAME_WIDTH} - 1 ))s " "${string}"
-
-       if [ -n "${options}" ]; then
-               printf "[ %-$(( ${OPTIONS_WIDTH} - 4 ))s ]" "${options}"
-       else
-               printf "%${OPTIONS_WIDTH}s" ""
-       fi
+       printf "%$(( ${OPTIONS_WIDTH} - 1 ))s " "${options}"
 }
 
 print_runtime() {
@@ -369,7 +370,7 @@ exiterror() {
        done
 
        # Dump logfile
-       if [ -n "${LOGFILE}" ]; then
+       if [ -n "${LOGFILE}" ] && [ -e "${LOGFILE}" ]; then
                echo # empty line
 
                local line
@@ -567,6 +568,7 @@ lfsmakecommoncheck() {
        if grep "^SUP_ARCH" ${BASEDIR}/lfs/${1} >/dev/null; then
                # Check if package supports ${BUILD_ARCH} or all architectures.
                if ! grep -E "^SUP_ARCH.*${BUILD_ARCH}|^SUP_ARCH.*all" ${BASEDIR}/lfs/${1} >/dev/null; then
+                       print_runtime 0
                        print_status SKIP
                        return 1
                fi
@@ -1336,7 +1338,6 @@ buildipfire() {
   lfsmake2 etherwake
   lfsmake2 bwm-ng
   lfsmake2 sysstat
-  lfsmake2 vsftpd
   lfsmake2 strongswan
   lfsmake2 rng-tools
   lfsmake2 lsof
@@ -1430,7 +1431,6 @@ buildipfire() {
   lfsmake2 usb_modeswitch
   lfsmake2 usb_modeswitch_data
   lfsmake2 zerofree
-  lfsmake2 pound
   lfsmake2 minicom
   lfsmake2 ddrescue
   lfsmake2 miniupnpd
@@ -1487,7 +1487,6 @@ buildipfire() {
   lfsmake2 iptraf-ng
   lfsmake2 iotop
   lfsmake2 stunnel
-  lfsmake2 sslscan
   lfsmake2 owncloud
   lfsmake2 bacula
   lfsmake2 batctl
@@ -1536,7 +1535,7 @@ buildpackages() {
 
   
   # Generating list of packages used
-  echo -n "Generating packages list from logs" | tee -a $LOGFILE
+  print_line "Generating packages list from logs"
   rm -f $BASEDIR/doc/packages-list
   for i in `ls -1tr $BASEDIR/log/[^_]*`; do
        if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
@@ -1587,19 +1586,6 @@ buildpackages() {
   stdumount
   rm -rf $BASEDIR/build/tmp/*
 
-  # Generating total list of files
-  echo -n "Generating files list from logs" | tee -a $LOGFILE
-  rm -f $BASEDIR/log/FILES
-  for i in `ls -1tr $BASEDIR/log/[^_]*`; do
-       if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
-               echo "##" >>$BASEDIR/log/FILES
-               echo "## `basename $i`" >>$BASEDIR/log/FILES
-               echo "##" >>$BASEDIR/log/FILES
-               cat $i | sed "s%^\./%#%" | sort >> $BASEDIR/log/FILES
-       fi
-  done
-  print_status DONE
-
   cd $PWD
 }