From 7888367fdf694bf3cf86eade064e14f0c10a7deb Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 5 Apr 2021 09:50:48 +0000 Subject: cpt: bump to 6.0.1 FossilOrigin-Name: 1802b51c2f5b58a6a5830fa3ea5a1949aae13fe422e52e545d39903bd7a2305a --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.mk b/config.mk index 8f1ff19..4424f44 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # Carbs Packaging Tools -VERSION = 6.0.0 +VERSION = 6.0.1 # Installation paths PREFIX = /usr/local -- cgit v1.2.3 From 8100a4cc4c7dd0ffbdf429bd27d8845b71aefaae Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 5 Apr 2021 09:58:03 +0000 Subject: Makefile: fix `make dist` FossilOrigin-Name: 609e606deac7b46cc82b56ac750f6c1ea19ba5205e630e5b2c9a50590f7b5297 --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c63eb5a..e658d2e 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,10 @@ test: all tests/etc/cpt-hook tests/etc/cpt-hook: ln -s ../hook-file $@ -dist: docs/cpt.info +CHANGELOG.md: + fossil wiki export Changelog | sed '1cCHANGELOG\n=========' > CHANGELOG.md + +dist: docs/cpt.info CHANGELOG.md mkdir "cpt-${VERSION}" cp -r ${DISTFILES} "cpt-${VERSION}" tar cf "cpt-${VERSION}.tar" "cpt-${VERSION}" -- cgit v1.2.3 From 8b4545d293dba9c196e60bd60de3a882b2a2ecfd Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 5 Apr 2021 09:58:37 +0000 Subject: cpt: bump to 6.0.2 FossilOrigin-Name: ccd39ecc34e920df23eaafea1e2fa139c052389b4e75f0b8972fa9e29873df5c --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.mk b/config.mk index 4424f44..029eaf0 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # Carbs Packaging Tools -VERSION = 6.0.1 +VERSION = 6.0.2 # Installation paths PREFIX = /usr/local -- cgit v1.2.3 From 851fe4ca9fed86045d9849e68f84209482d8a42e Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 12 Apr 2021 12:00:57 +0000 Subject: cpt: fix --help output when inside a directory prefixed with cpt- FossilOrigin-Name: 83ae4a759534bb013b2b6c3db11874017869e70c7566f89dc6a86a0b2c4c6df3 --- src/cpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpt b/src/cpt index 4ddb4df..50268ea 100755 --- a/src/cpt +++ b/src/cpt @@ -11,7 +11,7 @@ case "$arg" in log "Carbs Packaging Tool" set -- for path in $(SEARCH_PATH=$PATH pkg_find cpt-* all -x); do - set -- "${path#*/cpt-}" "$@" + set -- "${path##*/cpt-}" "$@" max=$((${#1} > max ? ${#1} : max)) done -- cgit v1.2.3 From 98fafaf10a658ba48a107fc1657522385a9fb4b0 Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 12 Apr 2021 12:15:28 +0000 Subject: cpt-lib: alter temporary directory creation behaviour FossilOrigin-Name: 5c9058614a2b092590fe45fd58017f87a3cd995a32fbc56640c5ce99438501f1 --- src/cpt-lib.in | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/cpt-lib.in b/src/cpt-lib.in index bf58fbe..5416efe 100644 --- a/src/cpt-lib.in +++ b/src/cpt-lib.in @@ -1952,23 +1952,19 @@ pkg_clean() { rm -rf -- "${CPT_TMPDIR:=$cac_dir/proc}/$pid" } +create_tmp() { + # Create the required temporary directories and set the variables which + # point to them. + mkdir -p "${mak_dir:=$tmp_dir/build}" \ + "${pkg_dir:=$tmp_dir/pkg}" \ + "${tar_dir:=$tmp_dir/export}" +} + create_cache() { - # A temporary directory can be specified apart from the cache - # directory in order to build in a user specified directory. - # /tmp could be used in order to build on ram, useful on SSDs. - # The user can specify CPT_TMPDIR for this. + # DEPRECATED, use create_tmp() instead. # - # Create the required temporary directories and set the variables - # which point to them. - mkdir -p "${tmp_dir:=${CPT_TMPDIR:=$cac_dir/proc}/$pid}" - # If an argument is given, skip the creation of other cache directories. - # This here makes shellcheck extremely angry, so I am globally disabling - # SC2119. - [ "$1" ] || mkdir -p "${mak_dir:=$tmp_dir/build}" \ - "${pkg_dir:=$tmp_dir/pkg}" \ - "${tar_dir:=$tmp_dir/export}" - + [ "$1" ] || create_tmp } # main() @@ -1987,7 +1983,14 @@ create_cache() { # to them. This is seperate from temporary directories created in # create_cache(). That's because we need these variables set on most # occasions. + # + # A temporary directory can be specified apart from the cache directory in + # order to build in a user specified directory. /tmp could be used in order + # to build on ram, useful on SSDs. The user can specify CPT_TMPDIR for this. + # We create the temporary directory here to avoid permission issues that can + # arise from functions that call as_root(). mkdir -p "${cac_dir:=${CPT_CACHE:=${XDG_CACHE_HOME:-$HOME/.cache}/cpt}}" \ + "${tmp_dir:=${CPT_TMPDIR:=$cac_dir/proc}/$pid}" \ "${src_dir:=$cac_dir/sources}" \ "${log_dir:=$cac_dir/logs}" \ "${bin_dir:=$cac_dir/bin}" -- cgit v1.2.3 From c73369c07f7a21701b5f4801081a92602bda81ca Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 12 Apr 2021 12:46:00 +0000 Subject: spec: update tests for create_tmp() FossilOrigin-Name: 77edf9484c87a1c8eb70aea3ebb05d9440a062926464123ad5f34abef952f13a --- spec/01_lib_spec.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/spec/01_lib_spec.sh b/spec/01_lib_spec.sh index 38eff6e..c90eac1 100644 --- a/spec/01_lib_spec.sh +++ b/spec/01_lib_spec.sh @@ -186,16 +186,12 @@ Describe 'CPT Library' The variable CPT_HOOK should eq "$PWD/tests/hook-file" End End - Describe 'create_cache()' + Describe 'create_tmp()' After pkg_clean It 'creates cache directories' - When call create_cache + When call create_tmp The variable mak_dir should be a directory End - It "doesn't create build directories if an argument is passed" - When call create_cache nobuild - The variable mak_dir should be undefined - End End Describe 'pkg_get_base()' CPT_ROOT=$PWD/tests -- cgit v1.2.3