kisslinux / kiss

KISS Linux - Package Manager
https://kisslinux.github.io
MIT License
464 stars 62 forks source link

kiss exit while building pkg #219

Closed sdsddsd1 closed 3 years ago

sdsddsd1 commented 3 years ago

With the new releases in your repo, kiss just exits at building a pkg. The terminal title hook in my KISS_HOOK seems to be the problem. As when I remove the title hook the build succeeds. Edit: Oh I just saw that you removed this feature from your website. Nvm then if this is unsupported now.

#!/bin/sh

case $TYPE in
    pre-extract)
        # If stderr is not a terminal, kiss is most likely run
        # headlessly and changing the terminal title is pointless.
        [ -t 2 ] && {
            printf '\033]0;kiss: %s (%d/%d)\a' \
                "$PKG" "${pkg_cur:-?}" "${pkg_total:-?}" >&2
        }
    ;;
    pre-build)
       IFS=. read -r _start _ < /proc/uptime
    ;;

    post-build)
        IFS=. read -r _end _ < /proc/uptime

        (
            _s=$((_end - _start))
            _h=$((_s / 60 / 60 % 24))
            _m=$((_s / 60 % 60))

            [ "$_h" = 0 ] || _u="${_u}${_h}h "
            [ "$_m" = 0 ] || _u="${_u}${_m}m "

            log "$PKG" "Build finished in ${_u:-${_s}s}"
        )
    ;;
esac
+ main b zlib
+ set -ef
+ '['  '=' 0 ]
+ lcol='\033[1;33m' lcol2='\033[1;34m' lclr='\033[m'
+ ppwd=/home/claudia
+ pid=3492
+ trap pkg_clean EXIT INT
+ command -v sudo
+ command -v doas
+ command -v ssu
+ cmd_su=/usr/bin/ssu
+ command -v readelf
+ cmd_elf=/usr/bin/readelf
+ date '+%Y-%m-%d-%H:%M'
+ time=2021-07-03-14:29
+ id -u
+ uid=1000
+ create_tmp_dirs
+ KISS_ROOT=
+ mkdir -p /
+ sys_db=/var/db/kiss/installed
+ cac_dir=/home/claudia/.cache
+ cac_dir=/home/claudia/.cache/kiss
+ src_dir=/home/claudia/.cache/kiss/sources
+ log_dir=/home/claudia/.cache/kiss/logs/2021-07-03
+ bin_dir=/home/claudia/.cache/kiss/bin
+ tmp_dir=/tmp
+ tmp_dir=/tmp/3492
+ mak_dir=/tmp/3492/build
+ pkg_dir=/tmp/3492/pkg
+ tar_dir=/tmp/3492/extract
+ mkdir -p /home/claudia/.cache/kiss/sources /home/claudia/.cache/kiss/logs/2021-07-03 /home/claudia/.cache/kiss/bin /tmp/3492/build /tmp/3492/pkg /tmp/3492/extract
+ args b zlib
+ action=b
+ shift 1
+ '[' b ]
+ '[' zlib ]
+ pkg_build zlib
+ pkg_order zlib
+ unset order redro deps
+ pkg_depends zlib raw
+ contains  zlib
+ return 1
+ '['  ]
+ '['  '!=' make ]
+ pkg_find zlib
+ query=zlib all= what= where= IFS=:
+ set --
+ set +f
+ test -d /zlib
+ set +f
+ test -d /home/claudia/repos/forkrepo/zlib
+ set +f
+ test -d /home/claudia/repos/myrepo/zlib
+ set +f
+ test -d /home/claudia/repos/kiss-games/equipment/zlib
+ set +f
+ test -d /home/claudia/repos/kiss-games/games/zlib
+ set +f
+ test -d /home/claudia/repos/repo/core/zlib
+ set -f -- /home/claudia/repos/repo/core/zlib
+ set +f
+ test -d /home/claudia/repos/repo/extra/zlib
+ set +f
+ test -d /home/claudia/repos/repo/xorg/zlib
+ set +f
+ test -d /home/claudia/repos/repo-community/community/zlib
+ set +f
+ test -d /var/db/kiss/installed/zlib
+ set -f -- /home/claudia/repos/repo/core/zlib /var/db/kiss/installed/zlib
+ unset IFS
+ '[' /home/claudia/repos/repo/core/zlib ]
+ '['  ]
+ repo_dir=/home/claudia/repos/repo/core/zlib
+ '[' -e /home/claudia/repos/repo/core/zlib/depends ]
+ '[' raw '=' explicit ]
+ deps=' zlib'
+ order=' zlib'
+ redro='zlib '
+ unset deps
+ set -- zlib
+ log 'Resolving dependencies'
+ printf '%b%s %b%s%b %s\n' '\033[1;33m' '->' '\033[m' 'Resolving dependencies' '\033[m' 
-> Resolving dependencies 
+ pkg_depends zlib explicit filter
+ contains  zlib
+ return 1
+ '[' filter ]
+ '[' -z explicit ]
+ '['  '!=' make ]
+ pkg_find zlib
+ query=zlib all= what= where= IFS=:
+ set --
+ set +f
+ test -d /zlib
+ set +f
+ test -d /home/claudia/repos/forkrepo/zlib
+ set +f
+ test -d /home/claudia/repos/myrepo/zlib
+ set +f
+ test -d /home/claudia/repos/kiss-games/equipment/zlib
+ set +f
+ test -d /home/claudia/repos/kiss-games/games/zlib
+ set +f
+ test -d /home/claudia/repos/repo/core/zlib
+ set -f -- /home/claudia/repos/repo/core/zlib
+ set +f
+ test -d /home/claudia/repos/repo/extra/zlib
+ set +f
+ test -d /home/claudia/repos/repo/xorg/zlib
+ set +f
+ test -d /home/claudia/repos/repo-community/community/zlib
+ set +f
+ test -d /var/db/kiss/installed/zlib
+ set -f -- /home/claudia/repos/repo/core/zlib /var/db/kiss/installed/zlib
+ unset IFS
+ '[' /home/claudia/repos/repo/core/zlib ]
+ '['  ]
+ repo_dir=/home/claudia/repos/repo/core/zlib
+ '[' -e /home/claudia/repos/repo/core/zlib/depends ]
+ '[' explicit '=' explicit ]
+ explicit=' zlib '
+ '['  ]
+ explicit_build=' zlib '
+ set --
+ contains  zlib
+ return 1
+ set -- zlib
+ explicit_cnt=1
+ log 'Building: explicit: zlib'
+ printf '%b%s %b%s%b %s\n' '\033[1;33m' '->' '\033[m' 'Building: explicit: zlib' '\033[m' 
-> Building: explicit: zlib 
+ set -- zlib
+ '[' 1 -ne 1 ]
+ '['  ]
+ pkg_lint zlib
+ log zlib 'Checking repository files'
+ printf '%b%s %b%s%b %s\n' '\033[1;33m' '->' '\033[m\033[1;34m' zlib '\033[m' 'Checking repository files'
-> zlib Checking repository files
+ pkg_find_version zlib
+ pkg_find zlib
+ query=zlib all= what= where= IFS=:
+ set --
+ set +f
+ test -d /zlib
+ set +f
+ test -d /home/claudia/repos/forkrepo/zlib
+ set +f
+ test -d /home/claudia/repos/myrepo/zlib
+ set +f
+ test -d /home/claudia/repos/kiss-games/equipment/zlib
+ set +f
+ test -d /home/claudia/repos/kiss-games/games/zlib
+ set +f
+ test -d /home/claudia/repos/repo/core/zlib
+ set -f -- /home/claudia/repos/repo/core/zlib
+ set +f
+ test -d /home/claudia/repos/repo/extra/zlib
+ set +f
+ test -d /home/claudia/repos/repo/xorg/zlib
+ set +f
+ test -d /home/claudia/repos/repo-community/community/zlib
+ set +f
+ test -d /var/db/kiss/installed/zlib
+ set -f -- /home/claudia/repos/repo/core/zlib /var/db/kiss/installed/zlib
+ unset IFS
+ '[' /home/claudia/repos/repo/core/zlib ]
+ '['  ]
+ repo_dir=/home/claudia/repos/repo/core/zlib
+ read -r repo_ver repo_rel
+ cd /home/claudia/repos/repo/core/zlib
+ '[' 3 ]
+ '[' -x build ]
+ '[' -f sources ]
+ log 'Checking for pre-built dependencies'
+ printf '%b%s %b%s%b %s\n' '\033[1;33m' '->' '\033[m' 'Checking for pre-built dependencies' '\033[m' 
-> Checking for pre-built dependencies 
+ contains ' zlib ' zlib
+ return 0
+ set -- zlib zlib
+ shift
+ pkg_sources zlib
+ pkg_find zlib
+ query=zlib all= what= where= IFS=:
+ set --
+ set +f
+ test -d /zlib
+ set +f
+ test -d /home/claudia/repos/forkrepo/zlib
+ set +f
+ test -d /home/claudia/repos/myrepo/zlib
+ set +f
+ test -d /home/claudia/repos/kiss-games/equipment/zlib
+ set +f
+ test -d /home/claudia/repos/kiss-games/games/zlib
+ set +f
+ test -d /home/claudia/repos/repo/core/zlib
+ set -f -- /home/claudia/repos/repo/core/zlib
+ set +f
+ test -d /home/claudia/repos/repo/extra/zlib
+ set +f
+ test -d /home/claudia/repos/repo/xorg/zlib
+ set +f
+ test -d /home/claudia/repos/repo-community/community/zlib
+ set +f
+ test -d /var/db/kiss/installed/zlib
+ set -f -- /home/claudia/repos/repo/core/zlib /var/db/kiss/installed/zlib
+ unset IFS
+ '[' /home/claudia/repos/repo/core/zlib ]
+ '['  ]
+ repo_dir=/home/claudia/repos/repo/core/zlib
+ '[' -f /home/claudia/repos/repo/core/zlib/sources ]
+ log zlib 'Downloading sources'
+ printf '%b%s %b%s%b %s\n' '\033[1;33m' '->' '\033[m\033[1;34m' zlib '\033[m' 'Downloading sources'
-> zlib Downloading sources
+ mkdir -p /home/claudia/.cache/kiss/sources/zlib
+ cd /home/claudia/.cache/kiss/sources/zlib
+ read -r src dest
+ '[' -z https://zlib.net/zlib-1.2.11.tar.gz ]
+ '[' -z https://zlib.net/zlib-1.2.11.tar.gz ]
+ '[' -f ././zlib-1.2.11.tar.gz ]
+ log zlib 'Found cached remote source '"'"'zlib-1.2.11.tar.gz'"'"
+ printf '%b%s %b%s%b %s\n' '\033[1;33m' '->' '\033[m\033[1;34m' zlib '\033[m' 'Found cached remote source '"'"'zlib-1.2.11.tar.gz'"'"
-> zlib Found cached remote source 'zlib-1.2.11.tar.gz'
+ read -r src dest
+ '['  ]
+ pkg_verify zlib
+ verify_cmd='NR==FNR{a[$1];next}/^SKIP$/{next}!(($1)in a){exit 1}'
+ pkg_find zlib
+ query=zlib all= what= where= IFS=:
+ set --
+ set +f
+ test -d /zlib
+ set +f
+ test -d /home/claudia/repos/forkrepo/zlib
+ set +f
+ test -d /home/claudia/repos/myrepo/zlib
+ set +f
+ test -d /home/claudia/repos/kiss-games/equipment/zlib
+ set +f
+ test -d /home/claudia/repos/kiss-games/games/zlib
+ set +f
+ test -d /home/claudia/repos/repo/core/zlib
+ set -f -- /home/claudia/repos/repo/core/zlib
+ set +f
+ test -d /home/claudia/repos/repo/extra/zlib
+ set +f
+ test -d /home/claudia/repos/repo/xorg/zlib
+ set +f
+ test -d /home/claudia/repos/repo-community/community/zlib
+ set +f
+ test -d /var/db/kiss/installed/zlib
+ set -f -- /home/claudia/repos/repo/core/zlib /var/db/kiss/installed/zlib
+ unset IFS
+ '[' /home/claudia/repos/repo/core/zlib ]
+ '['  ]
+ repo_dir=/home/claudia/repos/repo/core/zlib
+ '[' -f /home/claudia/repos/repo/core/zlib/sources ]
+ pkg_checksums zlib
+ pkg_find zlib
+ query=zlib all= what= where= IFS=:
+ set --
+ set +f
+ test -d /zlib
+ set +f
+ test -d /home/claudia/repos/forkrepo/zlib
+ set +f
+ test -d /home/claudia/repos/myrepo/zlib
+ set +f
+ test -d /home/claudia/repos/kiss-games/equipment/zlib
+ set +f
+ test -d /home/claudia/repos/kiss-games/games/zlib
+ set +f
+ test -d /home/claudia/repos/repo/core/zlib
+ set -f -- /home/claudia/repos/repo/core/zlib
+ set +f
+ test -d /home/claudia/repos/repo/extra/zlib
+ set +f
+ test -d /home/claudia/repos/repo/xorg/zlib
+ set +f
+ test -d /home/claudia/repos/repo-community/community/zlib
+ set +f
+ test -d /var/db/kiss/installed/zlib
+ set -f -- /home/claudia/repos/repo/core/zlib /var/db/kiss/installed/zlib
+ unset IFS
+ '[' /home/claudia/repos/repo/core/zlib ]
+ '['  ]
+ repo_dir=/home/claudia/repos/repo/core/zlib
+ read -r src dest
+ '[' -z https://zlib.net/zlib-1.2.11.tar.gz ]
+ '[' -z https://zlib.net/zlib-1.2.11.tar.gz ]
+ '[' -d /home/claudia/repos/repo/core/zlib/https://zlib.net/zlib-1.2.11.tar.gz ]
+ '[' -d /https://zlib.net/zlib-1.2.11.tar.gz ]
+ '[' -z  ]
+ sh256 /home/claudia/.cache/kiss/sources/zlib/./zlib-1.2.11.tar.gz
+ '[' '!' -d /home/claudia/.cache/kiss/sources/zlib/./zlib-1.2.11.tar.gz ]
+ '[' -e /home/claudia/.cache/kiss/sources/zlib/./zlib-1.2.11.tar.gz ]
+ hash='c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1  /home/claudia/.cache/kiss/sources/zlib/./zlib-1.2.11.tar.gz'
+ printf '%s\n' c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
+ read -r src dest
+ '['  ]
+ verify_sum=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
+ '[' c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 ]
+ '[' -f /home/claudia/repos/repo/core/zlib/checksums ]
+ printf '%s\n' c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
+ awk 'NR==FNR{a[$1];next}/^SKIP$/{next}!(($1)in a){exit 1}' - /home/claudia/repos/repo/core/zlib/checksums
+ '[' -z  ]
+ log 'Verified all checksums'
+ printf '%b%s %b%s%b %s\n' '\033[1;33m' '->' '\033[m' 'Verified all checksums' '\033[m' 
-> Verified all checksums 
+ log zlib 'Building package (1/1)'
+ printf '%b%s %b%s%b %s\n' '\033[1;33m' '->' '\033[m\033[1;34m' zlib '\033[m' 'Building package (1/1)'
-> zlib Building package (1/1)
+ run_hook pre-extract zlib /tmp/3492/pkg/zlib
+ TYPE=pre-extract PKG=zlib DEST=/tmp/3492/pkg/zlib . /home/claudia/bin/kh
+ '[' -t 2 ]
+ pkg_clean
+ '['  '=' 1 ]
+ rm -rf /tmp/3492
dylanaraps commented 3 years ago

Edit: Oh I just saw that you removed this feature from your website. Nvm then if this is unsupported now.

I'm not sure what you mean.

This looks like the usual set -e shenanigans, ie try ! [ -t 2 ] || { maybe. Tried it, nope.

I don't think this is a bug as I haven't touched the hook code since 5.2.3 (at least).

dylanaraps commented 3 years ago

OK. Figured it out. KISS has no pkg_cur or pkg_total so the value inside :- is used. The values are not quoted which causes the shell to exit there. If you quote them it works fine, ie ${pkg_cur:-'?'}. You could escape them also.

sdsddsd1 commented 3 years ago

Thanks for looking into it. Quting the variables solved the issue on my end. I got this code from https://k1sslinux.org/package-manager#6.5 and I thought this was just a copy from the old website.