From 61adcbd5ca83762c02cfa421e09fbd65c52b6da9 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 9 Mar 2018 14:02:32 +0300 Subject: Fix up package manifest version for pkg-unpack --- tests/pkg-unpack.test | 61 ++++++++++++++++++++++++++---------- tests/pkg-unpack/git/style-basic.tar | 1 + tests/rep-info.test | 2 +- 3 files changed, 46 insertions(+), 18 deletions(-) create mode 120000 tests/pkg-unpack/git/style-basic.tar (limited to 'tests') diff --git a/tests/pkg-unpack.test b/tests/pkg-unpack.test index 0795f6b..e4cff16 100644 --- a/tests/pkg-unpack.test +++ b/tests/pkg-unpack.test @@ -2,7 +2,7 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -.include common.test auth.test config.test remote.test +.include common.test auth.test config.test remote.test remote-git.test # Source repository: # @@ -15,10 +15,13 @@ # | | `-- bootstrap.build # | |-- buildfile # | `-- manifest -# `-- t1 -# |-- libfoo-1.0.0.tar.gz -# |-- libfoo-1.1.0.tar.gz -# `-- repositories.manifest +# |-- t1 +# | |-- libfoo-1.0.0.tar.gz +# | |-- libfoo-1.1.0.tar.gz +# | `-- repositories.manifest +# | +# `-- git +# `-- style-basic.git # Prepare repositories used by tests if running in the local mode. # @@ -36,6 +39,10 @@ # Create the 't1' repository. # cp -r $src/t1 $out/t1 && $rep_create $out/t1 &$out/t1/packages.manifest + + # Create git repositories. + # + $git_extract $src/git/style-basic.tar &$out_git/state0/*** end pkg_fetch += -d cfg 2>! @@ -193,18 +200,6 @@ $* 2>>EOE != 0 } } -: hello -: -{ - $clone_cfg; - $rep_add $rep/hello && $rep_fetch --trust $cert_fp &cfg/.bpkg/certs/**; - $pkg_fetch libhello/1.0.0; - - $* libhello 2>'unpacked libhello/1.0.0'; - - $pkg_purge libhello 2>'purged libhello/1.0.0' -} - : dir-rep : { @@ -268,3 +263,35 @@ $* 2>>EOE != 0 $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0' } } + +: existing +: +{ + : version-fixup + : + : Test that the version is populated with the snapshot information for the + : package directory that is under the version control. + : + if ($remote != true) + { + $clone_root_cfg; + + rep = $canonicalize([dir_path] $out_git/state0); + + $* -e $rep/style-basic.git 2>>~%EOE% + %using style-basic/1\.1\.0-a\.0\.\d+\..+ \(external\)% + EOE + } +} + +: hello +: +{ + $clone_cfg; + $rep_add $rep/hello && $rep_fetch --trust $cert_fp &cfg/.bpkg/certs/**; + $pkg_fetch libhello/1.0.0; + + $* libhello 2>'unpacked libhello/1.0.0'; + + $pkg_purge libhello 2>'purged libhello/1.0.0' +} diff --git a/tests/pkg-unpack/git/style-basic.tar b/tests/pkg-unpack/git/style-basic.tar new file mode 120000 index 0000000..2833f83 --- /dev/null +++ b/tests/pkg-unpack/git/style-basic.tar @@ -0,0 +1 @@ +../../common/git/state0/style-basic.tar \ No newline at end of file diff --git a/tests/rep-info.test b/tests/rep-info.test index 9a70b49..cdc9e70 100644 --- a/tests/rep-info.test +++ b/tests/rep-info.test @@ -157,7 +157,7 @@ else $* "$rep/style-basic.git#master" >>~%EOO% %git:.+style-basic#master .+style-basic.git#master% - %style-basic/1\.1\.0-a\.0\..+% + %style-basic/1\.1\.0-a\.0\.\d+\..+% EOO : manifest-lists -- cgit v1.1