Permalink
Browse files

Merge branch 'master' into stable

  • Loading branch information...
2 parents f79d9e5 + 7a386e7 commit 0f0cda4e0eb93d8c066c4450d0c26602debc5dd8 @sofar sofar committed Feb 12, 2012
View
@@ -103,9 +103,13 @@ main() {
# this runs as a background process, so we are off to step #3 right away
if [ -z "$DEPS_ONLY" ] ; then
verbose_msg "Spawning download manager"
- for M in $MODULES ; do
- LIST="$(for D in `find_depends $M`; do if ! module_installed $D ; then echo $D ; fi ; done | uniq) $LIST"
- done
+
+ # this code hurts more than it helps - it can stall forever (minutes)
+ # even when just linning 2-3 modules
+ # for M in $MODULES ; do
+ # LIST="$(for D in `find_depends $M`; do if ! module_installed $D ; then echo $D ; fi ; done | uniq) $LIST"
+ # done
+
verbose_msg "download queue: $LIST $MODULES"
for M in $LIST $MODULES; do
THIS_TEMP=$(temp_create "$M.download.log")
@@ -187,7 +187,7 @@ default_config() {
--infodir=$MODULE_PREFIX/share/info \
--mandir=$MODULE_PREFIX/share/man \
$OPTS
-} > $C_FIFO 2>&1
+}
default_game_config() {
@@ -202,7 +202,7 @@ default_game_config() {
--infodir=$MODULE_PREFIX/share/info \
--mandir=$MODULE_PREFIX/share/man \
$OPTS
-} > $C_FIFO 2>&1
+}
default_cvs_config() {
@@ -217,7 +217,7 @@ default_cvs_config() {
--infodir=$MODULE_PREFIX/share/info \
--mandir=$MODULE_PREFIX/share/man \
$OPTS
-} > $C_FIFO 2>&1
+}
default_cmake_config() {
@@ -230,46 +230,47 @@ default_cmake_config() {
cmake -DCMAKE_INSTALL_PREFIX=$MODULE_PREFIX \
-DCMAKE_BUILD_TYPE=RELEASE \
$OPTS $SOURCE_DIRECTORY
-} > $C_FIFO 2>&1
+}
default_make() {
debug_msg "default_make ($@)"
verbose_msg "running \"default_make\""
- make &&
+ make ${MAKES:+-j${MAKES}} &&
prepare_install &&
make install
-} > $C_FIFO 2>&1
+}
default_game_build() {
debug_msg "default_game_build ($@)"
verbose_msg "running \"default_game_build\""
default_game_config &&
default_make
-} > $C_FIFO 2>&1
+}
default_cmake_build() {
debug_msg "default_cmake_build ($@)"
verbose_msg "running \"default_cmake_build\""
default_cmake_config &&
default_make
-} > $C_FIFO 2>&1
+}
+
default_build() {
debug_msg "default_build ($@)"
verbose_msg "running \"default_build\""
default_config &&
default_make
-} > $C_FIFO 2>&1
+}
default_cvs_build() {
debug_msg "default_cvs_build ($@)"
default_cvs_config &&
default_make
-} > $C_FIFO 2>&1
+}
default_cpan_pre_build() {
@@ -300,7 +301,7 @@ default_cpan_build() {
install $CPAN_MODULE
quit" | /usr/bin/cpan || exit 1
rm_source_dir $SOURCE_DIRECTORY
-} > $C_FIFO 2>&1
+}
default_post_build() {
@@ -409,12 +410,15 @@ run_build() {
if [[ "${USE_WRAPPERS:-yes}" == "yes" ]]; then
export PATH=/var/lib/lunar/compilers:$PATH
fi
- if has_module_file $MODULE BUILD ; then
- run_module_file $MODULE BUILD
- else
- default_build
- fi
-
+ (
+ # fix errors, don't avoid them. This makes all errors fatal
+ shopt -s execfail
+ if has_module_file $MODULE BUILD ; then
+ run_module_file $MODULE BUILD
+ else
+ default_build
+ fi
+ ) > $C_FIFO 2>&1
}
@@ -39,15 +39,7 @@ download_url() {
verbose_msg "trying to download \"${2}\" from \"${1}\""
connect &&
plugin_call SOURCE_DOWNLOAD $1 $2 $3
- RETVAL=$?
- if [ $RETVAL == 2 ]; then
- # refuse to continue - it's useless to have the user attempt to
- # download cvs/svn etc snapshots from the cache URLs
- error_message "${PROBLEM_COLOR}I don't know how to download ${QUERY_COLOR}\"$1\".${DEFAULT_COLOR}"
- error_message "${MESSAGE_COLOR}Install the package that provides the method and plugin to download it.${DEFAULT_COLOR}"
- exit 1
- fi
- return $RETVAL
+ return $?
}
@@ -120,6 +112,8 @@ download_module() {
add_url $FRESORT_URL
for URL in $URLS ; do
add_url $URL
+ done
+ for URL in $URLS ; do
if [ "$EXHAUSTIVE" != "on" ]; then
continue
fi
@@ -142,17 +136,20 @@ download_module() {
for URL in $ALL_URLS; do
# and download
- if download_url $URL $SRC $SOURCE_CACHE ; then
+ if download_url $URL $SRC $SOURCE_CACHE == 0 ; then
# done for this file!
- FAILED=1
+ SUCCESS=1
break
fi
done
- if [ ${FAILED:-0} == 0 ] ; then
+ if [ ${SUCCESS:-0} == 0 ] ; then
FAILALL=1
+ error_message "${PROBLEM_COLOR}I don't know how to download ${QUERY_COLOR}\"$1\".${DEFAULT_COLOR}"
+ error_message "${MESSAGE_COLOR}Install the package that provides the method and plugin to download it.${DEFAULT_COLOR}"
fi
done
+
return ${FAILALL:-0}
)
}
@@ -36,11 +36,60 @@ stop_logging() {
}
+progress() {
+ local OLDLOG OLDSZ S PC
+ OLDLOG=$(ls -1d $COMPILE_LOGS/$MODULE-*.bz2 2>&- | head -n 1)
+ if [[ -f $OLDLOG ]]; then
+ X="############################################################"
+ Y=" "
+ OLDSZ=$(bzcat $OLDLOG | wc -c)
+ while true ; do
+ read -t 2 LINE
+ STATUS=$?
+ if [ $STATUS -gt 128 ]; then
+ sleep 2
+ continue
+ elif [ $STATUS -eq 1 ]; then
+ echo -ne "\r [${X:0:60}] (100%)\n"
+ exit
+ fi
+ (( S += ${#LINE} ))
+ if [[ $S -gt OLDSZ ]]; then
+ # never print 100% - subtract 1 :)
+ S=$((OLDSZ - 1))
+ fi
+ PC=$((S * 100 / OLDSZ))
+ L=$((S * 60 / OLDSZ))
+ echo -ne "\r [${X:0:$L}${Y:0:$((60 - L))}] ($PC%)\r"
+ done
+ else
+ SPINNER="/-\|"
+ # spinerrrrrr!!!!
+ while true ; do
+ read -t 2 LINE
+ STATUS=$?
+ if [ $STATUS -gt 128 ]; then
+ sleep 2
+ continue
+ elif [ $STATUS -eq 1 ]; then
+ exit
+ fi
+ ((C++))
+ if [[ $C -gt ${#SPINNER} ]]; then
+ C=0
+ fi
+ echo -en "\r [${SPINNER:$C:1}]\r"
+ done
+ fi
+}
+
+
activate_voyeur() {
debug_msg "activate_voyeur ($@)"
if [ -z "$SILENT" ] ; then
case $VOYEUR in
on) tee -a $C_LOG < $C_FIFO & ;;
+ p*) tee -a $C_LOG < $C_FIFO | progress & ;;
*) tee -a $C_LOG < $C_FIFO >/dev/null & ;;
esac
else
@@ -67,14 +67,14 @@ plugin_source_download_generic() {
verbose_msg "download of \"$2\" successful"
else
rm -f $TMP_FILE
- return 1
+ return 2
fi
else
# don't report errors against cache misses
if [ "$URL" != "$LRESORT_URL/" ]; then
activity_log "lget" "$MODULE" "$VERSION" "failed" "broken URL: \"$URL$2\""
fi
- return 1
+ return 2
fi
}
View
@@ -1,26 +1,34 @@
-^/bin/awk
-^/bin/basename
-^/bin/bash
-^/bin/cat
-^/bin/chmod
-^/bin/cp
-^/bin/cut
-^/bin/date
-^/bin/grep
-^/bin/login
-^/bin/mkdir
-^/bin/mknod
-^/bin/mv
-^/bin/rm
-^/bin/rmdir
-^/bin/sed
-^/bin/sleep
-^/bin/sh
-^/bin/su
-^/bin/sort
-^/bin/tail
-^/bin/tr
-^/bin/uname
+bin/awk
+bin/basename
+bin/bash
+bin/cat
+bin/chmod
+bin/cp
+bin/cut
+bin/date
+bin/dirname
+bin/file
+bin/grep
+bin/install
+bin/login
+bin/make
+bin/md5sum
+bin/mkdir
+bin/mknod
+bin/mv
+bin/ranlib
+bin/rm
+bin/rmdir
+bin/sed
+bin/sh
+bin/sha1sum
+bin/sleep
+bin/sort
+bin/su
+bin/tail
+bin/tee
+bin/tr
+bin/uname
^/boot/
^/boot/grub/menu.1st
^/etc/aliases
@@ -100,14 +108,6 @@
^/lib/ld-linux-x86-64.so.2
^/lib/modules/
/perllocal.pod$
-^/usr/bin/dirname
-^/usr/bin/file
-^/usr/bin/install
-^/usr/bin/make
-^/usr/bin/md5sum
-^/usr/bin/ranlib
-^/usr/bin/sha1sum
-^/usr/bin/tee
^/usr/include/bits/syscall.h
^/usr/include/gnu/stubs.h
^/usr/lib/installwatch.so

0 comments on commit 0f0cda4

Please sign in to comment.