[dpkg] 66/200: libdpkg: Add virtual source:Upstream-Version field
Ximin Luo
infinity0 at debian.org
Wed Apr 5 15:17:17 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository dpkg.
commit 94b53bdeaf3249d140bc7bae07b5e304b769a1c0
Author: Guillem Jover <guillem at debian.org>
Date: Fri Dec 9 10:36:57 2016 +0100
libdpkg: Add virtual source:Upstream-Version field
Closes: #844348
---
debian/changelog | 1 +
lib/dpkg/pkg-format.c | 14 ++++++++++++++
man/dpkg-query.man | 4 ++++
3 files changed, 19 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 3f51ec4..e32c184 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,7 @@ dpkg (1.18.16) UNRELEASED; urgency=medium
install stuff but are reminded they need to get a fixed filesystem in
place. This has affected at least ecryptfs in the past and now
file-based encryption support in ext4 on Android N.
+ * Add new dpkg-query virtual field source:Upstream-Version. Closes: #84434
* Perl modules:
- Whitelist DPKG_GENSYMBOLS_CHECK_LEVEL, DPKG_ROOT, DPKG_ADMINDIR and
DPKG_DATADIR environment variables in Dpkg::Build::Info.
diff --git a/lib/dpkg/pkg-format.c b/lib/dpkg/pkg-format.c
index 9f3b924..40344a8 100644
--- a/lib/dpkg/pkg-format.c
+++ b/lib/dpkg/pkg-format.c
@@ -306,6 +306,19 @@ virt_source_version(struct varbuf *vb,
varbuf_add_source_version(vb, pkg, pkgbin);
}
+static void
+virt_source_upstream_version(struct varbuf *vb,
+ const struct pkginfo *pkg, const struct pkgbin *pkgbin,
+ enum fwriteflags flags, const struct fieldinfo *fip)
+{
+ struct dpkg_version version;
+
+ pkg_source_version(&version, pkg, pkgbin);
+
+ varbuf_add_str(vb, version.version);
+ varbuf_end_str(vb);
+}
+
static const struct fieldinfo virtinfos[] = {
{ FIELD("binary:Package"), NULL, virt_package },
{ FIELD("binary:Summary"), NULL, virt_summary },
@@ -315,6 +328,7 @@ static const struct fieldinfo virtinfos[] = {
{ FIELD("db:Status-Eflag"), NULL, virt_status_eflag },
{ FIELD("source:Package"), NULL, virt_source_package },
{ FIELD("source:Version"), NULL, virt_source_version },
+ { FIELD("source:Upstream-Version"), NULL, virt_source_upstream_version },
{ NULL },
};
diff --git a/man/dpkg-query.man b/man/dpkg-query.man
index 45d4c1f..a7e7a5f 100644
--- a/man/dpkg-query.man
+++ b/man/dpkg-query.man
@@ -276,6 +276,10 @@ It contains the source package name for this binary package
.B source:Version
It contains the source package version for this binary package
(since dpkg 1.16.2)
+.TP
+.B source:Upstream-Version
+It contains the source package upstream version for this binary package
+(since dpkg 1.18.16)
.RE
.IP
The default format string is “\fB${binary:Package}\et${Version}\en\fP”.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list