From 5853025137e64411d7be745a55936ec3e8868212 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 24 Oct 2011 13:49:14 -0500 Subject: Add more logging to download code This adds a logger to the CURLE_OK case so we can always know the return code if it was >= 400, and debug log it regardless. Also adjust another logger to use the cURL error message directly, as well as use fstat() when we have an open file handle rather than stat(). Signed-off-by: Dan McGee --- lib/libalpm/dload.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index cd2857c3..9d919b0a 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -392,8 +392,15 @@ static int curl_download_internal(struct dload_payload *payload, case CURLE_OK: /* get http/ftp response code */ curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &respcode); + _alpm_log(handle, ALPM_LOG_DEBUG, "response code: %ld\n", respcode); if(respcode >= 400) { payload->unlink_on_fail = 1; + /* non-translated message is same as libcurl */ + snprintf(error_buffer, sizeof(error_buffer), + "The requested URL returned error: %ld", respcode); + _alpm_log(handle, ALPM_LOG_ERROR, + _("failed retrieving file '%s' from %s : %s\n"), + payload->remote_name, hostname, error_buffer); goto cleanup; } break; @@ -402,15 +409,16 @@ static int curl_download_internal(struct dload_payload *payload, if(dload_interrupted == ABORT_OVER_MAXFILESIZE) { payload->curlerr = CURLE_FILESIZE_EXCEEDED; handle->pm_errno = ALPM_ERR_LIBCURL; - /* the hardcoded 'size exceeded' message is same as libcurl's normal */ + /* use the 'size exceeded' message from libcurl */ _alpm_log(handle, ALPM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"), - payload->remote_name, hostname, "Maximum file size exceeded"); + payload->remote_name, hostname, + curl_easy_strerror(CURLE_FILESIZE_EXCEEDED)); } goto cleanup; default: /* delete zero length downloads */ - if(stat(payload->tempfile_name, &st) == 0 && st.st_size == 0) { + if(fstat(fileno(localf), &st) == 0 && st.st_size == 0) { payload->unlink_on_fail = 1; } if(!payload->errors_ok) { -- cgit v1.2.3-70-g09d2 From 0d9e7da309f27c099814232d0f1be1b2ae884b2a Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 22 Oct 2011 17:22:08 +1000 Subject: Update libtool files Update for libtool-2.4.2 while keeping the fix for --as-needed from commit b0f9477f. Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- ltmain.sh | 76 ++++++++++++++++++++++++++++++++++----------------------- m4/ltversion.m4 | 10 ++++---- 2 files changed, 51 insertions(+), 35 deletions(-) mode change 100755 => 100644 ltmain.sh diff --git a/ltmain.sh b/ltmain.sh old mode 100755 new mode 100644 index 4e98c79a..fafd01b2 --- a/ltmain.sh +++ b/ltmain.sh @@ -1,9 +1,9 @@ -# libtool (GNU libtool) 2.4 +# libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -41,6 +41,7 @@ # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) +# --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages @@ -69,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4 +# $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # @@ -79,9 +80,9 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4 +VERSION=2.4.2 TIMESTAMP="" -package_revision=1.3293 +package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -136,15 +137,10 @@ progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${EGREP="grep -E"} -: ${FGREP="grep -F"} -: ${GREP="grep"} -: ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} @@ -387,7 +383,7 @@ case $progpath in ;; *) save_IFS="$IFS" - IFS=: + IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break @@ -771,8 +767,8 @@ func_help () s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } @@ -1052,6 +1048,7 @@ opt_finish=false opt_help=false opt_help_all=false opt_silent=: +opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false @@ -1118,6 +1115,10 @@ esac ;; --no-silent|--no-quiet) opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) @@ -2059,7 +2060,7 @@ func_mode_compile () *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -3201,11 +3202,13 @@ func_mode_install () # Set up the ranlib parameters. oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. @@ -3470,7 +3473,7 @@ static const void *lt_preloaded_setup() { # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; @@ -5060,9 +5063,15 @@ void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' - + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' cat <<"EOF" } EOF @@ -5646,7 +5655,8 @@ func_mode_link () continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -6164,7 +6174,8 @@ func_mode_link () fi continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" @@ -6848,7 +6859,7 @@ func_mode_link () test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" + add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -7333,6 +7344,7 @@ func_mode_link () # which has an extra 1 added just for fun # case $version_type in + # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result @@ -7449,7 +7461,7 @@ func_mode_link () versuffix="$major.$revision" ;; - linux) + linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" @@ -8037,6 +8049,11 @@ EOF # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= @@ -8067,7 +8084,7 @@ EOF elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) func_apped perm_rpath " $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi done @@ -8075,11 +8092,7 @@ EOF if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. @@ -9169,6 +9182,8 @@ EOF esac done fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" @@ -9278,7 +9293,8 @@ EOF *.la) func_basename "$deplib" name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 index 9c7b5d41..07a8602d 100644 --- a/m4/ltversion.m4 +++ b/m4/ltversion.m4 @@ -9,15 +9,15 @@ # @configure_input@ -# serial 3293 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4]) -m4_define([LT_PACKAGE_REVISION], [1.3293]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4' -macro_revision='1.3293' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) -- cgit v1.2.3-70-g09d2 From 571f2f78141a5c13aaf90cfbfe99c04af8158e4e Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 22 Oct 2011 18:29:05 +1000 Subject: Fix libtool detection of --as-needed flag The fix for -Wl,--as-needed in commit b0f9477f assumes that --as-needed/--no-as-needed is the only option given in a -Wl line. However, it is perfectly valid to specify multiple flags comma separated after a single -Wl (e.g. the default LDFLAGS in Arch Linux makepkg.conf). Adjust the fix so it detect --as-needed in a more general context > readelf -d lib/libalpm/.libs/libalpm.so.?.?.? | grep NEEDED | wc -l Before: 13 After: 5 Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- ltmain.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ltmain.sh b/ltmain.sh index fafd01b2..5f505e27 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -5800,9 +5800,12 @@ func_mode_link () arg=$func_stripname_result ;; - -Wl,--as-needed|-Wl,--no-as-needed) - deplibs="$deplibs $arg" - continue + -Wl,*--as-needed*) + deplibs="$deplibs $wl--as-needed" + ;; + + -Wl,*--no-as-needed*) + deplibs="$deplibs $wl--no-as-needed" ;; -Wl,*) -- cgit v1.2.3-70-g09d2 From 2da59e1aa91fa4160ec1c8ec84d94d8141b2a832 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 18 Oct 2011 10:46:47 -0400 Subject: lib/sync: inform callers of compute_download_size of a partial Extend the return values of compute_download_size to allow callers to know that a .part file exists for the package. This extra value isn't currently used, but it'll be needed later on. Signed-off-by: Dave Reisner Signed-off-by: Dan McGee --- lib/libalpm/sync.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 08d634d6..54b9794a 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -288,6 +288,7 @@ static int compute_download_size(alpm_pkg_t *newpkg) char *fpath, *fnamepart = NULL; off_t size = 0; alpm_handle_t *handle = newpkg->handle; + int ret = 0; if(newpkg->origin != PKG_FROM_SYNCDB) { newpkg->infolevel |= INFRQ_DSIZE; @@ -316,6 +317,9 @@ static int compute_download_size(alpm_pkg_t *newpkg) size = newpkg->size - st.st_size; size = size < 0 ? 0 : size; } + + /* tell the caller that we have a partial */ + ret = 1; } else if(handle->usedelta) { off_t dltsize; @@ -345,7 +349,7 @@ finish: FREE(fpath); FREE(fnamepart); - return 0; + return ret; } int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) @@ -606,7 +610,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) for(i = trans->add; i; i = i->next) { /* update download size field */ alpm_pkg_t *spkg = i->data; - if(compute_download_size(spkg) != 0) { + if(compute_download_size(spkg) < 0) { ret = -1; goto cleanup; } -- cgit v1.2.3-70-g09d2