Diff:
---
IniDBBuilderPackage.cc | 10 +-
IniDBBuilderPackage.h | 1 +
Makefile.am | 2 +
choose.cc | 36 ++++++-
choose.h | 2 -
choose_cli.cc | 248 +++++++++++++++++++++++++++++++++++++++++++++++++
choose_cli.h | 23 +++++
libsolv.cc | 46 +++++++++
libsolv.h | 4 +
package_db.cc | 3 +
package_meta.cc | 191 -------------------------------------
package_meta.h | 9 +-
res.pot | 8 +-
res/en/res.rc | 1 +
resource.h | 1 +
15 files changed, 380 insertions(+), 205 deletions(-)
diff --git a/IniDBBuilderPackage.cc b/IniDBBuilderPackage.cc
index 11edcd66..def9539a 100644
--- a/IniDBBuilderPackage.cc
+++ b/IniDBBuilderPackage.cc
@@ -119,6 +119,7 @@ IniDBBuilderPackage::buildPackage (const std::string& _name)
cbpv.obsoletes = NULL;
cbpv.provides = NULL;
cbpv.conflicts = NULL;
+ cbpv.build_depends = NULL;
cbpv.archive = packagesource();
currentSpec = NULL;
@@ -127,6 +128,7 @@ IniDBBuilderPackage::buildPackage (const std::string& _name)
obsoletesNodeList = PackageDepends();
providesNodeList = PackageDepends();
conflictsNodeList = PackageDepends();
+ buildDependsNodeList = PackageDepends();
#if DEBUG
Log (LOG_BABBLE) << "Created package " << name << endLog;
#endif
@@ -199,6 +201,8 @@ IniDBBuilderPackage::buildPackageSource (const std::string&
path,
/* create a source package version */
SolverPool::addPackageData cspv = cbpv;
cspv.type = package_source;
+ // erase dependency attributes only meaningful for an install package, but
+ // keep build_depends
cspv.requires = NULL;
cspv.obsoletes = NULL;
cspv.provides = NULL;
@@ -278,8 +282,9 @@ IniDBBuilderPackage::buildBeginBuildDepends ()
Log (LOG_BABBLE) << "Beginning of a Build-Depends statement" << endLog;
#endif
currentSpec = NULL;
- currentNodeList = NULL;
- /* there is currently nowhere to store Build-Depends information */
+ buildDependsNodeList = PackageDepends();
+ currentNodeList = &buildDependsNodeList;
+ cbpv.build_depends = &buildDependsNodeList;
}
void
@@ -432,4 +437,5 @@ IniDBBuilderPackage::process ()
obsoletesNodeList = PackageDepends();
providesNodeList = PackageDepends();
conflictsNodeList = PackageDepends();
+ buildDependsNodeList = PackageDepends();
}
diff --git a/IniDBBuilderPackage.h b/IniDBBuilderPackage.h
index 3e3a9e4b..2542dad5 100644
--- a/IniDBBuilderPackage.h
+++ b/IniDBBuilderPackage.h
@@ -85,6 +85,7 @@ private:
PackageDepends obsoletesNodeList;
PackageDepends providesNodeList;
PackageDepends conflictsNodeList;
+ PackageDepends buildDependsNodeList;
SolverPool::addPackageData cbpv;
std::set <std::string> replace_versions;
diff --git a/Makefile.am b/Makefile.am
index 4046d375..82b9d3a5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -138,6 +138,8 @@ endif
archive_tar_file.cc \
choose.cc \
choose.h \
+ choose_cli.cc \
+ choose_cli.h \
compactos.cc \
compactos.h \
compress.cc \
diff --git a/choose.cc b/choose.cc
index 8deab874..c7831d9e 100644
--- a/choose.cc
+++ b/choose.cc
@@ -41,6 +41,7 @@
#include "state.h"
#include "msg.h"
#include "LogSingleton.h"
+#include "LogFile.h"
#include "filemanip.h"
#include "io_stream.h"
#include "propsheet.h"
@@ -48,6 +49,7 @@
#include "package_db.h"
#include "package_meta.h"
+#include "choose_cli.h"
#include "threebar.h"
#include "Generic.h"
@@ -289,8 +291,8 @@ ChooserPage::applyCommandLinePackageSelection()
{
packagemeta &pkg = *(i->second);
packageversion wanted_version;
- bool wanted = pkg.isManuallyWanted(wanted_version);
- bool deleted = pkg.isManuallyDeleted();
+ bool wanted = isManuallyWanted(pkg, wanted_version);
+ bool deleted = isManuallyDeleted(pkg);
bool base = pkg.categories.find ("Base") != pkg.categories.end ();
bool orphaned = pkg.categories.find ("Orphaned") != pkg.categories.end
();
bool upgrade = wanted || (!pkg.installed && base);
@@ -311,6 +313,36 @@ ChooserPage::applyCommandLinePackageSelection()
else
pkg.set_action (packagemeta::NoChange_action, pkg.installed);
}
+
+ for (packagedb::packagecollection::iterator i = db.packages.begin ();
+ i != db.packages.end (); ++i)
+ {
+ // The 'build-depends' option can only specify source package names
+ // presently. (perhaps if name is not found, instead look for binary
+ // package and navigate to the corresponding source?)
+
+ packagemeta &pkg = *(i->second);
+ if (areBuildDependenciesWanted(pkg))
+ {
+ Log (LOG_BABBLE) << "Examining build-deps for package " << pkg.name
<< endLog;
+ PackageDepends bdp = pkg.curr.build_depends();
+ std::ostream & logger = Log (LOG_BABBLE);
+ logger << " build-depends=";
+ dumpPackageDepends(bdp, logger);
+ for (PackageDepends::const_iterator j = bdp.begin();
+ j != bdp.end();
+ j++)
+ {
+ Log (LOG_BABBLE) << "looking for " << (*j)->packageName() <<
endLog;
+ const packagedb::packagecollection::iterator n =
db.packages.find((*j)->packageName());
+ if (n != db.packages.end())
+ {
+ packagemeta &bd_pkg = *(n->second);
+ bd_pkg.set_action (packagemeta::Install_action,
packageversion ());
+ }
+ }
+ }
+ }
}
void
diff --git a/choose.h b/choose.h
index 1b295e96..fef905af 100644
--- a/choose.h
+++ b/choose.h
@@ -25,8 +25,6 @@
#define DEFAULT_TIMER_ID 5 //value doesn't matter, as long as it's unique
#define SEARCH_TIMER_DELAY 500 //in milliseconds
-extern bool hasManualSelections;
-
class ChooserPage:public PropertyPage
{
public:
diff --git a/choose_cli.cc b/choose_cli.cc
new file mode 100644
index 00000000..953cb6b5
--- /dev/null
+++ b/choose_cli.cc
@@ -0,0 +1,248 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * A copy of the GNU General Public License can be found at
+ * http://www.gnu.org/
+ *
+ */
+
+#include "choose_cli.h"
+
+#include "LogSingleton.h"
+#include "resource.h"
+#include "package_db.h"
+#include "package_meta.h"
+
+#include "getopt++/StringArrayOption.h"
+
+#include <set>
+
+static StringArrayOption DeletePackageOption ('x', "remove-packages",
IDS_HELPTEXT_REMOVE_PACKAGES);
+static StringArrayOption DeleteCategoryOption ('c', "remove-categories",
IDS_HELPTEXT_REMOVE_CATEGORIES);
+static StringArrayOption PackageOption ('P', "packages",
IDS_HELPTEXT_PACKAGES);
+static StringArrayOption CategoryOption ('C', "categories",
IDS_HELPTEXT_CATEGORIES);
+static StringArrayOption BuildDependsOption ('\0', "build-depends",
IDS_HELPTEXT_BUILD_DEPENDS);
+
+bool hasManualSelections = false;
+
+static void
+parseNames (std::set<std::string> &parsed, std::string &option)
+{
+ std::string tname;
+
+ /* Split up the packages listed in the option. */
+ std::string::size_type loc = option.find (",", 0);
+ while (loc != std::string::npos)
+ {
+ tname = option.substr (0, loc);
+ option = option.substr (loc + 1);
+ parsed.insert (tname);
+ loc = option.find (",", 0);
+ }
+
+ /* At this point, no "," exists in option. Don't add
+ an empty string if the entire option was empty. */
+ if (option.length ())
+ parsed.insert (option);
+}
+
+static void
+validatePackageNames (std::set<std::string> &names)
+{
+ packagedb db;
+ for (std::set<std::string>::iterator n = names.begin();
+ n != names.end();
+ ++n)
+ {
+ if (db.packages.find(*n) == db.packages.end())
+ {
+ Log(LOG_PLAIN) << "Package '" << *n << "' not found." << endLog;
+ }
+ }
+}
+
+bool
+isManuallyWanted(packagemeta &pkg, packageversion &version)
+{
+ static bool parsed_yet = false;
+ static std::map<std::string, std::string> parsed_names;
+ hasManualSelections |= parsed_names.size ();
+ static std::set<std::string> parsed_categories;
+ hasManualSelections |= parsed_categories.size ();
+ bool bReturn = false;
+
+ /* First time through, we parse all the names out from the
+ option string and store them away in an STL set. */
+ if (!parsed_yet)
+ {
+ std::vector<std::string> packages_options = PackageOption;
+ std::vector<std::string> categories_options = CategoryOption;
+
+ std::set<std::string> items;
+ for (std::vector<std::string>::iterator n = packages_options.begin ();
+ n != packages_options.end (); ++n)
+ {
+ parseNames (items, *n);
+ }
+
+ std::set<std::string> packages;
+ /* Separate any 'package=version' into package and version parts */
+ for (std::set<std::string>::iterator n = items.begin();
+ n != items.end();
+ ++n)
+ {
+ std::string package;
+ std::string version;
+ std::string::size_type loc = n->find ("=", 0);
+ if (loc != std::string::npos)
+ {
+ package = n->substr(0, loc);
+ version = n->substr(loc+1);
+ }
+ else
+ {
+ package = *n;
+ version = "";
+ }
+ Log (LOG_BABBLE) << "package: " << package << " version: " << version
<< endLog;
+ parsed_names[package] = version;
+ packages.insert(package);
+ }
+
+ validatePackageNames (packages);
+
+ for (std::vector<std::string>::iterator n = categories_options.begin ();
+ n != categories_options.end (); ++n)
+ {
+ parseNames (parsed_categories, *n);
+ }
+ parsed_yet = true;
+ }
+
+ /* Once we've already parsed the option string, just do
+ a lookup in the cache of already-parsed names. */
+ std::map<std::string, std::string>::iterator i = parsed_names.find(pkg.name);
+ if (i != parsed_names.end())
+ {
+ bReturn = true;
+
+ /* Wanted version is unspecified */
+ version = packageversion();
+
+ /* ... unless a version was explicitly specified */
+ std::string v = i->second;
+ if (!v.empty())
+ {
+ const packageversion *pv = pkg.findVersion(v);
+ if (pv)
+ version = *pv;
+ else
+ Log (LOG_PLAIN) << "package: " << pkg.name << " version: " << v <<
" not found" << endLog;
+ }
+ }
+
+ /* If we didn't select the package manually, did we select any
+ of the categories it is in? */
+ if (!bReturn && parsed_categories.size ())
+ {
+ std::set<std::string, casecompare_lt_op>::iterator curcat;
+ for (curcat = pkg.categories.begin (); curcat != pkg.categories.end ();
curcat++)
+ if (parsed_categories.find (*curcat) != parsed_categories.end ())
+ {
+ Log (LOG_BABBLE) << "Found category " << *curcat << " in package "
<< pkg.name << endLog;
+ version = packageversion();
+ bReturn = true;
+ }
+ }
+
+ if (bReturn)
+ Log (LOG_BABBLE) << "Added manual package " << pkg.name << endLog;
+ return bReturn;
+}
+
+bool
+isManuallyDeleted(packagemeta &pkg)
+{
+ static bool parsed_yet = false;
+ static std::set<std::string> parsed_delete;
+ hasManualSelections |= parsed_delete.size ();
+ static std::set<std::string> parsed_delete_categories;
+ hasManualSelections |= parsed_delete_categories.size ();
+ bool bReturn = false;
+
+ /* First time through, we parse all the names out from the
+ option string and store them away in an STL set. */
+ if (!parsed_yet)
+ {
+ std::vector<std::string> delete_options = DeletePackageOption;
+ std::vector<std::string> categories_options = DeleteCategoryOption;
+ for (std::vector<std::string>::iterator n = delete_options.begin ();
+ n != delete_options.end (); ++n)
+ {
+ parseNames (parsed_delete, *n);
+ }
+ validatePackageNames (parsed_delete);
+ for (std::vector<std::string>::iterator n = categories_options.begin ();
+ n != categories_options.end (); ++n)
+ {
+ parseNames (parsed_delete_categories, *n);
+ }
+ parsed_yet = true;
+ }
+
+ /* Once we've already parsed the option string, just do
+ a lookup in the cache of already-parsed names. */
+ bReturn = parsed_delete.find(pkg.name) != parsed_delete.end();
+
+ /* If we didn't select the package manually, did we select any
+ of the categories it is in? */
+ if (!bReturn && parsed_delete_categories.size ())
+ {
+ std::set<std::string, casecompare_lt_op>::iterator curcat;
+ for (curcat = pkg.categories.begin (); curcat != pkg.categories.end ();
curcat++)
+ if (parsed_delete_categories.find (*curcat) !=
parsed_delete_categories.end ())
+ {
+ Log (LOG_BABBLE) << "Found category " << *curcat << " in package "
<< pkg.name << endLog;
+ bReturn = true;
+ }
+ }
+
+ if (bReturn)
+ Log (LOG_BABBLE) << "Deleted manual package " << pkg.name << endLog;
+ return bReturn;
+}
+
+bool
+areBuildDependenciesWanted(packagemeta &pkg)
+{
+ static bool parsed_yet = false;
+ static std::set<std::string> parsed_build_depend;
+ hasManualSelections |= parsed_build_depend.size ();
+ bool bReturn = false;
+
+ /* First time through, we parse all the names out from the
+ option string and store them away in an STL set. */
+ if (!parsed_yet)
+ {
+ std::vector<std::string> build_depends_options = BuildDependsOption;
+
+ for (std::vector<std::string>::iterator n = build_depends_options.begin ();
+ n != build_depends_options.end (); ++n)
+ {
+ parseNames (parsed_build_depend, *n);
+ }
+ validatePackageNames (parsed_build_depend);
+ parsed_yet = true;
+ }
+
+ /* Once we've already parsed the option string, just do
+ a lookup in the cache of already-parsed names. */
+ bReturn = parsed_build_depend.find(pkg.name) != parsed_build_depend.end();
+
+ if (bReturn)
+ Log (LOG_BABBLE) << "Adding build-deps for package " << pkg.name << endLog;
+ return bReturn;
+}
diff --git a/choose_cli.h b/choose_cli.h
new file mode 100644
index 00000000..fc6297f2
--- /dev/null
+++ b/choose_cli.h
@@ -0,0 +1,23 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * A copy of the GNU General Public License can be found at
+ * http://www.gnu.org/
+ *
+ */
+
+#ifndef SETUP_CHOOSE_CLI_H
+#define SETUP_CHOOSE_CLI_H
+
+#include "package_meta.h"
+
+bool isManuallyWanted(packagemeta &pkg, packageversion &version);
+bool isManuallyDeleted(packagemeta &pkg);
+bool areBuildDependenciesWanted(packagemeta &pkg);
+
+extern bool hasManualSelections;
+
+#endif /* SETUP_CHOOSE_CLI_H */
diff --git a/libsolv.cc b/libsolv.cc
index 8ef27063..32024370 100644
--- a/libsolv.cc
+++ b/libsolv.cc
@@ -134,6 +134,13 @@ SolvableVersion::conflicts() const
return deplist(SOLVABLE_CONFLICTS);
}
+const PackageDepends
+SolvableVersion::build_depends() const
+{
+ Id builddep_attr = pool_str2id(pool, "solvable:build_depends", 1);
+ return deplist(builddep_attr);
+}
+
// helper function which returns the deplist for a given key, as a
PackageDepends
const PackageDepends
SolvableVersion::deplist(Id keyname) const
@@ -467,6 +474,34 @@ SolverPool::makedeps(Repo *repo, PackageDepends *requires)
return deps;
}
+void
+SolverPool::makedeps_queue(Repo *repo, PackageDepends *requires, Queue *q)
+{
+ for (PackageDepends::iterator i = requires->begin();
+ i != requires->end();
+ i++)
+ {
+ Id dep;
+ Id name = pool_str2id(pool, (*i)->packageName().c_str(), 1);
+
+ if ((*i)->version().size() == 0)
+ {
+ // no relation, so dependency is just on package name
+ dep = name;
+ }
+ else
+ {
+ // otherwise, dependency is on package name with a version condition
+ Id evr = pool_str2id(pool, (*i)->version().c_str(), 1);
+ int rel = pool_rel2id(pool, name, evr, Operator2RelId((*i)->op()),
1);
+
+ dep = rel;
+ }
+
+ queue_push(q, dep);
+ }
+}
+
SolvableVersion
SolverPool::addPackage(const std::string& pkgname, const addPackageData
&pkgdata)
{
@@ -559,6 +594,17 @@ SolverPool::addPackage(const std::string& pkgname, const
addPackageData &pkgdata
Id stability_attr = pool_str2id(pool, "solvable:stability", 1);
repodata_set_num(data, handle, stability_attr, pkgdata.stability);
+ /* store build_depends */
+ if (pkgdata.build_depends)
+ {
+ Id builddep_attr = pool_str2id(pool, "solvable:build_depends", 1);
+ Queue q;
+ queue_init(&q);
+ makedeps_queue(repo, pkgdata.build_depends, &q);
+ repodata_set_idarray(data, handle, builddep_attr, &q);
+ queue_free(&q);
+ }
+
#if 0
repodata_internalize(data);
diff --git a/libsolv.h b/libsolv.h
index 43f7269b..582f487f 100644
--- a/libsolv.h
+++ b/libsolv.h
@@ -65,6 +65,8 @@ class SolvableVersion
const PackageDepends provides() const;
// Return the conflicts list
const PackageDepends conflicts() const;
+ // Return the build-depends list
+ const PackageDepends build_depends() const;
bool accessible () const;
package_type_t Type () const;
package_stability_t Stability () const;
@@ -158,6 +160,7 @@ public:
PackageDepends *obsoletes;
PackageDepends *provides;
PackageDepends *conflicts;
+ PackageDepends *build_depends;
};
SolvableVersion addPackage(const std::string& pkgname,
@@ -170,6 +173,7 @@ public:
private:
void init();
Id makedeps(Repo *repo, PackageDepends *requires);
+ void makedeps_queue(Repo *repo, PackageDepends *requires, Queue *q);
Pool *pool;
typedef std::map<std::string, SolvRepo *> RepoList;
diff --git a/package_db.cc b/package_db.cc
index 26ecc3c3..aac018f1 100644
--- a/package_db.cc
+++ b/package_db.cc
@@ -133,6 +133,7 @@ packagedb::read ()
data.obsoletes = NULL;
data.provides = NULL;
data.conflicts = NULL;
+ data.build_depends = NULL;
data.sdesc = "";
data.ldesc = "";
data.stability = TRUST_UNKNOWN;
@@ -215,6 +216,7 @@ packagedb::makeBase()
data.obsoletes = NULL;
data.provides = NULL;
data.conflicts = NULL;
+ data.build_depends = NULL;
data.stability = TRUST_CURR;
// data.spkg = PackageSpecification();
// data.spkg_id = packageversion();
@@ -251,6 +253,7 @@ packagedb::makeWindows()
data.obsoletes = NULL;
data.provides = NULL;
data.conflicts = NULL;
+ data.build_depends = NULL;
data.stability = TRUST_CURR;
solver.addPackage("_windows", data);
diff --git a/package_meta.cc b/package_meta.cc
index 3daa9700..322c28f9 100644
--- a/package_meta.cc
+++ b/package_meta.cc
@@ -45,12 +45,6 @@
#include "Exception.h"
#include "resource.h"
-static StringArrayOption DeletePackageOption ('x', "remove-packages",
IDS_HELPTEXT_REMOVE_PACKAGES);
-static StringArrayOption DeleteCategoryOption ('c', "remove-categories",
IDS_HELPTEXT_REMOVE_CATEGORIES);
-static StringArrayOption PackageOption ('P', "packages",
IDS_HELPTEXT_PACKAGES);
-static StringArrayOption CategoryOption ('C', "categories",
IDS_HELPTEXT_CATEGORIES);
-bool hasManualSelections = 0;
-
/*****************/
/* Return an appropriate category caption given the action */
@@ -293,191 +287,6 @@ packagemeta::getReadableCategoryList () const
).visitor.result;
}
-static void
-parseNames (std::set<std::string> &parsed, std::string &option)
-{
- std::string tname;
-
- /* Split up the packages listed in the option. */
- std::string::size_type loc = option.find (",", 0);
- while (loc != std::string::npos)
- {
- tname = option.substr (0, loc);
- option = option.substr (loc + 1);
- parsed.insert (tname);
- loc = option.find (",", 0);
- }
-
- /* At this point, no "," exists in option. Don't add
- an empty string if the entire option was empty. */
- if (option.length ())
- parsed.insert (option);
-}
-
-static void
-validatePackageNames (std::set<std::string> &names)
-{
- packagedb db;
- for (std::set<std::string>::iterator n = names.begin();
- n != names.end();
- ++n)
- {
- if (db.packages.find(*n) == db.packages.end())
- {
- Log(LOG_PLAIN) << "Package '" << *n << "' not found." << endLog;
- }
- }
-}
-
-bool packagemeta::isManuallyWanted(packageversion &version) const
-{
- static bool parsed_yet = false;
- static std::map<std::string, std::string> parsed_names;
- hasManualSelections |= parsed_names.size ();
- static std::set<std::string> parsed_categories;
- hasManualSelections |= parsed_categories.size ();
- bool bReturn = false;
-
- /* First time through, we parse all the names out from the
- option string and store them away in an STL set. */
- if (!parsed_yet)
- {
- std::vector<std::string> packages_options = PackageOption;
- std::vector<std::string> categories_options = CategoryOption;
-
- std::set<std::string> items;
- for (std::vector<std::string>::iterator n = packages_options.begin ();
- n != packages_options.end (); ++n)
- {
- parseNames (items, *n);
- }
-
- std::set<std::string> packages;
- /* Separate any 'package=version' into package and version parts */
- for (std::set<std::string>::iterator n = items.begin();
- n != items.end();
- ++n)
- {
- std::string package;
- std::string version;
- std::string::size_type loc = n->find ("=", 0);
- if (loc != std::string::npos)
- {
- package = n->substr(0, loc);
- version = n->substr(loc+1);
- }
- else
- {
- package = *n;
- version = "";
- }
- Log (LOG_BABBLE) << "package: " << package << " version: " << version
<< endLog;
- parsed_names[package] = version;
- packages.insert(package);
- }
-
- validatePackageNames (packages);
-
- for (std::vector<std::string>::iterator n = categories_options.begin ();
- n != categories_options.end (); ++n)
- {
- parseNames (parsed_categories, *n);
- }
- parsed_yet = true;
- }
-
- /* Once we've already parsed the option string, just do
- a lookup in the cache of already-parsed names. */
- std::map<std::string, std::string>::iterator i = parsed_names.find(name);
- if (i != parsed_names.end())
- {
- bReturn = true;
-
- /* Wanted version is unspecified */
- version = packageversion();
-
- /* ... unless a version was explicitly specified */
- std::string v = i->second;
- if (!v.empty())
- {
- const packageversion *pv = findVersion(v);
- if (pv)
- version = *pv;
- else
- Log (LOG_PLAIN) << "package: " << name << " version: " << v << "
not found" << endLog;
- }
- }
-
- /* If we didn't select the package manually, did we select any
- of the categories it is in? */
- if (!bReturn && parsed_categories.size ())
- {
- std::set<std::string, casecompare_lt_op>::iterator curcat;
- for (curcat = categories.begin (); curcat != categories.end (); curcat++)
- if (parsed_categories.find (*curcat) != parsed_categories.end ())
- {
- Log (LOG_BABBLE) << "Found category " << *curcat << " in package "
<< name << endLog;
- version = packageversion();
- bReturn = true;
- }
- }
-
- if (bReturn)
- Log (LOG_BABBLE) << "Added manual package " << name << endLog;
- return bReturn;
-}
-
-bool packagemeta::isManuallyDeleted() const
-{
- static bool parsed_yet = false;
- static std::set<std::string> parsed_delete;
- hasManualSelections |= parsed_delete.size ();
- static std::set<std::string> parsed_delete_categories;
- hasManualSelections |= parsed_delete_categories.size ();
- bool bReturn = false;
-
- /* First time through, we parse all the names out from the
- option string and store them away in an STL set. */
- if (!parsed_yet)
- {
- std::vector<std::string> delete_options = DeletePackageOption;
- std::vector<std::string> categories_options = DeleteCategoryOption;
- for (std::vector<std::string>::iterator n = delete_options.begin ();
- n != delete_options.end (); ++n)
- {
- parseNames (parsed_delete, *n);
- }
- validatePackageNames (parsed_delete);
- for (std::vector<std::string>::iterator n = categories_options.begin ();
- n != categories_options.end (); ++n)
- {
- parseNames (parsed_delete_categories, *n);
- }
- parsed_yet = true;
- }
-
- /* Once we've already parsed the option string, just do
- a lookup in the cache of already-parsed names. */
- bReturn = parsed_delete.find(name) != parsed_delete.end();
-
- /* If we didn't select the package manually, did we select any
- of the categories it is in? */
- if (!bReturn && parsed_delete_categories.size ())
- {
- std::set<std::string, casecompare_lt_op>::iterator curcat;
- for (curcat = categories.begin (); curcat != categories.end (); curcat++)
- if (parsed_delete_categories.find (*curcat) !=
parsed_delete_categories.end ())
- {
- Log (LOG_BABBLE) << "Found category " << *curcat << " in package "
<< name << endLog;
- bReturn = true;
- }
- }
-
- if (bReturn)
- Log (LOG_BABBLE) << "Deleted manual package " << name << endLog;
- return bReturn;
-}
-
const std::string
packagemeta::SDesc () const
{
diff --git a/package_meta.h b/package_meta.h
index fee385b3..11448475 100644
--- a/package_meta.h
+++ b/package_meta.h
@@ -106,11 +106,6 @@ public:
std::string name; /* package name, like "cygwin" */
- /* true if package was selected on command-line. */
- bool isManuallyWanted(packageversion &version) const;
- /* true if package was deleted on command-line. */
- bool isManuallyDeleted() const;
-
const std::string SDesc () const;
const std::string LDesc () const;
@@ -157,13 +152,15 @@ public:
/* this version is undesirable */
bool isBlacklisted(const packageversion &version) const;
+ /* locate packageversion object for given version string */
+ const packageversion *findVersion(std::string &version) const;
+
protected:
packagemeta &operator= (packagemeta const &);
private:
std::string trustLabel(packageversion const &) const;
std::vector <Script> scripts_;
static bool scan (const packageversion &pkg, bool mirror_mode);
- const packageversion * findVersion(std::string &version) const;
_actions _action;
diff --git a/res.pot b/res.pot
index 040923af..2dec4f5d 100644
--- a/res.pot
+++ b/res.pot
@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-10-11 16:30+0100\n"
+"POT-Creation-Date: 2025-11-24 15:33+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Accelerator-Marker: &\n"
-"X-Generator: Translate Toolkit 3.7.3\n"
+"X-Generator: Translate Toolkit 3.15.1\n"
"X-Merge-On: location\n"
#: DIALOG.IDD_SOURCE.CAPTION
@@ -1186,6 +1186,10 @@ msgstr ""
msgid "Specify categories to install"
msgstr ""
+#: STRINGTABLE.IDS_HELPTEXT_BUILD_DEPENDS
+msgid "Specify packages to install the build requirements of"
+msgstr ""
+
#: STRINGTABLE.IDS_HELPTEXT_COMPACTOS
msgid ""
"Compress installed files with Compact OS (xpress4k, xpress8k, xpress16k, lzx)"
diff --git a/res/en/res.rc b/res/en/res.rc
index 0bdd4c7d..8f45338a 100644
--- a/res/en/res.rc
+++ b/res/en/res.rc
@@ -656,6 +656,7 @@ BEGIN
IDS_HELPTEXT_ALLOW_UNSUPPORTED_WINDOWS "Allow old, unsupported Windows
versions"
IDS_HELPTEXT_ARCH "Architecture to install (x86_64 or x86)"
IDS_HELPTEXT_CATEGORIES "Specify categories to install"
+ IDS_HELPTEXT_BUILD_DEPENDS "Specify packages to install the build
requirements of"
IDS_HELPTEXT_COMPACTOS "Compress installed files with Compact OS
(xpress4k, xpress8k, xpress16k, lzx)"
IDS_HELPTEXT_DELETE_ORPHANS "Remove orphaned packages"
IDS_HELPTEXT_DISABLE_ANTIVIRUS "Disable known or suspected buggy anti
virus software packages during execution"
diff --git a/resource.h b/resource.h
index a08489cc..11fef73c 100644
--- a/resource.h
+++ b/resource.h
@@ -158,6 +158,7 @@
#define IDS_HELPTEXT_HEADER 1546
#define IDS_HELPTEXT_FOOTER 1547
#define IDS_HELPTEXT_NO_WRITE_REGISTRY 1548
+#define IDS_HELPTEXT_BUILD_DEPENDS 1549
// Dialogs
[setup - the official Cygwin setup program] branch master, updated. release_2.934-12-gf60a1c22
Jon Turney via Cygwin-apps-cvs Mon, 24 Nov 2025 09:39:38 -0800
