tazpkg annotate modules/repack-config @ rev 880

Global quite mode provided by libtaz.sh now; few tweaks.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Dec 04 02:42:03 2015 +0200 (2015-12-04)
parents
children 92d8376cbf06
rev   line source
al@844 1 #!/bin/sh
al@844 2 # TazPkg - Tiny autonomous zone packages manager, hg.slitaz.org/tazpkg
al@844 3 # repack-config - TazPkg module
al@844 4 # Create SliTaz package archive from configuration files
al@844 5
al@844 6
al@844 7 # Connect function libraries
al@844 8 . /lib/libtaz.sh
al@844 9
al@844 10 # Get TazPkg working environment
al@844 11 . @@MODULES@@/getenv
al@844 12
al@844 13
al@844 14
al@844 15
al@844 16 TMP_DIR="$(mktemp -d)"
al@844 17 cd "$TMP_DIR"
al@844 18
al@844 19 CONFIG_VERSION='1.0'
al@844 20
al@844 21 mkdir "config-$CONFIG_VERSION"
al@844 22 cd "config-$CONFIG_VERSION"
al@844 23
al@844 24 for i in $INSTALLED/*/volatile.cpio.gz; do
al@844 25 zcat "$i" | cpio -t --quiet
al@844 26 done > files.list
al@844 27
al@844 28 mkdir fs
al@844 29 cd fs
al@844 30
al@844 31 ( cd / ; cpio -o -H newc --quiet ) < ../files.list | cpio -idm --quiet > /dev/null
al@844 32
al@844 33 mkdir -p etc/tazlito
al@844 34 awk -F$'\t' '{print $1"-"$2}' "$PKGS_DB/installed.info" > etc/tazlito/config-packages.list
al@844 35 cd ..
al@844 36 echo "etc/tazlito/config-packages.list" >> files.list
al@844 37
al@844 38 cat > receipt <<EOT
al@844 39 # SliTaz package receipt.
al@844 40
al@844 41 PACKAGE="config"
al@844 42 VERSION="$CONFIG_VERSION"
al@844 43 CATEGORY="base-system"
al@844 44 SHORT_DESC="$(_n 'User configuration backup on date %s' "$(date +"%x %X")")"
al@844 45 DEPENDS="$(ls $INSTALLED)"
al@844 46 EOT
al@844 47
al@844 48 cd ..
al@844 49 tazpkg pack "config-$CONFIG_VERSION"
al@844 50 cp "config-$CONFIG_VERSION.tazpkg" "$TOP_DIR"
al@844 51 cd "$TOP_DIR"
al@844 52 rm -rf "$TMP_DIR"