File: postinst

package info (click to toggle)
storebackup 3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,120 kB
  • ctags: 430
  • sloc: perl: 18,058; makefile: 52; sh: 37
file content (23 lines) | stat: -rw-r--r-- 522 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

set -e

#DEBHELPER#

# upgrade backups
if [ "$1" = "configure" ]; then
    configs=`run-parts --list /etc/storebackup.d/`
    targets=`sed -ne 's/^targetDir=\(.*\)/\1/p' /dev/null $configs`
    for dir in $targets
    do
	storeBackupConvertBackup "$dir"
    done
    if dpkg --compare-versions 1.16.1 gt-nl "$2"; then
	for dir in $targets
	do
	    echo Fixing .md5CheckSums.info in "$dir"
	    perl -pe 's/^\s*uncompress=bzip2\s*$/uncompress=bzip2 -d\n/' \
		    -i "$dir"/*/.md5CheckSums.info
	done
    fi 
fi