File: 02_create_patch.sh

package info (click to toggle)
dpatch 2.0.38%2Bnmu1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 676 kB
  • sloc: sh: 1,013; makefile: 225; awk: 57; perl: 17
file content (33 lines) | stat: -rwxr-xr-x 973 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
##: check generation of initial patch
##: Bug#321320: also check the generated patch file
# Junichi Uekawa 19 June 2005, updated 6 Aug 2005.
set -e

cd $PKGPATH

echo 'echo this-is-a-line > one1 ' | dpatch-edit-patch 01_edpatch
echo 01_edpatch > debian/patches/00list
debian/rules patch

echo '=== check file one1 contains the right content'
[ `cat one1` = this-is-a-line ]
debian/rules unpatch

echo '=== check file one1 does not exist'
[ ! -f one1 ]

# additional checks; try creating a patch file.
echo "cp -p ${SOURCE_DIR}/02_create_patch.sh . " | dpatch-edit-patch 02_create_two
cp debian/patches/02_create_two.dpatch{,~~}
echo "exit 0" | dpatch-edit-patch 02_create_two

# 'patch' will update the timestamp. The following command 
# should output '11', not 0.

if diff -u debian/patches/02_create_two.dpatch{~~,} > /dev/null; then
    :
else
    echo 'diff gives zero output; date should have changed'
    cat  debian/patches/02_create_two.dpatch{~~,}
fi