From 95f45727964767f11534eb5347af3fc3a8a6e020 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 8 Aug 2007 19:28:43 +0200 Subject: * apt-pkg/acquire-worker.cc: - only pass a hash if we actually got one from the method * methods/copy.cc: - take hashes here too (*sigh*) --- apt-pkg/acquire-worker.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 460f59961..739c9e32c 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -273,7 +273,9 @@ bool pkgAcquire::Worker::RunMessages() if(!expectedHash.empty()) { string hashTag = expectedHash.HashType()+"-Hash"; - RecivedHash = expectedHash.HashType() + ":" + LookupTag(Message, hashTag.c_str()); + string hashSum = LookupTag(Message, hashTag.c_str()); + if(!hashSum.empty()) + RecivedHash = expectedHash.HashType() + ":" + hashSum; if(_config->FindB("Debug::pkgAcquire::Auth", false) == true) { clog << "201 URI Done: " << Owner->DescURI() << endl -- cgit v1.2.3 From bc36c37bdbcdda5fe4f641abbc5514d5f5c5e2a4 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 2 Oct 2007 09:19:20 -0300 Subject: * Fix compilation warnings: - apt-pkg/indexfile.cc: conversion from string constant to 'char*'; --- apt-pkg/indexfile.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index cf238eb4a..b38596143 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -113,8 +113,8 @@ string pkgIndexFile::LanguageCode() // we have a mapping of the language codes that contains all the language // codes that need the country code as well // (like pt_BR, pt_PT, sv_SE, zh_*, en_*) - char *need_full_langcode[] = { "pt","sv","zh","en", NULL }; - for(char **s = need_full_langcode;*s != NULL; s++) + const char *need_full_langcode[] = { "pt","sv","zh","en", NULL }; + for(const char **s = need_full_langcode;*s != NULL; s++) if(lang.find(*s) == 0) return lang.substr(0,5); -- cgit v1.2.3 From 1450dbaaadb7f863c8d1191a10ef542b2809db03 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 2 Oct 2007 09:21:58 -0300 Subject: - apt-pkg/acquire-item.cc: likewise; --- apt-pkg/acquire-item.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index a6d01e3bb..9c51184e6 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -704,7 +704,7 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash, Local = true; string compExt = Desc.URI.substr(Desc.URI.size()-3); - char *decompProg; + const char *decompProg; if(compExt == "bz2") decompProg = "bzip2"; else if(compExt == ".gz") -- cgit v1.2.3 From 9504f6f95ba38205551275f94069799ce8683657 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 2 Oct 2007 09:25:37 -0300 Subject: - apt-pkg/cdrom.cc: '%lu' expects 'long unsigned int', but argument has type 'size_t'; --- apt-pkg/cdrom.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 96106c7a9..b8f94e5b0 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -668,8 +668,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log) DropRepeats(TransList,""); if(log) { msg.str(""); - ioprintf(msg, _("Found %lu package indexes, %lu source indexes, " - "%lu translation indexes and %lu signatures\n"), + ioprintf(msg, _("Found %u package indexes, %u source indexes, " + "%u translation indexes and %u signatures\n"), List.size(), SourceList.size(), TransList.size(), SigList.size()); log->Update(msg.str(), STEP_SCAN); -- cgit v1.2.3 From 71afbdb50df4058a56ed567f03c9a82f5f9d130e Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 2 Oct 2007 09:33:32 -0300 Subject: - apt-pkg/deb/dpkgpm.cc: initialization order and conversion from string constant to 'char*'; --- apt-pkg/deb/dpkgpm.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index b92d0118c..92f96620f 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -44,8 +44,8 @@ using namespace std; // --------------------------------------------------------------------- /* */ pkgDPkgPM::pkgDPkgPM(pkgDepCache *Cache) - : pkgPackageManager(Cache), dpkgbuf_pos(0), PackagesDone(0), - PackagesTotal(0), term_out(NULL) + : pkgPackageManager(Cache), dpkgbuf_pos(0), + term_out(NULL), PackagesDone(0), PackagesTotal(0) { } /*}}}*/ @@ -770,7 +770,7 @@ bool pkgDPkgPM::Go(int OutStatusFd) /* No Job Control Stop Env is a magic dpkg var that prevents it from using sigstop */ - putenv("DPKG_NO_TSTP=yes"); + putenv((char *)"DPKG_NO_TSTP=yes"); execvp(Args[0],(char **)Args); cerr << "Could not exec dpkg!" << endl; _exit(100); -- cgit v1.2.3 From a491fe600cdcf28ee9515d4fde02345be93a0f9c Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 2 Oct 2007 09:46:44 -0300 Subject: - apt-pkg/deb/debmetaindex.cc: comparison with string literal results in unspecified behaviour; --- apt-pkg/deb/debmetaindex.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 94995798f..9ac659f78 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -224,7 +224,7 @@ class debSLTypeDebian : public pkgSourceList::Type // This check insures that there will be only one Release file // queued for all the Packages files and Sources files it // corresponds to. - if ((*I)->GetType() == "deb") + if (strcmp((*I)->GetType(), "deb") == 0) { debReleaseIndex *Deb = (debReleaseIndex *) (*I); // This check insures that there will be only one Release file -- cgit v1.2.3