aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-01-25 15:43:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-01-25 15:43:04 +0200
commitbe63c7bb20645c0e3ba0d3b3b0ac3ca8692fb237 (patch)
treee79e9de930c87073e094bbe77f44a06347e5b35a
parenta38876e1bcb94b6452f2c820e20883580e47cfe4 (diff)
Don't enforce <name>-<version> form for user-supplied package directories
-rw-r--r--bpkg/pkg-verify5
-rw-r--r--bpkg/pkg-verify.cxx24
2 files changed, 16 insertions, 13 deletions
diff --git a/bpkg/pkg-verify b/bpkg/pkg-verify
index 5e5527e..3eccf66 100644
--- a/bpkg/pkg-verify
+++ b/bpkg/pkg-verify
@@ -26,8 +26,9 @@ namespace bpkg
bool ignore_unknown,
bool diag = true);
- // Similar to the above but verifies that a source directory is
- // a valid package.
+ // Similar to the above but verifies that a source directory is a valid
+ // package. Note that it doesn't enforce the <name>-<version> form for the
+ // directory itself.
//
package_manifest
pkg_verify (const dir_path& source, bool ignore_unknown, bool diag = true);
diff --git a/bpkg/pkg-verify.cxx b/bpkg/pkg-verify.cxx
index f2723a0..a76370d 100644
--- a/bpkg/pkg-verify.cxx
+++ b/bpkg/pkg-verify.cxx
@@ -177,18 +177,20 @@ namespace bpkg
manifest_parser mp (ifs, mf.string ());
package_manifest m (mp, iu);
- // Verify package directory is <name>-<version>.
+ // 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
+ // provides us with a package directory).
//
- dir_path ed (m.name + "-" + m.version.string ());
-
- if (d.leaf () != ed)
- {
- if (diag)
- error << "invalid package directory name '" << d.leaf () << "'" <<
- info << "expected from manifest '" << ed << "'";
-
- throw failed ();
- }
+ // dir_path ed (m.name + "-" + m.version.string ());
+ //
+ // if (d.leaf () != ed)
+ // {
+ // if (diag)
+ // error << "invalid package directory name '" << d.leaf () << "'" <<
+ // info << "expected from manifest '" << ed << "'";
+ //
+ // throw failed ();
+ // }
return m;
}