X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=tools%2Fmake-functions;h=00d7d337cd6eab53c2274b270e9c483106176672;hp=36df4c1ce53de3db2a8c91ac5952d0b7a20c54fb;hb=b261d116ad00b9479892d0d957863bcad2f62db3;hpb=5b2a12ff8ad39591a5a57a0f2122edc2934f5ec3 diff --git a/tools/make-functions b/tools/make-functions index 36df4c1ce5..00d7d337cd 100644 --- a/tools/make-functions +++ b/tools/make-functions @@ -1,9 +1,28 @@ #!/bin/bash -############################################################################ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### +############################################################################### # # Beautifying variables & presentation & input output interface # -############################################################################ +############################################################################### ## Screen Dimentions # Find current screen size @@ -123,7 +142,13 @@ beautify() ;; build_end) BUILD_TIME_END=`date +%s` - echo -ne "${DONE}***Build is finished now and took $[ $BUILD_TIME_END - $BUILD_TIME_START ] secs!${NORMAL}\n" + seconds=$[ $BUILD_TIME_END - $BUILD_TIME_START ] + hours=$((seconds / 3600)) + seconds=$((seconds % 3600)) + minutes=$((seconds / 60)) + seconds=$((seconds % 60)) + + echo -ne "${DONE}***Build is finished now and took $hours hour(s) $minutes minute(s) $seconds second(s)!${NORMAL}\n" ;; make_pkg) echo "$2" | while read PKG_VER PROGRAM OPTIONS @@ -372,6 +397,7 @@ ipfiremake() { TERM=$TERM PS1='\u:\w\$ ' \ PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \ VERSION=$VERSION \ + CORE=$CORE \ CONFIG_ROOT=$CONFIG_ROOT \ NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \ CFLAGS="$C2FLAGS" CXXFLAGS="$CXX2FLAGS" \ @@ -467,19 +493,20 @@ batch_script() { if [ "$IPFIRE_REBUILD" -eq "0" ]; then export IPFIRE_START_TIME=`date` + + $0 clean evaluate 1 - echo "### RUNNING SVN-UPDATE" - $0 svn update - evaluate 1 mail_me SVNUPDATE + $0 git update --force + evaluate 1 mail_me UPDATE echo "### EXPORT SOURCES" - $0 svn dist - evaluate 1 mail_me SVNDIST + $0 git dist + evaluate 1 mail_me DIST fi echo "### RUNNING BUILD" - $0 build --devel + $0 build evaluate 1 mail_me ERROR echo "### UPLOADING ISO" @@ -487,7 +514,6 @@ batch_script() { evaluate 1 mail_me ISO echo -ne "### UPLOADING PAKS" - $0 packages sign $0 upload paks evaluate 1 mail_me PAKS @@ -503,13 +529,13 @@ watch_screen() { } mail_me() { - chmod 755 tools/sendEmail - ATTACHMENT=/tmp/ipfire-build-logs-R$SVN_REVISION.tar.gz + echo "From: $MAIL_FROM" > /tmp/ipfire_mail_body.$$ + echo "To: $MAIL_TO" >> /tmp/ipfire_mail_body.$$ case "$1" in success) - SUBJECT="SUCCESS: IPFIRE-BUILD R$SVN_REVISION on `hostname`" - cat < /tmp/ipfire_mail_body -Building IPFire on `hostname` in Revision $SVN_REVISION was successfull! + cat <> /tmp/ipfire_mail_body.$$ +Subject: SUCCESS: IPFIRE-BUILD on `hostname` +Building IPFire on `hostname` was successfull! You can find the ISO on your ftp server if you told the script where it is. Statistics: @@ -524,8 +550,8 @@ END echo -ne "${BOLD}***Sending success message${NORMAL}" ;; *) - SUBJECT="ERROR $1: IPFIRE-BUILD R$SVN_REVISION on `hostname`" - cat < /tmp/ipfire_mail_body + cat <> /tmp/ipfire_mail_body.$$ +Subject: ERROR $1: IPFIRE-BUILD on `hostname` When I was building IPFire on `hostname`, I have found an ERROR with name $1! Here you can see the logs and detect the reason for this error. @@ -541,22 +567,15 @@ END echo -ne "${BOLD}***Sending error message${NORMAL}" ;; esac - tar cfz $ATTACHMENT log/_build* - cat /tmp/ipfire_mail_body | tools/sendEmail -q \ - -f $MAIL_USER \ - -t $MAIL_TO \ - -u $SUBJECT \ - -s $MAIL_SERVER:25 \ - -xu $MAIL_USER \ - -xp $MAIL_PASS \ - -l log/_build.mail.log \ - -a $ATTACHMENT # -v + +sleep 15 + python tools/sendEmail < /tmp/ipfire_mail_body.$$ if [ "$?" -eq "0" ]; then beautify message DONE else beautify message FAIL fi - rm -f /tmp/ipfire_mail_body $ATTACHMENT + rm -f /tmp/ipfire_mail_body.$$ } make_config() { @@ -627,6 +646,8 @@ make_config() { echo -ne "You should enter a mail server to login...\n" echo -ne "Please type the url: " read MAIL_SERVER + echo -ne "Please type where the email is from: " + read MAIL_FROM echo -ne "Please type the username: " read MAIL_USER echo -ne "Please type the password (hidden): " @@ -647,6 +668,7 @@ FTP_CACHE_USER=$FTP_CACHE_USER FTP_CACHE_PASS=$FTP_CACHE_PASS ### mail reports MAIL_TO="$MAIL_TO" +MAIL_FROM=$MAIL_FROM MAIL_SERVER=$MAIL_SERVER MAIL_USER=$MAIL_USER MAIL_PASS=$MAIL_PASS @@ -710,35 +732,3 @@ update_langs() { $BASEDIR/tools/check_langs.sh > $BASEDIR/doc/language_missings beautify message DONE } - -sign_packages() { - if gpg --list-key 64D96617 ; then - if [ -d "$BASEDIR/packages" ]; then - cd $BASEDIR/packages - for i in `ls $BASEDIR/packages/*.ipfire`; do - echo -n "Signing $i" - echo $GPG_PASSPHRASE | gpg --compress-algo 3 --sign --armor -u 64D96617 --passphrase-fd 0 $i - if [ "$?" -eq "0" ]; then - beautify message DONE - mv -f $i.asc $i - else - beautify message FAIL - fi - done - for i in `ls $BASEDIR/packages/meta-*`; do - echo -n "Signing $i" - echo $GPG_PASSPHRASE | gpg --clearsign --armor -u 64D96617 --passphrase-fd 0 $i - if [ "$?" -eq "0" ]; then - beautify message DONE - mv -f $i.asc $i - else - beautify message FAIL - fi - done - cd - - fi - else - echo -n "You don't have the secret key to sign ipfire's packages!" - beautify message FAIL - fi -}