tazpkg view modules/repack-config @ rev 955

modules/search: allow search file with dash at start: tazpkg -sf "-spi"
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Dec 22 00:02:54 2017 +0200 (2017-12-22)
parents d6cbd0c5f273
children 8ca7fc7c051b
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.1'
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 boot
34 awk -F$'\t' '{print $1"-"$2}' "$PKGS_DB/installed.info" > etc/tazlito/config-packages.list
35 cat /proc/cmdline > boot/cmdline
36 cd ..
37 echo "etc/tazlito/config-packages.list" >> files.list
38 echo "boot/cmdline" >> files.list
40 cat > receipt <<EOT
41 # SliTaz package receipt.
43 PACKAGE="config"
44 VERSION="$CONFIG_VERSION"
45 CATEGORY="base-system"
46 SHORT_DESC="$(_n 'User configuration backup on date %s' "$(date +"%x %X")")"
47 DEPENDS="$(ls $INSTALLED)"
48 EOT
50 cd ..
51 tazpkg pack "config-$CONFIG_VERSION"
52 cp "config-$CONFIG_VERSION.tazpkg" "$TOP_DIR"
53 cd "$TOP_DIR"
54 rm -rf "$TMP_DIR"