From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74185 invoked by alias); 28 Dec 2019 12:43:11 -0000 Mailing-List: contact cygwin-apps-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-apps-cvs-owner@sourceware.org Received: (qmail 74131 invoked by uid 9795); 28 Dec 2019 12:43:10 -0000 Date: Sat, 28 Dec 2019 12:43:00 -0000 Message-ID: <20191228124310.74116.qmail@sourceware.org> From: jturney@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [setup - the official Cygwin setup program] branch master, updated. release_2.898 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: dbd295e75edfadd5fc6feebe11b482cd672575cf X-Git-Newrev: 45d605870a01b9097c16f7d1bfc7b041fe61fb90 X-SW-Source: 2019-q4/txt/msg00002.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=45d605870a01b9097c16f7d1bfc7b041fe61fb90 commit 45d605870a01b9097c16f7d1bfc7b041fe61fb90 Author: Jon Turney Date: Fri Dec 20 14:22:27 2019 +0000 Generate a pseudo-package with the Windows version Generate a pseudo-package with the Windows version, so packages can have a requires with a version relation upon it. Diff: --- package_db.cc | 26 ++++++++++++++++++++++++++ package_db.h | 1 + 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/package_db.cc b/package_db.cc index 847f44e..5498ec0 100644 --- a/package_db.cc +++ b/package_db.cc @@ -23,6 +23,7 @@ #include #include #include +#include #if HAVE_ERRNO_H #include #endif @@ -232,6 +233,30 @@ packagedb::makeBase() /* We don't register this in packagemeta */ } +/* Create the fictitious windows package */ +void +packagedb::makeWindows() +{ + std::stringstream v; + v << OSMajorVersion() << "." << OSMinorVersion() << "." << OSBuildNumber(); + + SolverPool::addPackageData data; + data.reponame = "_installed"; + data.version = v.str(); + data.type = package_binary; + data.vendor = "cygwin"; + data.sdesc = "Ficitious package indicating Windows version"; + data.ldesc = "Ficitious package indicating Windows version"; + data.requires = NULL; + data.obsoletes = NULL; + data.provides = NULL; + data.conflicts = NULL; + data.stability = TRUST_CURR; + + solver.addPackage("_windows", data); + /* We don't register this in packagemeta */ +} + /* Add a package version to the packagedb */ packagemeta * packagedb::addBinary (const std::string &pkgname, @@ -735,6 +760,7 @@ packagedb::prep() return; makeBase(); + makeWindows(); read(); upgrade(); fixup_source_package_ids(); diff --git a/package_db.h b/package_db.h index da73171..3886bf2 100644 --- a/package_db.h +++ b/package_db.h @@ -100,6 +100,7 @@ public: private: void makeBase(); + void makeWindows(); void read(); void upgrade (); void fixup_source_package_ids();