[pacman-dev] [PATCH 1/2] dload: remove unnecessary cast in alpm_load_payload_free
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- lib/libalpm/dload.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index ac47e94..689fe6e 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -490,8 +490,6 @@ char SYMEXPORT *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url) } void _alpm_dload_payload_free(struct dload_payload *payload) { - struct dload_payload *load = (struct dload_payload *)payload; - ASSERT(load, return); FREE(load->fileurl); -- 1.7.6
This prevents possible null dereferences in FTP transfers when the progress callback is touched during connection teardown. http://curl.haxx.se/mail/lib-2011-08/0128.html Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- This makes me unhappy. lib/libalpm/dload.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 689fe6e..e655a13 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -302,6 +302,9 @@ static int curl_download_internal(struct dload_payload *payload, /* perform transfer */ handle->curlerr = curl_easy_perform(handle->curl); + /* immediately unhook the progress callback */ + curl_easy_setopt(handle->curl, CURLOPT_NOPROGRESS, 1L); + /* was it a success? */ if(handle->curlerr == CURLE_ABORTED_BY_CALLBACK) { goto cleanup; -- 1.7.6
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- Needs to be applied after Dan's recursive sync work as I've declared this as a passing test. test/pacman/tests/sync302.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 deletions(-) create mode 100644 test/pacman/tests/sync302.py diff --git a/test/pacman/tests/sync302.py b/test/pacman/tests/sync302.py new file mode 100644 index 0000000..be31d54 --- /dev/null +++ b/test/pacman/tests/sync302.py @@ -0,0 +1,42 @@ +self.description = "Sysupgrade : pacman needs to be upgraded and has updated deps" + +sp = pmpkg("pacman", "1.0-2") +sp.depends = ["glibc", "curl", "libarchive"] +self.addpkg2db("sync", sp) + +libcdep = pmpkg("glibc", "2.15-1") +self.addpkg2db("sync", libcdep) + +curldep = pmpkg("curl", "7.22-1") +self.addpkg2db("sync", curldep) + +zdep = pmpkg("libarchive", "2.8.5-1") +self.addpkg2db("sync", zdep) + + +lp = pmpkg("pacman", "1.0-1") +self.addpkg2db("local", lp) + +lp1 = pmpkg("curl", "7.21.7-1") +self.addpkg2db("local", lp1) + +lp2 = pmpkg("glibc", "2.13-1") +self.addpkg2db("local", lp2) + +lp3 = pmpkg("libarchive", "2.8.4-1") +self.addpkg2db("local", lp3) + + +self.option["SyncFirst"] = ["pacman"] + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_EXIST=pacman") +self.addrule("PKG_VERSION=pacman|1.0-2") +self.addrule("PKG_EXIST=glibc") +self.addrule("PKG_VERSION=glibc|2.15-1") +self.addrule("PKG_EXIST=curl") +self.addrule("PKG_VERSION=curl|7.22-1") +self.addrule("PKG_EXIST=libarchive") +self.addrule("PKG_VERSION=libarchive|2.8.5-1") -- 1.7.6
On Thu, Aug 11, 2011 at 8:04 AM, Dave Reisner <d@falconindy.com> wrote:
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- Needs to be applied after Dan's recursive sync work as I've declared this as a passing test.
test/pacman/tests/sync302.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 deletions(-) create mode 100644 test/pacman/tests/sync302.py
diff --git a/test/pacman/tests/sync302.py b/test/pacman/tests/sync302.py new file mode 100644 index 0000000..be31d54 --- /dev/null +++ b/test/pacman/tests/sync302.py @@ -0,0 +1,42 @@ +self.description = "Sysupgrade : pacman needs to be upgraded and has updated deps" + +sp = pmpkg("pacman", "1.0-2") +sp.depends = ["glibc", "curl", "libarchive"] This simplifies the situation a bit. It would be best to test the recursive nature and model the deps more like pactree shows:
|--pacman-git |--glibc |--libarchive |--zlib |--glibc |--curl |--zlib So glibc is nested beneath zlib which is below both curl and libarchive. Important to test is that glibc *still* gets upgraded even if no update to zlib is available (local version==repo version).
+self.addpkg2db("sync", sp) + +libcdep = pmpkg("glibc", "2.15-1") +self.addpkg2db("sync", libcdep) + +curldep = pmpkg("curl", "7.22-1") +self.addpkg2db("sync", curldep) + +zdep = pmpkg("libarchive", "2.8.5-1") +self.addpkg2db("sync", zdep) + + +lp = pmpkg("pacman", "1.0-1") +self.addpkg2db("local", lp) + +lp1 = pmpkg("curl", "7.21.7-1") +self.addpkg2db("local", lp1) + +lp2 = pmpkg("glibc", "2.13-1") +self.addpkg2db("local", lp2) + +lp3 = pmpkg("libarchive", "2.8.4-1") +self.addpkg2db("local", lp3) + + +self.option["SyncFirst"] = ["pacman"] + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_EXIST=pacman") +self.addrule("PKG_VERSION=pacman|1.0-2") +self.addrule("PKG_EXIST=glibc") +self.addrule("PKG_VERSION=glibc|2.15-1") +self.addrule("PKG_EXIST=curl") +self.addrule("PKG_VERSION=curl|7.22-1") +self.addrule("PKG_EXIST=libarchive") +self.addrule("PKG_VERSION=libarchive|2.8.5-1") -- 1.7.6
participants (2)
-
Dan McGee
-
Dave Reisner