diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-03-03 18:50:18 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-03-05 12:26:23 +0300 |
commit | 0d3525d80fbeee78ae49384f2d722de20127a040 (patch) | |
tree | 6e60603e396c7cd0e781806782dfa31cb13980cf /bpkg | |
parent | 87841c9288561a3ad580ae23bb288ff3d3d39719 (diff) |
Rename bpkg repository type to pkg
Diffstat (limited to 'bpkg')
-rw-r--r-- | bpkg/auth.cxx | 6 | ||||
-rw-r--r-- | bpkg/fetch-pkg.cxx (renamed from bpkg/fetch-bpkg.cxx) | 52 | ||||
-rw-r--r-- | bpkg/fetch.hxx | 40 | ||||
-rw-r--r-- | bpkg/manifest-utility.cxx | 8 | ||||
-rw-r--r-- | bpkg/package.hxx | 2 | ||||
-rw-r--r-- | bpkg/pkg-fetch.cxx | 4 | ||||
-rw-r--r-- | bpkg/pkg-verify.cxx | 4 | ||||
-rw-r--r-- | bpkg/rep-add.cli | 57 | ||||
-rw-r--r-- | bpkg/rep-create.cxx | 6 | ||||
-rw-r--r-- | bpkg/rep-fetch.cxx | 28 | ||||
-rw-r--r-- | bpkg/rep-info.cli | 2 | ||||
-rw-r--r-- | bpkg/repository-signing.cli | 4 |
12 files changed, 106 insertions, 107 deletions
diff --git a/bpkg/auth.cxx b/bpkg/auth.cxx index df31a60..bdcf528 100644 --- a/bpkg/auth.cxx +++ b/bpkg/auth.cxx @@ -69,7 +69,7 @@ namespace bpkg if (rl.remote ()) return repository_location ( repository_url (p.posix_string ()), - repository_type::bpkg, + repository_type::pkg, rl).canonical_name (); else return (path_cast<dir_path> (rl.path ()) / p).normalize ().string (); @@ -711,9 +711,9 @@ namespace bpkg pair<string, string> c (split (cert.name)); - // Strip 'bpkg:' prefix. + // Strip 'pkg:' prefix. // - pair<string, string> r (split (rl.canonical_name ().substr (5))); + pair<string, string> r (split (rl.canonical_name ().substr (4))); // Match the repository canonical name leading part. // diff --git a/bpkg/fetch-bpkg.cxx b/bpkg/fetch-pkg.cxx index 606843f..09422e7 100644 --- a/bpkg/fetch-bpkg.cxx +++ b/bpkg/fetch-pkg.cxx @@ -1,4 +1,4 @@ -// file : bpkg/fetch-bpkg.cxx -*- C++ -*- +// file : bpkg/fetch-pkg.cxx -*- C++ -*- // copyright : Copyright (c) 2014-2017 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file @@ -166,17 +166,17 @@ namespace bpkg static const path repositories ("repositories"); - bpkg_repository_manifests - bpkg_fetch_repositories (const dir_path& d, bool iu) + pkg_repository_manifests + pkg_fetch_repositories (const dir_path& d, bool iu) { - return fetch_manifest<bpkg_repository_manifests> ( + return fetch_manifest<pkg_repository_manifests> ( nullptr, d / repositories, iu).first; } - pair<bpkg_repository_manifests, string/*checksum*/> - bpkg_fetch_repositories (const common_options& o, - const repository_location& rl, - bool iu) + pair<pkg_repository_manifests, string/*checksum*/> + pkg_fetch_repositories (const common_options& o, + const repository_location& rl, + bool iu) { assert (rl.remote () || rl.absolute ()); @@ -186,23 +186,23 @@ namespace bpkg f /= repositories; return rl.remote () - ? fetch_manifest<bpkg_repository_manifests> (o, u, iu) - : fetch_manifest<bpkg_repository_manifests> (&o, f, iu); + ? fetch_manifest<pkg_repository_manifests> (o, u, iu) + : fetch_manifest<pkg_repository_manifests> (&o, f, iu); } static const path packages ("packages"); - bpkg_package_manifests - bpkg_fetch_packages (const dir_path& d, bool iu) + pkg_package_manifests + pkg_fetch_packages (const dir_path& d, bool iu) { - return fetch_manifest<bpkg_package_manifests> ( + return fetch_manifest<pkg_package_manifests> ( nullptr, d / packages, iu).first; } - pair<bpkg_package_manifests, string/*checksum*/> - bpkg_fetch_packages (const common_options& o, - const repository_location& rl, - bool iu) + pair<pkg_package_manifests, string/*checksum*/> + pkg_fetch_packages (const common_options& o, + const repository_location& rl, + bool iu) { assert (rl.remote () || rl.absolute ()); @@ -212,16 +212,16 @@ namespace bpkg f /= packages; return rl.remote () - ? fetch_manifest<bpkg_package_manifests> (o, u, iu) - : fetch_manifest<bpkg_package_manifests> (&o, f, iu); + ? fetch_manifest<pkg_package_manifests> (o, u, iu) + : fetch_manifest<pkg_package_manifests> (&o, f, iu); } static const path signature ("signature"); signature_manifest - bpkg_fetch_signature (const common_options& o, - const repository_location& rl, - bool iu) + pkg_fetch_signature (const common_options& o, + const repository_location& rl, + bool iu) { assert (rl.remote () || rl.absolute ()); @@ -236,10 +236,10 @@ namespace bpkg } path - bpkg_fetch_archive (const common_options& o, - const repository_location& rl, - const path& a, - const dir_path& d) + pkg_fetch_archive (const common_options& o, + const repository_location& rl, + const path& a, + const dir_path& d) { assert (!a.empty () && a.relative ()); assert (rl.remote () || rl.absolute ()); diff --git a/bpkg/fetch.hxx b/bpkg/fetch.hxx index 659e019..fc6b763 100644 --- a/bpkg/fetch.hxx +++ b/bpkg/fetch.hxx @@ -16,35 +16,35 @@ namespace bpkg { - // Repository type bpkg (fetch-bpkg.cxx). + // Repository type pkg (fetch-pkg.cxx). // - bpkg_repository_manifests - bpkg_fetch_repositories (const dir_path&, bool ignore_unknown); + pkg_repository_manifests + pkg_fetch_repositories (const dir_path&, bool ignore_unknown); - pair<bpkg_repository_manifests, string /* checksum */> - bpkg_fetch_repositories (const common_options&, - const repository_location&, - bool ignore_unknown); + pair<pkg_repository_manifests, string /* checksum */> + pkg_fetch_repositories (const common_options&, + const repository_location&, + bool ignore_unknown); - bpkg_package_manifests - bpkg_fetch_packages (const dir_path&, bool ignore_unknown); + pkg_package_manifests + pkg_fetch_packages (const dir_path&, bool ignore_unknown); - pair<bpkg_package_manifests, string /* checksum */> - bpkg_fetch_packages (const common_options&, - const repository_location&, - bool ignore_unknown); + pair<pkg_package_manifests, string /* checksum */> + pkg_fetch_packages (const common_options&, + const repository_location&, + bool ignore_unknown); signature_manifest - bpkg_fetch_signature (const common_options&, - const repository_location&, - bool ignore_unknown); + pkg_fetch_signature (const common_options&, + const repository_location&, + bool ignore_unknown); path - bpkg_fetch_archive (const common_options&, - const repository_location&, - const path& archive, - const dir_path& destdir); + pkg_fetch_archive (const common_options&, + const repository_location&, + const path& archive, + const dir_path& destdir); // Repository type git (fetch-git.cxx). // diff --git a/bpkg/manifest-utility.cxx b/bpkg/manifest-utility.cxx index 77baafb..6162c21 100644 --- a/bpkg/manifest-utility.cxx +++ b/bpkg/manifest-utility.cxx @@ -87,7 +87,7 @@ namespace bpkg // Guess the repository type to construct the repository location: // // 1. If type is specified as an option use that (but validate - // incompatible scheme/type e.g., git/bpkg). + // incompatible scheme/type e.g., git/pkg). // // 2. See guess_type() function description in libbpkg/manifest.hxx for // the algorithm details. @@ -106,10 +106,10 @@ namespace bpkg dr << fail << "invalid " << t << " repository location '" << u << "': " << e; - // If the bpkg repository type was guessed, then suggest the user to + // If the pkg repository type was guessed, then suggest the user to // specify the type explicitly. // - if (!ot && t == repository_type::bpkg) + if (!ot && t == repository_type::pkg) dr << info << "consider using --type to specify repository type"; dr << endf; @@ -133,7 +133,7 @@ namespace bpkg { switch (l.type ()) { - case repository_type::bpkg: return dir_path (); // No state. + case repository_type::pkg: return dir_path (); // No state. case repository_type::git: { return dir_path (sha256 (l.canonical_name ()).abbreviated_string (16)); diff --git a/bpkg/package.hxx b/bpkg/package.hxx index 68c2cd8..3567b10 100644 --- a/bpkg/package.hxx +++ b/bpkg/package.hxx @@ -222,7 +222,7 @@ namespace bpkg // #pragma db map type(repository_location) as(_repository_location) \ to({(?).url (), \ - (?).empty () ? bpkg::repository_type::bpkg : (?).type ()}) \ + (?).empty () ? bpkg::repository_type::pkg : (?).type ()}) \ from(bpkg::repository_location (std::move ((?).url), (?).type)) // repository diff --git a/bpkg/pkg-fetch.cxx b/bpkg/pkg-fetch.cxx index fbe5b5c..1dd9f2e 100644 --- a/bpkg/pkg-fetch.cxx +++ b/bpkg/pkg-fetch.cxx @@ -224,9 +224,7 @@ namespace bpkg text << "fetching " << pl->location.leaf () << " " << "from " << pl->repository->name; - path a ( - bpkg_fetch_archive (co, pl->repository->location, pl->location, c)); - + path a (pkg_fetch_archive (co, pl->repository->location, pl->location, c)); auto_rmfile arm (a); // We can't be fetching an archive for a transient object. diff --git a/bpkg/pkg-verify.cxx b/bpkg/pkg-verify.cxx index 2f01f94..ee3cfe4 100644 --- a/bpkg/pkg-verify.cxx +++ b/bpkg/pkg-verify.cxx @@ -39,7 +39,7 @@ namespace bpkg { ifdstream is (move (pr.second.in_ofd), fdstream_mode::skip); manifest_parser mp (is, mf.string ()); - package_manifest m (bpkg_package_manifest (mp, iu)); + package_manifest m (pkg_package_manifest (mp, iu)); is.close (); if (wait ()) @@ -129,7 +129,7 @@ namespace bpkg { ifdstream ifs (mf); manifest_parser mp (ifs, mf.string ()); - package_manifest m (bpkg_package_manifest (mp, iu)); + package_manifest m (pkg_package_manifest (mp, iu)); // We used to verify package directory is <name>-<version> but it is // not clear why we should enforce it in this case (i.e., the user diff --git a/bpkg/rep-add.cli b/bpkg/rep-add.cli index 827e745..b630f0a 100644 --- a/bpkg/rep-add.cli +++ b/bpkg/rep-add.cli @@ -30,31 +30,32 @@ namespace bpkg the newly added repository. For that, use the \l{bpkg-rep-fetch(1)} command, normally, after adding all the repositories you wish to use. - Currently two types of repositories are supported: \i{bpkg} and \i{git}. + Currently two types of repositories are supported: \cb{pkg} and \cb{git}. Normally the repository type can be automatically guessed by examining its URL (for example, the presence of the \cb{.git} extension) or, in case of a local repository, its content (for example, the presence of the - \cb{.git/} subdirectory). Without any identifying information the bpkg - type is assumed unless explicitly specified with the \cb{--type} option. + \cb{.git/} subdirectory). Without any identifying information the + \cb{pkg} type is assumed unless explicitly specified with the \cb{--type} + option. - A bpkg repository is \i{archive}-based. That is, it contains a collection - of various packages/versions as archive files. For more information on - the structure of bpkg repositories refer to the \l{bpkg \cb{bpkg} - manual}. + A \cb{pkg} repository is \i{archive}-based. That is, it contains a + collection of various packages/versions as archive files. For more + information on the structure of \cb{pkg} repositories refer to the + \l{bpkg \cb{bpkg} manual}. - A git repository is \i{version control}-based. That is, it normally + A \cb{git} repository is \i{version control}-based. That is, it normally contains multiple versions of the same package (but can also contain several packages in the same repository). - Theoretically, a git repository may contain as many package versions as - there are commits. Practically, however, we are normally only interested - in a small subset of them while fetching and processing the necessary - information for all of them could be prohibitively expensive. As a - result, a git repository URL must include the fragment component that - restricts the set of versions to consider as available. While in the - future it will be possible to specify multiple available versions, - currently the fragment must identify a single version using one of the - following forms: + Theoretically, a \cb{git} repository may contain as many package versions + as there are commits. Practically, however, we are normally only + interested in a small subset of them while fetching and processing the + necessary information for all of them could be prohibitively expensive. + As a result, a \cb{git} repository URL must include the fragment + component that restricts the set of versions to consider as available. + While in the future it will be possible to specify multiple available + versions, currently the fragment must identify a single version using one + of the following forms: \ #<tag> @@ -72,7 +73,7 @@ namespace bpkg branch/tag otherwise. In an unlikely case this produces an incorrect result, the last form with omitted <commit-id> can be used. - Below are some examples of git repository URLs: + Below are some examples of \cb{git} repository URLs: \ https://example.com/foo.git#v1.2.3 @@ -82,16 +83,16 @@ namespace bpkg https://example.com/foo.git#deadbeefdeadbeefdeadbeefdeadbeefdeadbeef@ \ - A git repository is expected to contain either the \cb{manifest} or + A \cb{git} repository is expected to contain either the \cb{manifest} or \cb{packages} file in the root directory of the repository. If it only contains \cb{manifest}, then it is assumed to be a single-package repository with the \cb{manifest} file being its package manifest. Otherwise the \cb{packages} file should list the available packages as described in \l{bpkg#manifest-package-list-git Package List Manifest for - \c{git} Repositories}. + \cb{git} Repositories}. - A git repository may also contain the \cb{repositories} file in the root - directory of the repository. This file can be used to describe the + A \cb{git} repository may also contain the \cb{repositories} file in the + root directory of the repository. This file can be used to describe the repository itself as well as specify its prerequisite and complement repositories. See \l{bpkg#manifest-repository-list Repository List Manifest} for details on the format and semantics of this file. @@ -102,11 +103,11 @@ namespace bpkg it is not always possible for some protocols and/or server configurations, as discussed next. - A git repository accessible via \cb{http(s)://} can use either \i{dumb} - or \i{smart} protocol (refer to the \cb{git} documentation for details). - The dumb protocol provides only limited support for fetch minimization - and if this protocol is used, then \cb{bpkg} has no choice but to - download a substantial amount of history. + A \cb{git} repository accessible via \cb{http(s)://} can use either + \i{dumb} or \i{smart} protocol (refer to the \cb{git} documentation for + details). The dumb protocol provides only limited support for fetch + minimization and if this protocol is used, then \cb{bpkg} has no choice + but to download a substantial amount of history. The smart protocol allows fetching of minimal history for tags and branches. Whether this is also possible for (all) commit ids depends on @@ -137,7 +138,7 @@ namespace bpkg repository_type --type { "<type>", - "Specify the repository type with valid values being \cb{bpkg} and + "Specify the repository type with valid values being \cb{pkg} and \cb{git}." } }; diff --git a/bpkg/rep-create.cxx b/bpkg/rep-create.cxx index e9619ca..3940c48 100644 --- a/bpkg/rep-create.cxx +++ b/bpkg/rep-create.cxx @@ -184,8 +184,8 @@ namespace bpkg // Load the 'repositories' file to make sure it is there and // is valid. // - bpkg_repository_manifests rms ( - bpkg_fetch_repositories (d, o.ignore_unknown ())); + pkg_repository_manifests rms ( + pkg_fetch_repositories (d, o.ignore_unknown ())); l4 ([&]{trace << rms.size () - 1 << " prerequisite repository(s)";}); @@ -196,7 +196,7 @@ namespace bpkg package_map pm; collect (o, pm, d, d); - bpkg_package_manifests manifests; + pkg_package_manifests manifests; manifests.sha256sum = sha256 (o, path (d / repositories)); for (auto& p: pm) diff --git a/bpkg/rep-fetch.cxx b/bpkg/rep-fetch.cxx index 9cd6164..795a170 100644 --- a/bpkg/rep-fetch.cxx +++ b/bpkg/rep-fetch.cxx @@ -42,18 +42,18 @@ namespace bpkg static bool filesystem_state_changed; static rep_fetch_data - rep_fetch_bpkg (const common_options& co, - const dir_path* conf, - const repository_location& rl, - bool ignore_unknown) + rep_fetch_pkg (const common_options& co, + const dir_path* conf, + const repository_location& rl, + bool ignore_unknown) { // First fetch the repositories list and authenticate the base's // certificate. // - pair<bpkg_repository_manifests, string /* checksum */> rmc ( - bpkg_fetch_repositories (co, rl, ignore_unknown)); + pair<pkg_repository_manifests, string /* checksum */> rmc ( + pkg_fetch_repositories (co, rl, ignore_unknown)); - bpkg_repository_manifests& rms (rmc.first); + pkg_repository_manifests& rms (rmc.first); bool a (co.auth () != auth::none && (co.auth () == auth::all || rl.remote ())); @@ -70,10 +70,10 @@ namespace bpkg // Now fetch the packages list and make sure it matches the repositories // we just fetched. // - pair<bpkg_package_manifests, string /* checksum */> pmc ( - bpkg_fetch_packages (co, rl, ignore_unknown)); + pair<pkg_package_manifests, string /* checksum */> pmc ( + pkg_fetch_packages (co, rl, ignore_unknown)); - bpkg_package_manifests& pms (pmc.first); + pkg_package_manifests& pms (pmc.first); if (rmc.second != pms.sha256sum) fail << "repositories manifest file checksum mismatch for " @@ -83,7 +83,7 @@ namespace bpkg if (a) { signature_manifest sm ( - bpkg_fetch_signature (co, rl, true /* ignore_unknown */)); + pkg_fetch_signature (co, rl, true /* ignore_unknown */)); if (sm.sha256sum != pmc.second) fail << "packages manifest file checksum mismatch for " @@ -270,7 +270,7 @@ namespace bpkg { ifdstream ifs (f); manifest_parser mp (ifs, f.string ()); - package_manifest m (bpkg_package_manifest (mp, ignore_unknown)); + package_manifest m (pkg_package_manifest (mp, ignore_unknown)); // Save the package manifest, preserving its location. // @@ -410,8 +410,8 @@ namespace bpkg { switch (rl.type ()) { - case repository_type::bpkg: return rep_fetch_bpkg (co, conf, rl, iu); - case repository_type::git: return rep_fetch_git (co, conf, rl, iu); + case repository_type::pkg: return rep_fetch_pkg (co, conf, rl, iu); + case repository_type::git: return rep_fetch_git (co, conf, rl, iu); } assert (false); // Can't be here. diff --git a/bpkg/rep-info.cli b/bpkg/rep-info.cli index 5c11f4f..029b27b 100644 --- a/bpkg/rep-info.cli +++ b/bpkg/rep-info.cli @@ -96,7 +96,7 @@ namespace bpkg repository_type --type { "<type>", - "Specify the repository type with valid values being \cb{bpkg} and + "Specify the repository type with valid values being \cb{pkg} and \cb{git}. Refer to \l{bpkg-rep-add(1)} for details." } diff --git a/bpkg/repository-signing.cli b/bpkg/repository-signing.cli index f6ee7fa..96c37bc 100644 --- a/bpkg/repository-signing.cli +++ b/bpkg/repository-signing.cli @@ -36,7 +36,7 @@ matches the certificate's subject (see below). In the future a certificate authority (CA)-based model may be added. The rest of this guide shows how to create a key/certificate pair for -\cb{bpkg} repository signing and use it to sign a repository. At the end it +\cb{pkg} repository signing and use it to sign a repository. At the end it also briefly explains how to store the private key on a PIV/PKCS#11 device using Yubikey 4 as an example. @@ -92,7 +92,7 @@ it. Also use a working email address in case users need to contact you about issues with your certificate. Note that the \cb{name:} prefix in the \cb{CN} value is not a typo. -The \cb{name} field is a canonical repository name prefix with the \cb{bpkg:} +The \cb{name} field is a canonical repository name prefix with the \cb{pkg:} type part stripped. Any repository with a canonical name that starts with this prefix can be authenticated by this certificate (see the repository manifest documentation for more information on canonical names). For example, name |