aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-configure.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-03-08 23:21:38 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-03-09 14:54:52 +0300
commit538711543c68be94b3e7e3192394bc2f19f49516 (patch)
tree49d9d40a8b8f65476d755f9016f6acc8d3ff3ee3 /bpkg/pkg-configure.cxx
parenta8218ef3b2f2706a810d10f3956982e5b0bd6c57 (diff)
Call output directory just <pkg> for external packages
Diffstat (limited to 'bpkg/pkg-configure.cxx')
-rw-r--r--bpkg/pkg-configure.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/bpkg/pkg-configure.cxx b/bpkg/pkg-configure.cxx
index 86aadcb..c839d42 100644
--- a/bpkg/pkg-configure.cxx
+++ b/bpkg/pkg-configure.cxx
@@ -126,7 +126,17 @@ namespace bpkg
dir_path src_root (p->src_root->absolute ()
? *p->src_root
: c / *p->src_root);
- dir_path out_root (c / dir_path (p->name + "-" + p->version.string ()));
+
+ const repository_location& rl (p->repository);
+
+ // For external packages call the output directory <pkg>, rather than
+ // <pkg>-<ver>.
+ //
+ dir_path out_root (
+ (!rl.empty () && rl.directory_based ()) || // pkg-unpack <name>/<version>
+ ( rl.empty () && !p->archive) // pkg-unpack --existing <dir>
+ ? c / dir_path (p->name)
+ : c / dir_path (p->name + "-" + p->version.string ()));
l4 ([&]{trace << "src_root: " << src_root << ", "
<< "out_root: " << out_root;});