# HG changeset patch # User Christophe Lincoln # Date 1488320354 -3600 # Node ID d58ceb6b8fe9ed96324c0b704560ed7ca3e47558 # Parent df5a777521ff0b2f20cd523083cb34e3a860c6a5 Use cook_date in place of build_date diff -r df5a777521ff -r d58ceb6b8fe9 README --- a/README Tue Feb 28 22:58:14 2017 +0200 +++ b/README Tue Feb 28 23:19:14 2017 +0100 @@ -1,7 +1,6 @@ README for SliTaz Users Packages (SUP) ================================================================================ -CURRENT : cook extract and install work nicely. The goal is to have a user-land packages management system using SHell scripts to pack and install files. The sup packages can install all kind of files such @@ -18,6 +17,7 @@ Sup will be also useful in live mode with a persistent home mounted so users will have sup packages installed without having a too big rootfs in RAM. + Quickstart -------------------------------------------------------------------------------- diff -r df5a777521ff -r d58ceb6b8fe9 libsup.sh --- a/libsup.sh Tue Feb 28 22:58:14 2017 +0200 +++ b/libsup.sh Tue Feb 28 23:19:14 2017 +0100 @@ -7,7 +7,6 @@ # . /lib/libtaz.sh -bin="$HOME/.local/bin" config="$HOME/.config" cache="$HOME/.cache/sup" data="$HOME/.local/share" @@ -100,20 +99,30 @@ . receip # Install sup deps || exit on missing system deps ? - newline - gettext "Checking dependencies for"; echo " $PACKAGE..." + gettext "Checking package dependencies" + deps="$(echo $SUP_DEPS $DEPENDS | wc -L)" + in=$((8 + ${deps})) + indent $(($(tty_size) - ${in})) "[ $(colorize 033 $deps) ]" + for dep in ${SUP_DEPS}; do if [ ! "$installed/$dep" ]; then - echo "Missing dependency:"; colorize 35 " $dep" + gettext "Missing dependency:"; colorize 35 " $dep" + sup -i "$dep" fi done . /etc/slitaz/slitaz.conf # PKGS_DB for dep in ${DEPENDS}; do if [ ! "$PKGS_DB/installed/$dep" ]; then - echo "Missing dependency:"; colorize 35 " $dep" + gettext "Missing dependency:"; colorize 31 " $dep" fi done + # Remove existing package files to avois untracked files + if [ -d "$wok/$PACKAGE" ]; then + gettext "Removing existing package files..." + remove_sup "$PACKAGE" >/dev/null; status + fi + newline echo -n "$(colorize 33 $(gettext 'Installing package:'))" colorize 36 " $PACKAGE $VERSION" diff -r df5a777521ff -r d58ceb6b8fe9 server/sup/sup-admin.cgi --- a/server/sup/sup-admin.cgi Tue Feb 28 22:58:14 2017 +0200 +++ b/server/sup/sup-admin.cgi Tue Feb 28 23:19:14 2017 +0100 @@ -93,7 +93,7 @@ website, sup_deps, depends, - build_date, + cook_date, md5sum UNIQUE ); EOT @@ -136,7 +136,7 @@ "$WEB_SITE", "$SUP_DEPS", "$DEPENDS", - "$build_date", + "$cook_date", "$sum" ); EOT diff -r df5a777521ff -r d58ceb6b8fe9 server/sup/sup.cgi --- a/server/sup/sup.cgi Tue Feb 28 22:58:14 2017 +0200 +++ b/server/sup/sup.cgi Tue Feb 28 23:19:14 2017 +0100 @@ -80,7 +80,7 @@
$(get_gravatar $MAINTAINER 24) $(gettext "Maintainer:") $NAME - - $(gettext "Build date:") ${build_date} - + $(gettext "Build date:") ${cook_date} - $(gettext "License:") $LICENSE
EOT @@ -208,7 +208,7 @@ clean_error "Can't source receip" echo "" && exit 1 fi - echo "Build date: $build_date" + echo "Build date: $cook_date" # README gettext "Checking for a README file..." diff -r df5a777521ff -r d58ceb6b8fe9 sup --- a/sup Tue Feb 28 22:58:14 2017 +0200 +++ b/sup Tue Feb 28 23:19:14 2017 +0100 @@ -155,9 +155,9 @@ [ -d "files/${dir}" ] && mv files/${dir} files/.${dir} done - # Add $build_date - sed -i "/^build_date=/"d receip - echo "build_date=\"$(date "+%Y-%m-%d %H:%M")\"" >> receip + # Add $cook_date + sed -i "/^cook_date=/"d receip + echo "cook_date=\"$(date "+%Y-%m-%d %H:%M")\"" >> receip gettext "Creating compressed archive..." find files | cpio -o -H newc --quiet | lzma e files.lzma -si @@ -173,7 +173,7 @@ # Run sup_install() without any installation to help package creation pkg="$2" receip="$wok/$pkg/receip" - work="$supcook/sup_install" + workdir="$supcook/sup_install" # Sanity check check_pkg_arg "$1" @@ -184,11 +184,12 @@ newline echo "$(colorize 33 $(gettext 'Running') sup_install\(\):) $(colorize 35 $pkg)" separator - mkdir -p ${work} && cd ${work} + [ "$clean" ] && rm -rf ${workdir} + mkdir -p ${workdir} && cd ${workdir} . ${wok}/${pkg}/receip sup_install separator - gettext "Working folder:"; echo " $work" + gettext "Working folder:"; echo " $workdir" newline ;; -n|new) @@ -236,6 +237,7 @@ # Download/extract run install() in $cache/install pkg="$2" check_pkg_arg "$1" + newline # Sup pkg in current dir if [ -f "$pkg" ]; then @@ -258,7 +260,6 @@ vers=$(sqlite3 ${pkgsdb} "SELECT version FROM pkgs WHERE name = '$pkg'") mkdir -p ${cache}/wget && cd ${cache}/wget # Download - newline download "$pkg" "${mirror}/${pkg}-${vers}.sup" install_sup "${pkg}-${vers}.sup" rm -rf ${cache}/wget && exit 0 @@ -399,9 +400,9 @@ newline gettext "Installed package:"; colorize 36 " $PACKAGE $VERSION" separator - echo "Short desc: $SHORT_DESC" - echo "" - boldify "$(gettext 'Installed files:') ($sup_size)" + echo "$SHORT_DESC" + newline + colorize 036 "$(gettext 'Installed files:') ($sup_size)" cat ${installed}/${pkg}/files.list newline else