]> git.saurik.com Git - apt.git/commitdiff
Merge remote-tracking branch 'donkult/debian/sid' into debian/sid
authorMichael Vogt <mvo@debian.org>
Fri, 31 Jan 2014 07:23:23 +0000 (08:23 +0100)
committerMichael Vogt <mvo@debian.org>
Fri, 31 Jan 2014 07:23:23 +0000 (08:23 +0100)
apt-private/private-output.cc
cmdline/apt-get.cc
test/integration/test-apt-get-download
test/integration/test-apt-sources-deb822

index a8bbad9e590c8de9195eafce8dea64fdc3b19b20..e9b8037daa7d718747945af7ce29e57a0165c260 100644 (file)
@@ -68,8 +68,10 @@ std::string GetArchiveSuite(pkgCacheFile &CacheFile, pkgCache::VerIterator ver)
       pkgCache::VerFileIterator VF = ver.FileList();
       for (; VF.end() == false ; ++VF)
       {
-         // XXX: how to figure out the relevant suite? if its in multiple ones?
-         suite = suite + "," + VF.File().Archive();
+         if(VF.File() == NULL || VF.File().Archive() == NULL)
+            suite = suite + "," + _("unknown");
+         else
+            suite = suite + "," + VF.File().Archive();
          //suite = VF.File().Archive();
       }
       suite = suite.erase(0, 1);
index da7d28a1e9ba8044b1760ae32701b69d43ff7148..6bff6e7de5963d6097e976c2250f2a68b08aefb1 100644 (file)
@@ -678,14 +678,17 @@ bool DoDownload(CommandLine &CmdL)
 
    // copy files in local sources to the current directory
    for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); ++I)
-      if ((*I)->Local == true && (*I)->Status == pkgAcquire::Item::StatDone)
+   {
+      std::string const filename = cwd + flNotDir((*I)->DestFile);
+      if ((*I)->Local == true &&
+          filename != (*I)->DestFile &&
+          (*I)->Status == pkgAcquire::Item::StatDone)
       {
-        std::string const filename = cwd + flNotDir((*I)->DestFile);
         std::ifstream src((*I)->DestFile.c_str(), std::ios::binary);
         std::ofstream dst(filename.c_str(), std::ios::binary);
         dst << src.rdbuf();
       }
-
+   }
    return Failed == false;
 }
                                                                        /*}}}*/
index fce0be01853b3fe37a7f1cb6720ca39aaa244bda..c2a5c3d8eb263aae1fa46a17ecece5a844027612 100755 (executable)
@@ -24,6 +24,7 @@ testdownload() {
        rm $1
 }
 
+# normal case(es)
 testdownload apt_1.0_all.deb apt stable
 testdownload apt_2.0_all.deb apt
 
@@ -32,3 +33,9 @@ testequal "'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) SHA512:$(sh
 
 # deb:677887
 testequal "E: Can't find a source to download version '1.0' of 'vrms:i386'" aptget download vrms
+
+# deb:736962 - apt-get download foo && 
+aptget download apt
+aptget download apt
+testsuccess test -s apt_2.0_all.deb
+rm -f apt_1.0_all.deb
index 87f1886eaf5a174371f7b28f7cc271d9e5164a82..5f54b75315dfc5b68826681c7a83ea938e17d366 100755 (executable)
@@ -99,3 +99,14 @@ testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/source/Source
 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 "  aptget update --print-uris 
+
+# a Suite
+msgtest 'Test deb822 sources.list file which has' 'a exact path and no sections'
+cat > $SOURCES <<EOF
+Types: deb
+URIs: http://emacs.naquadah.org
+Suites: stable/
+EOF
+testequal --nomsg "'http://emacs.naquadah.org/stable/Packages.bz2' emacs.naquadah.org_stable_Packages 0 :
+'http://emacs.naquadah.org/stable/en.bz2' emacs.naquadah.org_stable_en 0 :
+'http://emacs.naquadah.org/stable/InRelease' emacs.naquadah.org_stable_InRelease 0 "  aptget update --print-uris