Compare commits
No commits in common. "b5ca815e4c3668a93991afa03a9f6835bb92630a" and "49aebdd8a5910fc283b621bc72769986998547cc" have entirely different histories.
b5ca815e4c
...
49aebdd8a5
|
@ -104,13 +104,7 @@ BuildActionMetaInfo::BuildActionMetaInfo()
|
|||
.param = "skip-dependencies",
|
||||
},
|
||||
},
|
||||
.settings = {
|
||||
BuildActionSettingMetaInfo{
|
||||
.name = "Package exclude regex",
|
||||
.desc = "Regular expression to match package names against; matching packages will be excluded.",
|
||||
.param = "pkg-exclude-regex",
|
||||
},
|
||||
},
|
||||
.settings = {},
|
||||
.directory = false,
|
||||
.sourceDb = false,
|
||||
.destinationDb = true,
|
||||
|
|
|
@ -83,7 +83,6 @@ enum class CleanRepositoryFlags : BuildActionFlagType {
|
|||
None,
|
||||
DryRun = (1 << 0),
|
||||
};
|
||||
enum class ReloadLibraryDependenciesSettings : std::size_t { PackageExcludeRegex };
|
||||
enum class CheckForProblemsSettings : std::size_t { IgnoreDeps, IgnoreLibDeps };
|
||||
enum class PrepareBuildSettings : std::size_t { PKGBUILDsDirs };
|
||||
enum class ConductBuildSettings : std::size_t { ChrootDir, ChrootDefaultUser, CCacheDir, PackageCacheDir, TestFilesDir, GpgKey };
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include <c++utilities/io/ansiescapecodes.h>
|
||||
|
||||
#include <regex>
|
||||
#include <unordered_set>
|
||||
|
||||
using namespace std;
|
||||
|
@ -25,27 +24,10 @@ ReloadLibraryDependencies::ReloadLibraryDependencies(ServiceSetup &setup, const
|
|||
|
||||
void ReloadLibraryDependencies::run()
|
||||
{
|
||||
// read configuration
|
||||
// initialize
|
||||
const auto flags = static_cast<ReloadLibraryDependenciesFlags>(m_buildAction->flags);
|
||||
const auto force = flags & ReloadLibraryDependenciesFlags::ForceReload;
|
||||
const auto skipDependencies = flags & ReloadLibraryDependenciesFlags::SkipDependencies;
|
||||
auto &metaInfo = m_setup.building.metaInfo;
|
||||
auto metaInfoLock = metaInfo.lockToRead();
|
||||
const auto &typeInfo = metaInfo.typeInfoForId(BuildActionType::ReloadLibraryDependencies);
|
||||
const auto packageExcludeRegexSetting = typeInfo.settings[static_cast<std::size_t>(ReloadLibraryDependenciesSettings::PackageExcludeRegex)].param;
|
||||
metaInfoLock.unlock();
|
||||
const auto &packageExcludeRegexValue = findSetting(packageExcludeRegexSetting);
|
||||
auto packageExcludeRegex = std::regex();
|
||||
if (!packageExcludeRegexValue.empty()) {
|
||||
try {
|
||||
packageExcludeRegex = std::regex(packageExcludeRegexValue);
|
||||
} catch (const std::regex_error &e) {
|
||||
reportError(argsToString("configured package exclude regex is invalid: ", e.what()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// initialize
|
||||
m_remainingPackages = 0;
|
||||
auto configReadLock = init(BuildActionAccess::ReadConfig, RequiredDatabases::MaybeDestination, RequiredParameters::None);
|
||||
if (holds_alternative<monostate>(configReadLock)) {
|
||||
|
@ -106,11 +88,6 @@ void ReloadLibraryDependencies::run()
|
|||
if (reportAbortedIfAborted()) {
|
||||
return;
|
||||
}
|
||||
// skip if package should be excluded
|
||||
if (!packageExcludeRegexValue.empty() && std::regex_match(package->name, packageExcludeRegex)) {
|
||||
m_messages.notes.emplace_back(db->name % '/' % packageName + ": matches exclude regex");
|
||||
continue;
|
||||
}
|
||||
// skip if the package info is missing (we need the binary package's file name here)
|
||||
const auto &packageInfo = package->packageInfo;
|
||||
if (!packageInfo) {
|
||||
|
|
|
@ -53,7 +53,7 @@ inline void convertValue(const std::multimap<std::string, std::string> &multimap
|
|||
if (error) {
|
||||
cerr << Phrases::ErrorMessage << "Specified IP address \"" << value << "\" for key \"" << key << "\" is invalid" << Phrases::End
|
||||
<< Phrases::SubError << error.message() << Phrases::End;
|
||||
return;
|
||||
exit(-1);
|
||||
}
|
||||
result = ip;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ template <> inline void convertValue(const std::multimap<std::string, std::strin
|
|||
result = stringToNumber<unsigned short>(value);
|
||||
} catch (const ConversionException &) {
|
||||
cerr << Phrases::ErrorMessage << "Specified number \"" << value << "\" for key \"" << key << "\" is invalid." << Phrases::End;
|
||||
return;
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ template <> inline void convertValue(const std::multimap<std::string, std::strin
|
|||
} catch (const regex_error &e) {
|
||||
cerr << Phrases::ErrorMessage << "Specified regex \"" << value << "\" for key \"" << key << "\" is invalid: " << Phrases::End;
|
||||
cerr << e.what() << '\n';
|
||||
return;
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -273,11 +273,7 @@ void getPackages(const Params ¶ms, ResponseHandler &&handler)
|
|||
break;
|
||||
case Mode::Regex:
|
||||
// assume names are regexes
|
||||
try {
|
||||
pushPackages(params.setup.config.findPackages(std::regex(name.data(), name.size())));
|
||||
} catch (const std::regex_error &e) {
|
||||
throw BadRequest(argsToString("regex is invalid: ", e.what()));
|
||||
}
|
||||
break;
|
||||
case Mode::Provides:
|
||||
case Mode::Depends:
|
||||
|
|
|
@ -112,12 +112,7 @@ int main(int argc, const char *argv[])
|
|||
const auto negate = negateArg.isPresent();
|
||||
auto regex = std::optional<std::regex>();
|
||||
if (regexArg.isPresent()) {
|
||||
try {
|
||||
regex = std::regex(searchTerm, std::regex::egrep);
|
||||
} catch (const std::regex_error &e) {
|
||||
cerr << "Specified regex is invalid: " << e.what() << endl;
|
||||
exit(3);
|
||||
}
|
||||
}
|
||||
for (const Database &db : cfg.databases) {
|
||||
for (const auto &pkg : db.packages) {
|
||||
|
|
Loading…
Reference in New Issue