aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-08-03 09:55:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-08-03 09:55:32 +0200
commit164d7ce1bb116b4e8df488030689d7868155969e (patch)
tree8c8d6f9fdc655c0a43641aa4c1e93cd53b3fdc20
parentca6ac5f217f3217a2e2b5d07bf8448e0e6887447 (diff)
Rename --config-uuid to --uuid in bpkg-cfg-create
-rw-r--r--bpkg/cfg-create.cli10
-rw-r--r--bpkg/cfg-create.cxx2
-rw-r--r--bpkg/options-types.hxx4
-rw-r--r--tests/cfg-create.testscript6
-rw-r--r--tests/cfg-link.testscript12
-rw-r--r--tests/pkg-build.testscript2
6 files changed, 20 insertions, 16 deletions
diff --git a/bpkg/cfg-create.cli b/bpkg/cfg-create.cli
index 6bf5598..29cb2a4 100644
--- a/bpkg/cfg-create.cli
+++ b/bpkg/cfg-create.cli
@@ -60,10 +60,10 @@ namespace bpkg
build build-time dependencies.
Each configuration is assigned an automatically-generated UUID unless one
- is specified with the \cb{--config-uuid} option. This UUID is used to
- check the integrity of configuration links. For convenience of referring
- to linked configurations, a configuration can also be assigned a name
- with the \cb{--name} option.
+ is specified with the \cb{--uuid} option. This UUID is used to check the
+ integrity of configuration links. For convenience of referring to linked
+ configurations, a configuration can also be assigned a name with the
+ \cb{--name} option.
A configuration also has a type specified with the \cb{--type} option.
Three predefined types are \cb{target}, \cb{host}, and \cb{build2}. If
@@ -143,7 +143,7 @@ namespace bpkg
of type \cb{target} is created."
}
- uuid --config-uuid
+ uuid_type --uuid
{
"<uuid>",
"Use the specified UUID as the configuration id instead of generating
diff --git a/bpkg/cfg-create.cxx b/bpkg/cfg-create.cxx
index 61d1ef8..09d8e79 100644
--- a/bpkg/cfg-create.cxx
+++ b/bpkg/cfg-create.cxx
@@ -269,7 +269,7 @@ namespace bpkg
vars,
o.existing (),
o.wipe (),
- o.config_uuid_specified () ? o.config_uuid () : optional<uuid> (),
+ o.uuid_specified () ? o.uuid () : optional<uuid> (),
(o.host_config_specified ()
? o.host_config ()
: optional<dir_path> ()),
diff --git a/bpkg/options-types.hxx b/bpkg/options-types.hxx
index 876f0a5..8e8cbf1 100644
--- a/bpkg/options-types.hxx
+++ b/bpkg/options-types.hxx
@@ -8,8 +8,12 @@
#include <cassert>
#include <utility> // move()
+#include <bpkg/types.hxx>
+
namespace bpkg
{
+ using uuid_type = uuid;
+
enum class auth
{
none,
diff --git a/tests/cfg-create.testscript b/tests/cfg-create.testscript
index 46355e5..25225ba 100644
--- a/tests/cfg-create.testscript
+++ b/tests/cfg-create.testscript
@@ -212,7 +212,7 @@ EOE
{
uuid='18f48b4b-b5d9-4712-b98c-1930df1c4228';
- $* --config-uuid $uuid --name foo 2>>/~"%EOE%" &cfg/***;
+ $* --uuid $uuid --name foo 2>>/~"%EOE%" &cfg/***;
%created new configuration in .+/cfg/%
uuid: $uuid
type: target
@@ -233,8 +233,8 @@ EOE
:
: Also use the short option.
:
- $* --config-uuid '123' 2>>EOE != 0
- error: invalid value '123' for option '--config-uuid'
+ $* --uuid '123' 2>>EOE != 0
+ error: invalid value '123' for option '--uuid'
EOE
}
diff --git a/tests/cfg-link.testscript b/tests/cfg-link.testscript
index 4eb0e59..5d903f2 100644
--- a/tests/cfg-link.testscript
+++ b/tests/cfg-link.testscript
@@ -18,7 +18,7 @@ acfg_uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228'
:
{
$cfg_create -d cfg --name 'main';
- $cfg_create -d acfg --name 'shared' --config-uuid "$acfg_uuid" &acfg/***;
+ $cfg_create -d acfg --name 'shared' --uuid "$acfg_uuid" &acfg/***;
# Try to link configuration under the same name.
#
@@ -50,7 +50,7 @@ acfg_uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228'
# Test that the recreated configuration can be implicitly re-linked.
#
rm -r cfg;
- $cfg_create -d cfg --name 'test' --config-uuid "$cfg_uuid" &cfg/***;
+ $cfg_create -d cfg --name 'test' --uuid "$cfg_uuid" &cfg/***;
$* acfg 2>>/~"%EOE%";
%warning: current configuration .+/cfg/ is already implicitly linked with .+/acfg/%
@@ -105,7 +105,7 @@ acfg_uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228'
# Link the second configuration.
#
rm -r acfg;
- $cfg_create -d acfg --name 'shared' --config-uuid "$acfg_uuid" &acfg/***;
+ $cfg_create -d acfg --name 'shared' --uuid "$acfg_uuid" &acfg/***;
$pkg_status -d cfg libfoo >'libfoo unknown';
$pkg_status -d acfg2 libfoo >'libfoo unknown';
@@ -113,7 +113,7 @@ acfg_uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228'
# Test that the configuration type mismatch is reported.
#
mv cfg cfg.tmp;
- $cfg_create -d cfg --type host --config-uuid "$cfg_uuid";
+ $cfg_create -d cfg --type host --uuid "$cfg_uuid";
$* -d acfg2 cfg 2>>/EOE != 0;
error: configuration cfg/ type mismatch
@@ -152,7 +152,7 @@ acfg_uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228'
# Test that the repeated implicit link is reported.
#
- $cfg_create -d cfg2 --config-uuid "$cfg_uuid";
+ $cfg_create -d cfg2 --uuid "$cfg_uuid";
$* -d cfg2 acfg2 2>>/~"%EOE%" != 0;
%error: current configuration $cfg_uuid is already linked with .+/acfg2/%
@@ -183,7 +183,7 @@ acfg_uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228'
EOE
rm -r cfg;
- $cfg_create -d cfg --name 'test' --config-uuid "$cfg_uuid" &cfg/***;
+ $cfg_create -d cfg --name 'test' --uuid "$cfg_uuid" &cfg/***;
$pkg_status -d cfg2 libfoo >'libfoo unknown';
$pkg_status -d acfg2 libfoo >'libfoo unknown'
diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript
index 7938e60..94d1cf2 100644
--- a/tests/pkg-build.testscript
+++ b/tests/pkg-build.testscript
@@ -4312,7 +4312,7 @@ else
$clone_cfg;
$cfg_create -d cfg-bar &cfg-bar/***;
- $cfg_create -d cfg-foo --config-uuid $uuid &cfg-foo/***;
+ $cfg_create -d cfg-foo --uuid $uuid &cfg-foo/***;
$cfg_link -d cfg cfg-bar;
$cfg_link -d cfg-bar cfg-foo;