hooks

my cpt hooks
git clone git://git.ckyln.com/hooks
Log | Files | Refs | README

lib (766B)


      1 # -*- mode: sh -*-
      2 
      3 getrdname() {
      4     # Return if the package is not already installed
      5     [ -d "$sys_db/$PKG" ] || return 0
      6 
      7     # Retrieve the kernel name to generate appropriate ramfs image
      8     while read -r file; do
      9         case "$file" in /boot/vmlinuz*) ;; *) continue; esac
     10         file=${file##/boot/vmlinuz-}
     11         printf '/boot/initrd-%s.img\n' "$file"
     12     done < "$sys_db/$PKG/manifest"
     13 }
     14 
     15 build_end() {
     16     IFS=. read -r end _ < /proc/uptime
     17     (
     18         second=$(( end - start ))
     19         buildtime=$(printf '%02d:%02d:%02d' \
     20             "$(( second / 3600 ))" \
     21             "$(( second % 3600 / 60 ))" \
     22             "$(( second % 60 ))")
     23 
     24         log "$PKG" "Build $1 in $buildtime"
     25     )
     26 }
     27 
     28 printf 'TYPE=%s PKG=%s DEST=%s\n' "$TYPE" "$PKG" "$DEST"