From 62106ed7cef9b8ef6f07aaf491f8250f7e8d9398 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 10 Oct 2014 01:14:57 +0300 Subject: [PATCH] Add a field for a human-readable name for packages --- source/package.cpp | 2 ++ source/package.h | 2 ++ source/pkgconfiggenerator.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) 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()); -- 2.45.2