diff options
-rw-r--r-- | doc/Makefile.am | 4 | ||||
-rw-r--r-- | etc/makepkg.conf.in | 2 | ||||
-rw-r--r-- | lib/libalpm/dload.c | 32 | ||||
-rw-r--r-- | scripts/makepkg.sh.in | 4 |
4 files changed, 22 insertions, 20 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am index 4703b63a..6261d926 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -84,12 +84,12 @@ ASCIIDOC_OPTS = \ -a pacman_version="$(REAL_PACKAGE_VERSION)" \ -a pacman_date="`date +%Y-%m-%d`" \ -a sysconfdir=$(sysconfdir) + A2X_OPTS = \ --no-xmllint \ -d manpage \ -f manpage \ - --xsltproc-opts='-param man.endnotes.list.enabled 0' \ - --xsltproc-opts='-param man.endnotes.are.numbered 0' + --xsltproc-opts='-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0' # These rules are due to the includes and files of the asciidoc text $(ASCIIDOC_MANS): asciidoc.conf footer.txt diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index 1368ff1f..3a3a4154 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -26,7 +26,7 @@ DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3 -O %o %u' CARCH="@CARCH@" CHOST="@CHOST@" -#-- Exclusive: will only run on @CARCHFLAGS@ +#-- Exclusive: will only run on @CARCH@ # -march (or -mcpu) builds exclusively for an architecture # -mtune optimizes for an architecture, but builds for whole processor family CFLAGS="@CARCHFLAGS@-mtune=generic -O2 -pipe" diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 57c21b8e..a06cb462 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -124,6 +124,10 @@ static int download_internal(const char *url, const char *localpath, destfile = get_destfile(localpath, filename); tempfile = get_tempfile(localpath, filename); + if(mtimeold) { + fileurl->last_modified = mtimeold; + } + /* pass the raw filename for passing to the callback function */ _alpm_log(PM_LOG_DEBUG, "using '%s' for download progress\n", filename); @@ -157,7 +161,13 @@ static int download_internal(const char *url, const char *localpath, sigaction(SIGPIPE, NULL, &old_action); sigaction(SIGPIPE, &new_action, NULL); - dlf = fetchXGet(fileurl, &ust, (handle->nopassiveftp ? "" : "p")); + dlf = fetchXGet(fileurl, &ust, (handle->nopassiveftp ? "i" : "pi")); + + if(fetchLastErrCode == FETCH_UNCHANGED) { + _alpm_log(PM_LOG_DEBUG, "mtimes are identical, skipping %s\n", filename); + ret = 1; + goto cleanup; + } if(fetchLastErrCode != 0 || dlf == NULL) { const char *host = _("disk"); @@ -173,12 +183,6 @@ static int download_internal(const char *url, const char *localpath, _alpm_log(PM_LOG_DEBUG, "connected to %s successfully\n", fileurl->host); } - if(ust.mtime && mtimeold && ust.mtime == mtimeold) { - _alpm_log(PM_LOG_DEBUG, "mtimes are identical, skipping %s\n", filename); - ret = 1; - goto cleanup; - } - if(ust.mtime && mtimenew) { *mtimenew = ust.mtime; } @@ -210,14 +214,12 @@ static int download_internal(const char *url, const char *localpath, while((nread = fetchIO_read(dlf, buffer, PM_DLBUF_LEN)) > 0) { size_t nwritten = 0; - while(nwritten < nread) { - nwritten += fwrite(buffer, 1, (nread - nwritten), localf); - if(ferror(localf)) { - _alpm_log(PM_LOG_ERROR, _("error writing to file '%s': %s\n"), - destfile, strerror(errno)); - ret = -1; - goto cleanup; - } + nwritten = fwrite(buffer, 1, nread, localf); + if((nwritten != nread) || ferror(localf)) { + _alpm_log(PM_LOG_ERROR, _("error writing to file '%s': %s\n"), + destfile, strerror(errno)); + ret = -1; + goto cleanup; } dl_thisfile += nread; diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index c8384f80..daa95856 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -354,7 +354,7 @@ check_deps() { fi } -handledeps() { +handle_deps() { local R_DEPS_SATISFIED=0 local R_DEPS_MISSING=1 @@ -402,7 +402,7 @@ resolve_deps() { return $R_DEPS_SATISFIED fi - if handledeps $deplist; then + if handle_deps $deplist; then pkgdeps="$pkgdeps $deplist" # check deps again to make sure they were resolved deplist="$(check_deps $*)" |