]> git.saurik.com Git - apt.git/commitdiff
show progress info while 'downloading' a local .deb file
authorDavid Kalnischkies <david@kalnischkies.de>
Sun, 11 Oct 2015 21:05:47 +0000 (23:05 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Wed, 4 Nov 2015 17:04:00 +0000 (18:04 +0100)
Showing just "Get: [1234 B]" looks very strange, so we now print the
filename and as usual the package name, version and architecture.

apt-pkg/deb/debindexfile.cc
apt-pkg/deb/debindexfile.h
apt-pkg/indexfile.cc

index 32ccd75291fe212503d114e04958a3ef3d5f678a..793882e67a6d6d827e091517c4160fbafba49a5a 100644 (file)
@@ -249,7 +249,14 @@ pkgCache::PkgFileIterator debDebPkgFileIndex::FindInCache(pkgCache &Cache) const
 
    return File;
 }
-
+std::string debDebPkgFileIndex::ArchiveInfo_impl(pkgCache::VerIterator const &Ver) const
+{
+   std::string Res = IndexFileName() + " ";
+   Res.append(Ver.ParentPkg().Name()).append(" ");
+   Res.append(Ver.Arch()).append(" ");
+   Res.append(Ver.VerStr());
+   return Res;
+}
                                                                        /*}}}*/
 // DscFile Index - a single .dsc file as an index                      /*{{{*/
 debDscFileIndex::debDscFileIndex(std::string const &DscFile)
index 5bec4f2ea8b96ca66c0f1e48a1e8b6311c57a854..e96a4761eed6430f7906393465a70afadeb7b4d5 100644 (file)
@@ -144,6 +144,9 @@ public:
 
    debDebPkgFileIndex(std::string const &DebFile);
    virtual ~debDebPkgFileIndex();
+
+   //FIXME: use proper virtual-handling on next ABI break
+   APT_HIDDEN std::string ArchiveInfo_impl(pkgCache::VerIterator const &Ver) const;
 };
 
 class debDscFileIndex : public pkgDebianIndexRealFile
index f57b442a3205f2a5fc017901225a6fa0f6f2983a..34ebcb2b8bf8703d8f8731e722488319de687170 100644 (file)
 #include <apt-pkg/srcrecords.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/progress.h>
+#include <apt-pkg/deblistparser.h>
 #include <apt-pkg/macros.h>
 
-#include <apt-pkg/deblistparser.h>
+#include <apt-pkg/debindexfile.h>
 
 #include <sys/stat.h>
 
@@ -66,8 +67,11 @@ pkgIndexFile::pkgIndexFile(bool const Trusted) :                     /*{{{*/
 }
                                                                        /*}}}*/
 // IndexFile::ArchiveInfo - Stub                                       /*{{{*/
-std::string pkgIndexFile::ArchiveInfo(pkgCache::VerIterator const &/*Ver*/) const
+std::string pkgIndexFile::ArchiveInfo(pkgCache::VerIterator const &Ver) const
 {
+   debDebPkgFileIndex const * const debfile = dynamic_cast<debDebPkgFileIndex const*>(this);
+   if (debfile != nullptr)
+      return debfile->ArchiveInfo_impl(Ver);
    return std::string();
 }
                                                                        /*}}}*/