]> git.tdb.fi Git - builder.git/commitdiff
Add a field for a human-readable name for packages
authorMikko Rasa <tdb@tdb.fi>
Thu, 9 Oct 2014 22:14:57 +0000 (01:14 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 9 Oct 2014 22:14:57 +0000 (01:14 +0300)
source/package.cpp
source/package.h
source/pkgconfiggenerator.cpp

index 19ee511a814cf34bf46efd20f9409c7394b5d879..5f25f1a90eb053705092d75b13f565109ffbf2a4 100644 (file)
@@ -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<Package>(p)
 {
        add("if_arch", &Loader::if_arch);
+       add("label",   &Package::label);
        add("require", &Loader::require);
 }
 
index eb61f06b760e1fc21a4c62a3a34fda194837573e..01a43a0fb8453c0fbd1eedfae560b745717a9d7c 100644 (file)
@@ -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; }
index b60eec44f59535f17257c6189c099044a620ba15..949a4df589747e7da8b64ec0cc39f53544ba8db0 100644 (file)
@@ -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());