pkgCache *Cache = CacheFile.GetPkgCache();
if (unlikely(Cache == NULL))
return false;
+ pkgDepCache *depCache = CacheFile.GetDepCache();
+ if (unlikely(depCache == NULL))
+ return false;
// Find an appropriate file
pkgCache::VerFileIterator Vf = V.FileList();
else
package_size = _("unknown");
+ pkgDepCache::StateCache &state = (*depCache)[V.ParentPkg()];
+ bool is_installed = V.ParentPkg().CurrentVer() == V;
+ const char *manual_installed;
+ if (is_installed)
+ manual_installed = !(state.Flags & pkgCache::Flag::Auto) ? "yes" : "no";
+ else
+ manual_installed = 0;
std::string suite = GetArchiveSuite(CacheFile, V);
TFRewriteData RW[] = {
{"Conffiles",0},
{"Installed-Size", installed_size.c_str(), 0},
{"Size", package_size.c_str(), "Download-Size"},
{"Archive-Origin", suite.c_str(), 0},
+ {"Manual-Installed", manual_installed, 0},
{}
};
+
if(TFRewrite(stdout, Tags, NULL, RW) == false)
return _error->Error("Internal Error, Unable to parse a package record");
DESCR='Some description
That has multiple lines'
insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR"
+insertinstalledpackage 'foo' 'all' '1.0'
setupaptarchive
APTARCHIVE=$(readlink -f ./aptarchive)
# note that we do not display Description-md5 with the "apt" cmd
+# and also show some additional fields that are calculated
testequal "Package: foo
Priority: optional
Section: other
Version: 1.0
Filename: pool/main/foo/foo_1.0_all.deb
Download-Size: unknown
-Archive-Origin: unstable
+Archive-Origin: unstable,now
+Manual-Installed: yes
Description: Some description
That has multiple lines
" apt show foo