tazpkg view modules/repack-config @ rev 884

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