aboutsummaryrefslogtreecommitdiff
path: root/bpkg/rep-create.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-03-05 16:49:24 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-03-05 17:25:16 +0300
commit22e35bf80cea95dc1edce22e729199f61a6fedcd (patch)
treee8b00be480a8a1b57641f23e1f7d09fb0a8bad1a /bpkg/rep-create.cxx
parentcdbc374bc16ed0db1a4a206064bb090ac935d89d (diff)
Add .manifest extension to repositories, packages and signature files
Diffstat (limited to 'bpkg/rep-create.cxx')
-rw-r--r--bpkg/rep-create.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/bpkg/rep-create.cxx b/bpkg/rep-create.cxx
index 3940c48..56f2f87 100644
--- a/bpkg/rep-create.cxx
+++ b/bpkg/rep-create.cxx
@@ -16,6 +16,7 @@
#include <bpkg/archive.hxx>
#include <bpkg/checksum.hxx>
#include <bpkg/diagnostics.hxx>
+#include <bpkg/manifest-utility.hxx>
#include <bpkg/pkg-verify.hxx>
@@ -49,10 +50,6 @@ namespace bpkg
using package_map = map<package_key, package_data>;
- static const path repositories ("repositories");
- static const path packages ("packages");
- static const path signature ("signature");
-
static void
collect (const rep_create_options& o,
package_map& map,
@@ -91,7 +88,9 @@ namespace bpkg
//
if (d == root)
{
- if (p == repositories || p == packages || p == signature)
+ if (p == repositories_file ||
+ p == packages_file ||
+ p == signature_file)
continue;
}
@@ -181,8 +180,8 @@ namespace bpkg
l4 ([&]{trace << "creating repository in " << d;});
- // Load the 'repositories' file to make sure it is there and
- // is valid.
+ // Load the repositories.manifest file to make sure it is there and is
+ // valid.
//
pkg_repository_manifests rms (
pkg_fetch_repositories (d, o.ignore_unknown ()));
@@ -197,7 +196,7 @@ namespace bpkg
collect (o, pm, d, d);
pkg_package_manifests manifests;
- manifests.sha256sum = sha256 (o, path (d / repositories));
+ manifests.sha256sum = sha256 (o, path (d / repositories_file));
for (auto& p: pm)
{
@@ -211,14 +210,15 @@ namespace bpkg
// Serialize packages manifest, optionally generate the signature manifest.
//
- path p (d / packages);
+ path p (d / packages_file);
try
{
{
- // While we can do nothing about repositories files edited on Windows
- // and littered with the carriage return characters, there is no
- // reason to litter the auto-generated packages and signature files.
+ // While we can do nothing about repositories manifest files edited on
+ // Windows and littered with the carriage return characters, there is
+ // no reason to litter the auto-generated packages and signature
+ // manifest files.
//
ofdstream ofs (p, ios::binary);
@@ -240,7 +240,7 @@ namespace bpkg
m.sha256sum = sha256 (o, p);
m.signature = sign_repository (o, m.sha256sum, key, *cert, d);
- p = path (d / signature);
+ p = path (d / signature_file);
ofdstream ofs (p, ios::binary);
@@ -255,7 +255,7 @@ namespace bpkg
info << "repository manifest contains no certificate" <<
info << "run 'bpkg help rep-create' for more information";
- try_rmfile (path (d / signature), true);
+ try_rmfile (path (d / signature_file), true);
}
}
catch (const manifest_serialization& e)