kiss-repo

personal package repository
git clone git://bvnf.space/kiss-repo.git
Log | Files | Refs | README | LICENSE

0001-kiss-continue-build.patch (3388B)


      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
From 8d53c1d822471a42d2ba02b2f74a8d9124f9ad50 Mon Sep 17 00:00:00 2001
From: aabacchus <ben@bvnf.space>
Date: Mon, 19 Jul 2021 21:16:40 +0100
Subject: [PATCH] kiss: continue build

---
 kiss | 53 ++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 34 insertions(+), 19 deletions(-)

diff --git a/kiss b/kiss
index 9315565..3b86a56 100755
--- a/kiss
+++ b/kiss
@@ -937,14 +937,7 @@ pkg_build_all() {
         ! [ -f "$repo_dir/sources" ] || pkg_extract  "$pkg"
 
         pkg_build    "$pkg"
-        pkg_manifest "$pkg" "$pkg_dir"
-        pkg_strip    "$pkg"
-
-        cd "$pkg_dir/$pkg/$pkg_db/$pkg"
-
-        pkg_fix_deps "$pkg"
-        pkg_etcsums
-        pkg_tar      "$pkg"
+        pkg_finish_b "$pkg"
 
         if equ "${prefer_cache:=0}" 1 || ! contains "$explicit" "$pkg"; then
             log "$pkg" "Needed as a dependency or has an update, installing"
@@ -961,6 +954,32 @@ pkg_build_all() {
         ! prompt "Install built packages? [$explicit]" || (args i $explicit)
 }
 
+pkg_finish_b() {
+    # Finish building a package and create a tarball.
+    pkg="$1"
+    pkg_find "$1"
+    pkg_find_version "$1"
+
+    # Copy the repository files to the package directory.
+    cp -LRf "$repo_dir" "$pkg_dir/$1/$pkg_db/"
+
+    log "$1" "Successfully built package"
+
+    # arg1: post-build
+    # arg2: package name
+    # arg3: path to DESTDIR
+    run_hook post-build "$1" "$pkg_dir/$1"
+
+    pkg_manifest "$pkg" "$pkg_dir"
+    pkg_strip    "$pkg"
+
+    cd "$pkg_dir/$pkg/$pkg_db/$pkg"
+
+    pkg_fix_deps "$pkg"
+    pkg_etcsums
+    pkg_tar      "$pkg"
+}
+
 pkg_build() {
     # Install built packages to a directory under the package name to
     # avoid collisions with other packages.
@@ -1016,16 +1035,6 @@ pkg_build() {
     # Delete the log file if the build succeeded to prevent the directory
     # from filling very quickly with useless logs.
     equ "$KISS_KEEPLOG" 1 || rm -f "$log_dir/$1-$time-$KISS_PID"
-
-    # Copy the repository files to the package directory.
-    cp -LRf "$repo_dir" "$pkg_dir/$1/$pkg_db/"
-
-    log "$1" "Successfully built package"
-
-    # arg1: post-build
-    # arg2: package name
-    # arg3: path to DESTDIR
-    run_hook post-build "$1" "$pkg_dir/$1"
 }
 
 pkg_checksum() {
@@ -1843,6 +1852,11 @@ args() {
         a|alternatives) pkg_alternatives "$@" ;;
         b|build)        pkg_build_all "$@" ;;
         c|checksum)     for pkg do pkg_checksum "$pkg"; done ;;
+        co|continue)
+            export pkg_dir=${PWD%/*}
+            [ "$1" ] || set -- "${PWD##*/}"
+            pkg_finish_b "$1"
+        ;;
         d|download)     for pkg do pkg_source "$pkg"; done ;;
         H|help-ext)     pkg_help_ext "$@" ;;
         i|install)      for pkg do pkg_install "$pkg"; done ;;
@@ -1854,10 +1868,11 @@ args() {
         v|version)      printf '5.5.28\n' ;;
 
         '')
-            log 'kiss [a|b|c|d|i|l|r|s|u|U|v] [pkg]...'
+            log 'kiss [a|b|c|co|d|i|l|r|s|u|U|v] [pkg]...'
             log 'alternatives List and swap alternatives'
             log 'build        Build packages'
             log 'checksum     Generate checksums'
+            log 'continue     Continue a package build in the current dir'
             log 'download     Download sources'
             log 'install      Install packages'
             log 'list         List installed packages'
-- 
2.33.0