diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-03-03 19:09:53 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-03-05 11:28:08 +0300 |
commit | 9f695c1d19e55e0581c184831bafcf6360defd52 (patch) | |
tree | 36261d79714cfb4239e963457edd4fb35fe75a03 | |
parent | f27e01c849a88803614f521f601efecca1da649c (diff) |
Rename bpkg repository type to pkg
-rw-r--r-- | libbpkg/manifest.cxx | 84 | ||||
-rw-r--r-- | libbpkg/manifest.hxx | 53 | ||||
-rw-r--r-- | tests/manifest/driver.cxx | 12 | ||||
-rw-r--r-- | tests/manifest/testscript | 24 | ||||
-rw-r--r-- | tests/repository-location/driver.cxx | 126 |
5 files changed, 149 insertions, 150 deletions
diff --git a/libbpkg/manifest.cxx b/libbpkg/manifest.cxx index 8683037..a030be2 100644 --- a/libbpkg/manifest.cxx +++ b/libbpkg/manifest.cxx @@ -713,10 +713,10 @@ namespace bpkg s.next ("", ""); // End of manifest. } - // bpkg_package_manifest + // pkg_package_manifest // static package_manifest - bpkg_package_manifest (parser& p, name_value nv, bool il, bool iu) + pkg_package_manifest (parser& p, name_value nv, bool il, bool iu) { auto bad_name ([&p, &nv](const string& d) { throw parsing (p.name (), nv.name_line, nv.name_column, d);}); @@ -1307,9 +1307,9 @@ namespace bpkg } package_manifest - bpkg_package_manifest (parser& p, bool iu) + pkg_package_manifest (parser& p, bool iu) { - package_manifest r (bpkg_package_manifest (p, p.next (), false, iu)); + package_manifest r (pkg_package_manifest (p, p.next (), false, iu)); // Make sure this is the end. // @@ -1322,9 +1322,9 @@ namespace bpkg } package_manifest - bpkg_package_manifest (parser& p, name_value nv, bool iu) + pkg_package_manifest (parser& p, name_value nv, bool iu) { - return bpkg_package_manifest (p, nv, true, iu); + return pkg_package_manifest (p, nv, true, iu); } // git_package_manifest @@ -1422,10 +1422,10 @@ namespace bpkg s.next ("", ""); // End of manifest. } - // bpkg_package_manifests + // pkg_package_manifests // - bpkg_package_manifests:: - bpkg_package_manifests (parser& p, bool iu) + pkg_package_manifests:: + pkg_package_manifests (parser& p, bool iu) { name_value nv (p.next ()); @@ -1472,10 +1472,10 @@ namespace bpkg // Parse package manifests. // for (nv = p.next (); !nv.empty (); nv = p.next ()) - push_back (bpkg_package_manifest (p, nv, iu)); + push_back (pkg_package_manifest (p, nv, iu)); } - void bpkg_package_manifests:: + void pkg_package_manifests:: serialize (serializer& s) const { // Serialize the package list manifest. @@ -1509,7 +1509,7 @@ namespace bpkg if (!p.sha256sum) bad_value ("no valid sha256sum"); - bpkg_package_manifest (s, p); + pkg_package_manifest (s, p); } s.next ("", ""); // End of stream. @@ -1761,8 +1761,8 @@ namespace bpkg { switch (t) { - case repository_type::bpkg: return "bpkg"; - case repository_type::git: return "git"; + case repository_type::pkg: return "pkg"; + case repository_type::git: return "git"; } assert (false); // Can't be here. @@ -1772,8 +1772,8 @@ namespace bpkg repository_type to_repository_type (const string& t) { - if (t == "bpkg") return repository_type::bpkg; - else if (t == "git") return repository_type::git; + if (t == "pkg") return repository_type::pkg; + else if (t == "git") return repository_type::git; else throw invalid_argument ("invalid repository type '" + t + "'"); } @@ -1791,7 +1791,7 @@ namespace bpkg { return url.path->extension () == "git" ? repository_type::git - : repository_type::bpkg; + : repository_type::pkg; } case repository_protocol::file: { @@ -1799,12 +1799,12 @@ namespace bpkg dir_exists (path_cast<dir_path> (*url.path) / dir_path (".git"), false) ? repository_type::git - : repository_type::bpkg; + : repository_type::pkg; } } assert (false); // Can't be here. - return repository_type::bpkg; + return repository_type::pkg; } // repository_location @@ -1818,7 +1818,7 @@ namespace bpkg switch (type) { - case repository_type::bpkg: + case repository_type::pkg: { bool bpkg (false); if (host.compare (0, 4, "www.") == 0 || @@ -1858,7 +1858,7 @@ namespace bpkg return e != nullptr && strcmp (e, "git") == 0 ? p.base () : p; } - // Should be bpkg repository location path. + // Should be pkg repository location path. // assert (!p.empty () && *p.begin () != ".."); @@ -1934,10 +1934,10 @@ namespace bpkg // switch (t) { - case repository_type::bpkg: + case repository_type::pkg: { if (url_.scheme == repository_protocol::git) - throw invalid_argument ("unsupported scheme for bpkg repository"); + throw invalid_argument ("unsupported scheme for pkg repository"); break; } @@ -1962,7 +1962,7 @@ namespace bpkg // switch (t) { - case repository_type::bpkg: + case repository_type::pkg: case repository_type::git: { if (!up.to_directory ()) @@ -2015,7 +2015,7 @@ namespace bpkg url_ = move (u); - // Set canonical name to the base location canonical name 'bpkg:<host>' + // Set canonical name to the base location canonical name 'pkg:<host>' // part. The '<path>[#<fragment>]' part of the canonical name is // calculated below. // @@ -2042,12 +2042,12 @@ namespace bpkg throw invalid_argument ("invalid path"); } - // For bpkg repository we need to check path for emptiness before + // For pkg repository we need to check path for emptiness before // proceeding further as a valid non empty location can not have an empty // URL object path member (which can be the case for the remote location, // but not for the relative or absolute). // - if (type_ == repository_type::bpkg && up.empty ()) + if (type_ == repository_type::pkg && up.empty ()) throw invalid_argument ("empty path"); // Need to check that URL path do not go past the root directory of a WEB @@ -2066,12 +2066,12 @@ namespace bpkg return; } - // Canonical name <prefix>/<path> part for the bpkg repository, and the + // Canonical name <prefix>/<path> part for the pkg repository, and the // full path with the .git extension stripped for the git repository. // path sp; - if (type_ == repository_type::bpkg) + if (type_ == repository_type::pkg) { sp = strip_path (up, remote () @@ -2187,7 +2187,7 @@ namespace bpkg if (l.local ()) throw invalid_argument (invalid_location); - if (l.type () != repository_type::bpkg || !url || (*url)[0] != '.') + if (l.type () != repository_type::pkg || !url || (*url)[0] != '.') return url; const path rp (*url); @@ -2223,7 +2223,7 @@ namespace bpkg if (strip_d) u.authority->host.value = strip_domain (u.authority->host, - repository_type::bpkg); + repository_type::pkg); // Web interface URL path part. // @@ -2374,7 +2374,7 @@ namespace bpkg } else if (n == "certificate") { - if (base_type != repository_type::bpkg) + if (base_type != repository_type::pkg) bad_name ("certificate not allowed"); if (r.certificate) @@ -2514,12 +2514,12 @@ namespace bpkg s.next ("", ""); // End of manifest. } - // bpkg_repository_manifest + // pkg_repository_manifest // repository_manifest - bpkg_repository_manifest (parser& p, bool iu) + pkg_repository_manifest (parser& p, bool iu) { - repository_manifest r (bpkg_repository_manifest (p, p.next (), iu)); + repository_manifest r (pkg_repository_manifest (p, p.next (), iu)); // Make sure this is the end. // @@ -2532,9 +2532,9 @@ namespace bpkg } repository_manifest - bpkg_repository_manifest (parser& p, name_value nv, bool iu) + pkg_repository_manifest (parser& p, name_value nv, bool iu) { - return parse_repository_manifest (p, nv, repository_type::bpkg, iu); + return parse_repository_manifest (p, nv, repository_type::pkg, iu); } // git_repository_manifest @@ -2560,15 +2560,15 @@ namespace bpkg return parse_repository_manifest (p, nv, repository_type::git, iu); } - // bpkg_repository_manifests + // pkg_repository_manifests // - bpkg_repository_manifests:: - bpkg_repository_manifests (parser& p, bool iu) + pkg_repository_manifests:: + pkg_repository_manifests (parser& p, bool iu) { name_value nv (p.next ()); while (!nv.empty ()) { - push_back (bpkg_repository_manifest (p, nv, iu)); + push_back (pkg_repository_manifest (p, nv, iu)); nv = p.next (); // Make sure there is location in all except the last entry. @@ -2583,7 +2583,7 @@ namespace bpkg "base repository manifest expected"); } - void bpkg_repository_manifests:: + void pkg_repository_manifests:: serialize (serializer& s) const { if (empty () || !back ().location.empty ()) diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx index 548312d..ada6cd3 100644 --- a/libbpkg/manifest.hxx +++ b/libbpkg/manifest.hxx @@ -392,7 +392,7 @@ namespace bpkg // Create individual package manifest. // LIBBPKG_EXPORT package_manifest - bpkg_package_manifest (butl::manifest_parser&, bool ignore_unknown = false); + pkg_package_manifest (butl::manifest_parser&, bool ignore_unknown = false); LIBBPKG_EXPORT package_manifest git_package_manifest (butl::manifest_parser&, bool ignore_unknown = false); @@ -400,9 +400,9 @@ namespace bpkg // Create an element of the package list manifest. // LIBBPKG_EXPORT package_manifest - bpkg_package_manifest (butl::manifest_parser&, - butl::manifest_name_value start, - bool ignore_unknown = false); + pkg_package_manifest (butl::manifest_parser&, + butl::manifest_name_value start, + bool ignore_unknown = false); LIBBPKG_EXPORT package_manifest git_package_manifest (butl::manifest_parser&, @@ -412,8 +412,8 @@ namespace bpkg // Serialize. // inline void - bpkg_package_manifest (butl::manifest_serializer& s, - const package_manifest& m) + pkg_package_manifest (butl::manifest_serializer& s, + const package_manifest& m) { m.serialize (s); } @@ -424,7 +424,7 @@ namespace bpkg LIBBPKG_EXPORT void git_package_manifest (butl::manifest_serializer&, const package_manifest&); - class LIBBPKG_EXPORT bpkg_package_manifests: + class LIBBPKG_EXPORT pkg_package_manifests: public std::vector<package_manifest> { public: @@ -437,9 +437,9 @@ namespace bpkg std::string sha256sum; public: - bpkg_package_manifests () = default; - bpkg_package_manifests (butl::manifest_parser&, - bool ignore_unknown = false); + pkg_package_manifests () = default; + pkg_package_manifests (butl::manifest_parser&, + bool ignore_unknown = false); void serialize (butl::manifest_serializer&) const; @@ -524,7 +524,7 @@ namespace bpkg // Repository type. // - enum class repository_type {bpkg, git}; + enum class repository_type {pkg, git}; LIBBPKG_EXPORT std::string to_string (repository_type); @@ -543,11 +543,10 @@ namespace bpkg // 1. If scheme is git then git. // // 2. If scheme is http(s), then check if path has the .git extension, - // then git, otherwise bpkg. + // then git, otherwise pkg. // // 3. If local (which will normally be without the .git extension), check - // if directory contains the .git/ subdirectory then git, otherwise - // bpkg. + // if directory contains the .git/ subdirectory then git, otherwise pkg. // // Can throw system_error in the later case. // @@ -587,7 +586,7 @@ namespace bpkg explicit repository_location (repository_url, repository_type); - // Create a potentially relative bpkg repository location. If base is not + // Create a potentially relative pkg repository location. If base is not // empty, use it to complete the relative location to the remote/absolute // one. Throw std::invalid_argument if base is not empty but the location // is empty, base itself is relative, or the resulting completed location @@ -720,8 +719,8 @@ namespace bpkg { switch (type ()) { - case repository_type::bpkg: return true; - case repository_type::git: return false; + case repository_type::pkg: return true; + case repository_type::git: return false; } assert (false); // Can't be here. @@ -814,7 +813,7 @@ namespace bpkg // Return the effective web interface URL based on the specified remote // repository location. If url is not present, doesn't start with '.', or - // the repository type differs from bpkg, then return it unchanged. + // the repository type differs from pkg, then return it unchanged. // Otherwise, process the relative format as described in the manifest // specification. Throw std::invalid_argument if the relative url format is // invalid or if the repository location is empty or local. @@ -832,8 +831,8 @@ namespace bpkg // Create individual repository manifest. // LIBBPKG_EXPORT repository_manifest - bpkg_repository_manifest (butl::manifest_parser&, - bool ignore_unknown = false); + pkg_repository_manifest (butl::manifest_parser&, + bool ignore_unknown = false); LIBBPKG_EXPORT repository_manifest git_repository_manifest (butl::manifest_parser&, @@ -842,16 +841,16 @@ namespace bpkg // Create an element of the repository list manifest. // LIBBPKG_EXPORT repository_manifest - bpkg_repository_manifest (butl::manifest_parser&, - butl::manifest_name_value start, - bool ignore_unknown = false); + pkg_repository_manifest (butl::manifest_parser&, + butl::manifest_name_value start, + bool ignore_unknown = false); LIBBPKG_EXPORT repository_manifest git_repository_manifest (butl::manifest_parser&, butl::manifest_name_value start, bool ignore_unknown = false); - class LIBBPKG_EXPORT bpkg_repository_manifests: + class LIBBPKG_EXPORT pkg_repository_manifests: public std::vector<repository_manifest> { public: @@ -859,9 +858,9 @@ namespace bpkg using base_type::base_type; - bpkg_repository_manifests () = default; - bpkg_repository_manifests (butl::manifest_parser&, - bool ignore_unknown = false); + pkg_repository_manifests () = default; + pkg_repository_manifests (butl::manifest_parser&, + bool ignore_unknown = false); void serialize (butl::manifest_serializer&) const; diff --git a/tests/manifest/driver.cxx b/tests/manifest/driver.cxx index 9c58dcf..caca79d 100644 --- a/tests/manifest/driver.cxx +++ b/tests/manifest/driver.cxx @@ -21,9 +21,9 @@ using namespace bpkg; // Read and parse manifest from STDIN and serialize it to STDOUT. The // following options specify the manifest type. // -// -bp parse bpkg package manifest list +// -pp parse pkg package manifest list // -gp parse git package manifest list -// -br parse bpkg repository manifest list +// -pr parse pkg repository manifest list // -gr parse git repository manifest list // -s parse signature manifest // @@ -39,10 +39,10 @@ main (int argc, char* argv[]) manifest_parser p (cin, "stdin"); manifest_serializer s (cout, "stdout"); - if (opt == "-bp") - bpkg_package_manifests (p).serialize (s); - else if (opt == "-br") - bpkg_repository_manifests (p).serialize (s); + if (opt == "-pp") + pkg_package_manifests (p).serialize (s); + else if (opt == "-pr") + pkg_repository_manifests (p).serialize (s); else if (opt == "-gp") git_package_manifests (p).serialize (s); else if (opt == "-gr") diff --git a/tests/manifest/testscript b/tests/manifest/testscript index 3f0d38d..68ceced 100644 --- a/tests/manifest/testscript +++ b/tests/manifest/testscript @@ -5,14 +5,14 @@ : packages : { - : bpkg + : pkg : { : manifest : - : Roundtrip the bpkg package manifest list. + : Roundtrip the pkg package manifest list. : - $* -bp <<EOF >>EOF + $* -pp <<EOF >>EOF : 1 sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 : @@ -101,21 +101,21 @@ : repositories : { - : bpkg + : pkg : { : manifest : - : Roundtrip the bpkg repository manifest list. + : Roundtrip the pkg repository manifest list. : - $* -br <<EOF >>EOF + $* -pr <<EOF >>EOF : 1 location: http://pkg.example.org/1/math - type: bpkg + type: pkg role: prerequisite : location: ../stable - type: bpkg + type: pkg role: complement : url: http://cppget.org @@ -159,7 +159,7 @@ : prerequisite-type : - $* -br <<EOI >>EOO + $* -pr <<EOI >>EOO : 1 location: http://example.org/math.git#master role: prerequisite @@ -182,7 +182,7 @@ role: prerequisite : location: ../stable.git - type: bpkg + type: pkg role: complement : location: git://example.org/foo#master @@ -190,7 +190,7 @@ role: prerequisite : location: http://pkg.example.org/1/bar - type: bpkg + type: pkg role: prerequisite : url: http://cppget.org @@ -254,7 +254,7 @@ role: prerequisite : location: http://pkg.example.org/1/bar - type: bpkg + type: pkg role: prerequisite : url: http://cppget.org diff --git a/tests/repository-location/driver.cxx b/tests/repository-location/driver.cxx index e078376..89a32f8 100644 --- a/tests/repository-location/driver.cxx +++ b/tests/repository-location/driver.cxx @@ -27,7 +27,7 @@ namespace bpkg } inline static repository_location - loc (const string& l, repository_type t = repository_type::bpkg) + loc (const string& l, repository_type t = repository_type::pkg) { return repository_location (repository_url (l), t); } @@ -35,13 +35,13 @@ namespace bpkg inline static repository_location loc (const string& l, const repository_location& b, - repository_type t = repository_type::bpkg) + repository_type t = repository_type::pkg) { return repository_location (repository_url (l), t, b); } inline static bool - bad_loc (const string& l, repository_type t = repository_type::bpkg) + bad_loc (const string& l, repository_type t = repository_type::pkg) { try { @@ -57,7 +57,7 @@ namespace bpkg inline static bool bad_loc (const string& l, const repository_location& b, - repository_type t = repository_type::bpkg) + repository_type t = repository_type::pkg) { try { @@ -75,7 +75,7 @@ namespace bpkg { istringstream is (":1\nurl: " + l); manifest_parser mp (is, ""); - repository_manifest m (bpkg_repository_manifest (mp)); + repository_manifest m (pkg_repository_manifest (mp)); optional<string> u (m.effective_url (r)); assert (u); @@ -257,52 +257,52 @@ namespace bpkg { repository_location l (loc ("/1/aa/bb", loc ())); assert (l.string () == "/1/aa/bb"); - assert (l.canonical_name () == "bpkg:/aa/bb"); - assert (l.type () == repository_type::bpkg); + assert (l.canonical_name () == "pkg:/aa/bb"); + assert (l.type () == repository_type::pkg); } { repository_location l (loc ("/pkg/1/aa/bb", loc ())); assert (l.string () == "/pkg/1/aa/bb"); - assert (l.canonical_name () == "bpkg:aa/bb"); + assert (l.canonical_name () == "pkg:aa/bb"); } { repository_location l (loc ("/var/bpkg/1", loc ())); assert (l.string () == "/var/bpkg/1"); - assert (l.canonical_name () == "bpkg:/var/bpkg"); + assert (l.canonical_name () == "pkg:/var/bpkg"); } { repository_location l (loc ("/1", loc ())); assert (l.string () == "/1"); - assert (l.canonical_name () == "bpkg:/"); + assert (l.canonical_name () == "pkg:/"); } { repository_location l (loc ("/var/pkg/1/example.org/math/testing", loc ())); assert (l.string () == "/var/pkg/1/example.org/math/testing"); - assert (l.canonical_name () == "bpkg:example.org/math/testing"); + assert (l.canonical_name () == "pkg:example.org/math/testing"); } { repository_location l (loc ("/var/pkg/example.org/1/math/testing", loc ())); assert (l.string () == "/var/pkg/example.org/1/math/testing"); - assert (l.canonical_name () == "bpkg:/var/pkg/example.org/math/testing"); + assert (l.canonical_name () == "pkg:/var/pkg/example.org/math/testing"); } { repository_location l (loc ("/a/b/../c/1/aa/../bb", loc ())); assert (l.string () == "/a/c/1/bb"); - assert (l.canonical_name () == "bpkg:/a/c/bb"); + assert (l.canonical_name () == "pkg:/a/c/bb"); } { repository_location l (loc ("/a/b/../c/pkg/1/aa/../bb", loc ())); assert (l.string () == "/a/c/pkg/1/bb"); - assert (l.canonical_name () == "bpkg:bb"); + assert (l.canonical_name () == "pkg:bb"); } { repository_location l (loc ("file:///repo/1/path")); assert (l.url () == loc ("file:/repo/1/path").url ()); assert (l.url () == loc ("/repo/1/path").url ()); assert (l.string () == "/repo/1/path"); - assert (l.canonical_name () == "bpkg:/repo/path"); + assert (l.canonical_name () == "pkg:/repo/path"); } { repository_location l (loc ("file:/git/repo#branch", @@ -325,24 +325,24 @@ namespace bpkg { repository_location l (loc ("c:\\1\\aa\\bb", loc ())); assert (l.string () == "c:\\1\\aa\\bb"); - assert (l.canonical_name () == "bpkg:c:\\aa\\bb"); - assert (l.type () == repository_type::bpkg); + assert (l.canonical_name () == "pkg:c:\\aa\\bb"); + assert (l.type () == repository_type::pkg); } { repository_location l (loc ("c:/1/aa/bb", loc ())); assert (l.string () == "c:\\1\\aa\\bb"); - assert (l.canonical_name () == "bpkg:c:\\aa\\bb"); + assert (l.canonical_name () == "pkg:c:\\aa\\bb"); } { repository_location l (loc ("c:\\pkg\\1\\aa\\bb", loc ())); assert (l.string () == "c:\\pkg\\1\\aa\\bb"); - assert (l.canonical_name () == "bpkg:aa/bb"); + assert (l.canonical_name () == "pkg:aa/bb"); } { repository_location l (loc ("c:\\var\\pkg\\1\\example.org\\math\\tst", loc ())); assert (l.string () == "c:\\var\\pkg\\1\\example.org\\math\\tst"); - assert (l.canonical_name () == "bpkg:example.org/math/tst"); + assert (l.canonical_name () == "pkg:example.org/math/tst"); } { repository_location l (loc ("c:\\var\\pkg\\example.org\\1\\math\\tst", @@ -350,25 +350,25 @@ namespace bpkg assert (l.string () == "c:\\var\\pkg\\example.org\\1\\math\\tst"); assert (l.canonical_name () == - "bpkg:c:\\var\\pkg\\example.org\\math\\tst"); + "pkg:c:\\var\\pkg\\example.org\\math\\tst"); } { repository_location l (loc ("c:/a/b/../c/1/aa/../bb", loc ())); assert (l.string () == "c:\\a\\c\\1\\bb"); - assert (l.canonical_name () == "bpkg:c:\\a\\c\\bb"); + assert (l.canonical_name () == "pkg:c:\\a\\c\\bb"); } { repository_location l (loc ("c:/a/b/../c/pkg/1/aa/../bb", loc ())); assert (l.string () == "c:\\a\\c\\pkg\\1\\bb"); - assert (l.canonical_name () == "bpkg:bb"); + assert (l.canonical_name () == "pkg:bb"); } { repository_location l (loc ("file:///c:/repo/1/path")); assert (l.url () == loc ("file:/c:/repo/1/path").url ()); assert (l.url () == loc ("c:/repo/1/path").url ()); assert (l.string () == "c:\\repo\\1\\path"); - assert (l.canonical_name () == "bpkg:c:\\repo\\path"); + assert (l.canonical_name () == "pkg:c:\\repo\\path"); } { repository_location l (loc ("file:/c:/git/repo#branch", @@ -397,44 +397,44 @@ namespace bpkg { repository_location l (loc ("http://www.a.com:80/1/aa/bb")); assert (l.string () == "http://www.a.com:80/1/aa/bb"); - assert (l.canonical_name () == "bpkg:a.com/aa/bb"); + assert (l.canonical_name () == "pkg:a.com/aa/bb"); assert (l.proto () == proto::http); - assert (l.type () == repository_type::bpkg); + assert (l.type () == repository_type::pkg); } { repository_location l (loc ("https://www.a.com:443/1/aa/bb")); assert (l.string () == "https://www.a.com:443/1/aa/bb"); - assert (l.canonical_name () == "bpkg:a.com/aa/bb"); + assert (l.canonical_name () == "pkg:a.com/aa/bb"); assert (l.proto () == proto::https); - assert (l.type () == repository_type::bpkg); + assert (l.type () == repository_type::pkg); } { repository_location l (loc ("http://www.a.com:8080/dd/1/aa/bb")); assert (l.string () == "http://www.a.com:8080/dd/1/aa/bb"); - assert (l.canonical_name () == "bpkg:a.com:8080/dd/aa/bb"); + assert (l.canonical_name () == "pkg:a.com:8080/dd/aa/bb"); assert (l.proto () == proto::http); - assert (l.type () == repository_type::bpkg); + assert (l.type () == repository_type::pkg); } { repository_location l (loc ("http://www.a.com:8080/dd/pkg/1/aa/bb")); assert (l.string () == "http://www.a.com:8080/dd/pkg/1/aa/bb"); - assert (l.canonical_name () == "bpkg:a.com:8080/dd/aa/bb"); + assert (l.canonical_name () == "pkg:a.com:8080/dd/aa/bb"); assert (l.proto () == proto::http); - assert (l.type () == repository_type::bpkg); + assert (l.type () == repository_type::pkg); } { repository_location l (loc ("http://www.a.com:8080/bpkg/dd/1/aa/bb")); assert (l.string () == "http://www.a.com:8080/bpkg/dd/1/aa/bb"); - assert (l.canonical_name () == "bpkg:a.com:8080/bpkg/dd/aa/bb"); + assert (l.canonical_name () == "pkg:a.com:8080/bpkg/dd/aa/bb"); assert (l.proto () == proto::http); - assert (l.type () == repository_type::bpkg); + assert (l.type () == repository_type::pkg); } { repository_location l (loc ("https://www.a.com:444/dd/1/aa/bb")); assert (l.string () == "https://www.a.com:444/dd/1/aa/bb"); - assert (l.canonical_name () == "bpkg:a.com:444/dd/aa/bb"); + assert (l.canonical_name () == "pkg:a.com:444/dd/aa/bb"); assert (l.proto () == proto::https); - assert (l.type () == repository_type::bpkg); + assert (l.type () == repository_type::pkg); } { repository_location l (loc ("git://example.com/test#master", @@ -477,42 +477,42 @@ namespace bpkg { repository_location l (loc ("http://a.com/a/b/../c/1/aa/../bb")); assert (l.string () == "http://a.com/a/c/1/bb"); - assert (l.canonical_name () == "bpkg:a.com/a/c/bb"); + assert (l.canonical_name () == "pkg:a.com/a/c/bb"); } { repository_location l (loc ("https://a.com/a/b/../c/1/aa/../bb")); assert (l.string () == "https://a.com/a/c/1/bb"); - assert (l.canonical_name () == "bpkg:a.com/a/c/bb"); + assert (l.canonical_name () == "pkg:a.com/a/c/bb"); } { repository_location l (loc ("http://www.CPPget.org/qw/1/a/b/")); assert (l.string () == "http://www.cppget.org/qw/1/a/b"); - assert (l.canonical_name () == "bpkg:cppget.org/qw/a/b"); + assert (l.canonical_name () == "pkg:cppget.org/qw/a/b"); } { repository_location l (loc ("http://pkg.CPPget.org/qw/1/a/b/")); assert (l.string () == "http://pkg.cppget.org/qw/1/a/b"); - assert (l.canonical_name () == "bpkg:cppget.org/qw/a/b"); + assert (l.canonical_name () == "pkg:cppget.org/qw/a/b"); } { repository_location l (loc ("http://bpkg.CPPget.org/qw/1/a/b/")); assert (l.string () == "http://bpkg.cppget.org/qw/1/a/b"); - assert (l.canonical_name () == "bpkg:cppget.org/qw/a/b"); + assert (l.canonical_name () == "pkg:cppget.org/qw/a/b"); } { repository_location l (loc ("http://abc.cppget.org/qw/1/a/b/")); assert (l.string () == "http://abc.cppget.org/qw/1/a/b"); - assert (l.canonical_name () == "bpkg:abc.cppget.org/qw/a/b"); + assert (l.canonical_name () == "pkg:abc.cppget.org/qw/a/b"); } { repository_location l (loc ("http://pkg.www.cppget.org/qw/1/a/b/")); assert (l.string () == "http://pkg.www.cppget.org/qw/1/a/b"); - assert (l.canonical_name () == "bpkg:www.cppget.org/qw/a/b"); + assert (l.canonical_name () == "pkg:www.cppget.org/qw/a/b"); } { repository_location l (loc ("http://bpkg.www.cppget.org/qw/1/a/b/")); assert (l.string () == "http://bpkg.www.cppget.org/qw/1/a/b"); - assert (l.canonical_name () == "bpkg:www.cppget.org/qw/a/b"); + assert (l.canonical_name () == "pkg:www.cppget.org/qw/a/b"); } { repository_location l (loc ("https://git.example.com/test.git#master", @@ -535,61 +535,61 @@ namespace bpkg { repository_location l (loc ("http://cppget.org/qw//1/a//b/")); assert (l.string () == "http://cppget.org/qw/1/a/b"); - assert (l.canonical_name () == "bpkg:cppget.org/qw/a/b"); + assert (l.canonical_name () == "pkg:cppget.org/qw/a/b"); } { repository_location l (loc ("http://stable.cppget.org/1/")); - assert (l.canonical_name () == "bpkg:stable.cppget.org"); + assert (l.canonical_name () == "pkg:stable.cppget.org"); } { repository_location l1 (loc ("http://stable.cppget.org/1/misc")); repository_location l2 (loc ("../../1/math", l1)); assert (l2.string () == "http://stable.cppget.org/1/math"); - assert (l2.canonical_name () == "bpkg:stable.cppget.org/math"); + assert (l2.canonical_name () == "pkg:stable.cppget.org/math"); } { repository_location l1 (loc ("http://stable.cppget.org/1/misc")); repository_location l2 (loc ("../../pkg/1/math", l1)); assert (l2.string () == "http://stable.cppget.org/pkg/1/math"); - assert (l2.canonical_name () == "bpkg:stable.cppget.org/math"); + assert (l2.canonical_name () == "pkg:stable.cppget.org/math"); } { repository_location l1 (loc ("https://stable.cppget.org/1/misc")); repository_location l2 (loc ("../../1/math", l1)); assert (l2.string () == "https://stable.cppget.org/1/math"); - assert (l2.canonical_name () == "bpkg:stable.cppget.org/math"); + assert (l2.canonical_name () == "pkg:stable.cppget.org/math"); } { repository_location l1 (loc ("http://stable.cppget.org/1/misc")); repository_location l2 (loc ("../math", l1)); assert (l2.string () == "http://stable.cppget.org/1/math"); - assert (l2.canonical_name () == "bpkg:stable.cppget.org/math"); + assert (l2.canonical_name () == "pkg:stable.cppget.org/math"); } { repository_location l1 (loc ("http://stable.cppget.org/1/misc")); repository_location l2 (loc ("math/..", l1)); assert (l2.string () == "http://stable.cppget.org/1/misc"); - assert (l2.canonical_name () == "bpkg:stable.cppget.org/misc"); + assert (l2.canonical_name () == "pkg:stable.cppget.org/misc"); } { repository_location l1 (loc ("http://stable.cppget.org/1/misc")); repository_location l2 (loc (".", l1)); assert (l2.string () == "http://stable.cppget.org/1/misc"); - assert (l2.canonical_name () == "bpkg:stable.cppget.org/misc"); + assert (l2.canonical_name () == "pkg:stable.cppget.org/misc"); } { repository_location l1 (loc ("http://www.stable.cppget.org:8080/1")); repository_location l2 (loc ("../1/math", l1)); assert (l2.string () == "http://www.stable.cppget.org:8080/1/math"); - assert (l2.canonical_name () == "bpkg:stable.cppget.org:8080/math"); + assert (l2.canonical_name () == "pkg:stable.cppget.org:8080/math"); assert (l2.proto () == proto::http); } { repository_location l1 (loc ("https://www.stable.cppget.org:444/1")); repository_location l2 (loc ("../1/math", l1)); assert (l2.string () == "https://www.stable.cppget.org:444/1/math"); - assert (l2.canonical_name () == "bpkg:stable.cppget.org:444/math"); + assert (l2.canonical_name () == "pkg:stable.cppget.org:444/math"); assert (l2.proto () == proto::https); } { @@ -615,25 +615,25 @@ namespace bpkg repository_location l1 (loc ("/var/r1/1/misc")); repository_location l2 (loc ("../../../r2/1/math", l1)); assert (l2.string () == "/var/r2/1/math"); - assert (l2.canonical_name () == "bpkg:/var/r2/math"); + assert (l2.canonical_name () == "pkg:/var/r2/math"); } { repository_location l1 (loc ("/var/1/misc")); repository_location l2 (loc ("../math", l1)); assert (l2.string () == "/var/1/math"); - assert (l2.canonical_name () == "bpkg:/var/math"); + assert (l2.canonical_name () == "pkg:/var/math"); } { repository_location l1 (loc ("/var/1/stable")); repository_location l2 (loc ("/var/1/test", l1)); assert (l2.string () == "/var/1/test"); - assert (l2.canonical_name () == "bpkg:/var/test"); + assert (l2.canonical_name () == "pkg:/var/test"); } { repository_location l1 (loc ("http://stable.cppget.org/1/misc")); repository_location l2 (loc ("/var/1/test", l1)); assert (l2.string () == "/var/1/test"); - assert (l2.canonical_name () == "bpkg:/var/test"); + assert (l2.canonical_name () == "pkg:/var/test"); } { repository_location l1 (loc ("/var/1/stable")); @@ -646,25 +646,25 @@ namespace bpkg repository_location l1 (loc ("c:/var/r1/1/misc")); repository_location l2 (loc ("../../../r2/1/math", l1)); assert (l2.string () == "c:\\var\\r2\\1\\math"); - assert (l2.canonical_name () == "bpkg:c:\\var\\r2\\math"); + assert (l2.canonical_name () == "pkg:c:\\var\\r2\\math"); } { repository_location l1 (loc ("c:/var/1/misc")); repository_location l2 (loc ("../math", l1)); assert (l2.string () == "c:\\var\\1\\math"); - assert (l2.canonical_name () == "bpkg:c:\\var\\math"); + assert (l2.canonical_name () == "pkg:c:\\var\\math"); } { repository_location l1 (loc ("c:/var/1/stable")); repository_location l2 (loc ("c:\\var\\1\\test", l1)); assert (l2.string () == "c:\\var\\1\\test"); - assert (l2.canonical_name () == "bpkg:c:\\var\\test"); + assert (l2.canonical_name () == "pkg:c:\\var\\test"); } { repository_location l1 (loc ("http://stable.cppget.org/1/misc")); repository_location l2 (loc ("c:/var/1/test", l1)); assert (l2.string () == "c:\\var\\1\\test"); - assert (l2.canonical_name () == "bpkg:c:\\var\\test"); + assert (l2.canonical_name () == "pkg:c:\\var\\test"); } { repository_location l1 (loc ("c:/var/1/stable")); @@ -677,7 +677,7 @@ namespace bpkg repository_location l1 (loc ("http://www.cppget.org/1/stable")); repository_location l2 (loc ("http://abc.com/1/test", l1)); assert (l2.string () == "http://abc.com/1/test"); - assert (l2.canonical_name () == "bpkg:abc.com/test"); + assert (l2.canonical_name () == "pkg:abc.com/test"); } { repository_location l1 (loc ("http://stable.cppget.org/1/")); |