~ubuntu-branches/ubuntu/jaunty/plotutils/jaunty

« back to all changes in this revision

Viewing changes to debian/backup.sh

  • Committer: Bazaar Package Importer
  • Author(s): Floris Bruynooghe
  • Date: 2006-06-10 22:30:09 UTC
  • mfrom: (3.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20060610223009-lfgb9ceyzjykj3z1
Tags: 2.4.1-15
* 14_manpage_spline.dpatch: correct long option of -n (Closes: #247208).
* debian/control: changed maintainer email address, old will expire soon.
* Changed libpng12-0-dev (virtual) to libpng12-dev (real) in Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Copyright (c) 2005 Floris Bruynooghe
 
4
# This file is copylefted under the GPL
 
5
 
 
6
# Backups all files generated by the autotools.  When called with the '-r'
 
7
# option it restores these files.
 
8
# This is achieved by copying the files into a $BACDIR directory
 
9
# and moving them back.
 
10
 
 
11
# The directory used for the backup
 
12
bacdir=debian/atbackup
 
13
 
 
14
# This variable controls which files are backed up.
 
15
autofiles="acconfig.h aclocal.m4 config.guess config.sub config.h.in \
 
16
                configure install-sh ltconfig ltmain.sh missing \
 
17
                mkinstalldirs stamp-h.in INSTALL info/texinfo.tex \
 
18
                info/plotutils.info \
 
19
                $(find -name Makefile.in ! -regex '.*debian/atbackup.*')"
 
20
 
 
21
 
 
22
if [ "$1" = "" ]; then
 
23
        if [ -d ${bacdir} ]; then
 
24
                echo "$0: ERROR: backup direcotry exitst!"
 
25
                echo "$0: ERROR: run '$0 -r' first"
 
26
                exit 1
 
27
        fi
 
28
        mkdir ${bacdir}
 
29
        echo "$0: backing up upstreams autotooled files"
 
30
        for file in ${autofiles}; do
 
31
                if [ X$DH_VERBOSE = X1 ]; then
 
32
                        echo "$0: moving ${file}"
 
33
                fi
 
34
                mkdir -p ${bacdir}/$(dirname ${file})
 
35
                mv "${file}" "${bacdir}/${file}"
 
36
        done
 
37
elif [ "$1" = "-r" ]; then
 
38
        if [ ! -d ${bacdir} ]; then
 
39
                echo "$0: ERROR: no backup available!"
 
40
                exit 1
 
41
        fi
 
42
        echo "$0: attempting to revert to upstreams autotooled files"
 
43
        for file in ${autofiles}; do
 
44
                if [ -f "${bacdir}/${file}" ]; then
 
45
                        if [ X$DH_VERBOSE = X1 ]; then
 
46
                                echo "$0: reverting ${file}"
 
47
                        fi
 
48
                        mv "${bacdir}/${file}" "${file}"
 
49
                else
 
50
                        echo "$0: WARNING: ${file} was not in backup directory!"
 
51
                        echo "$0: WARNING: left ${file} untouched"
 
52
                fi
 
53
        done
 
54
        if [ -n "$(find ${bacdir} ! -type d)" ]; then
 
55
                echo "$0: ERROR: some backed up files where not restored"
 
56
                echo "$0: ERROR: you may want to check ${bacdir} manually"
 
57
                exit 1
 
58
        fi
 
59
        rm -rf ${bacdir}
 
60
else
 
61
        echo "USAGE: $0 [-r]"
 
62
        exit 1
 
63
fi