From: Mikko Rasa Date: Thu, 9 Oct 2014 22:14:57 +0000 (+0300) Subject: Add a field for a human-readable name for packages X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=62106ed7cef9b8ef6f07aaf491f8250f7e8d9398;p=builder.git Add a field for a human-readable name for packages --- diff --git a/source/package.cpp b/source/package.cpp index 19ee511..5f25f1a 100644 --- a/source/package.cpp +++ b/source/package.cpp @@ -11,6 +11,7 @@ using namespace Msp; Package::Package(Builder &b, const string &n): builder(b), name(n), + label(string(1, toupper(n[0]))+n.substr(1)), prepared(false), use_pkgconfig(true) { @@ -34,6 +35,7 @@ Package::Loader::Loader(Package &p): DataFile::ObjectLoader(p) { add("if_arch", &Loader::if_arch); + add("label", &Package::label); add("require", &Loader::require); } diff --git a/source/package.h b/source/package.h index eb61f06..01a43a0 100644 --- a/source/package.h +++ b/source/package.h @@ -33,6 +33,7 @@ protected: Builder &builder; std::string name; + std::string label; Requirements requires; BuildInfo export_binfo; @@ -47,6 +48,7 @@ public: Builder &get_builder() const { return builder; } const std::string &get_name() const { return name; } + const std::string &get_label() const { return label; } const Requirements &get_required_packages() const { return requires; } const BuildInfo &get_exported_build_info() const { return export_binfo; } diff --git a/source/pkgconfiggenerator.cpp b/source/pkgconfiggenerator.cpp index b60eec4..949a4df 100644 --- a/source/pkgconfiggenerator.cpp +++ b/source/pkgconfiggenerator.cpp @@ -39,7 +39,7 @@ void PkgConfigGenerator::Worker::main() IO::print(out, "prefix=%s\n", builder.get_prefix().str()); IO::print(out, "source=%s\n\n", spkg.get_source_directory()); - IO::print(out, "Name: %s\n", spkg.get_name()); + IO::print(out, "Name: %s\n", spkg.get_label()); IO::print(out, "Description: %s\n", spkg.get_description()); IO::print(out, "Version: %s\n", spkg.get_version());