File: mixed-patch-types

package info (click to toggle)
patch 2.7.6-3%2Bdeb10u1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 6,988 kB
  • sloc: ansic: 40,033; sh: 6,547; yacc: 1,842; makefile: 140; sed: 54
file content (56 lines) | stat: -rw-r--r-- 991 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright (C) 2010-2012 Free Software Foundation, Inc.
#
# Copying and distribution of this file, with or without modification,
# in any medium, are permitted without royalty provided the copyright
# notice and this notice are preserved.

. $srcdir/test-lib.sh

require cat
use_local_patch
use_tmpdir
umask 022

# ==============================================================

cat > mixed1.diff <<EOF
diff a/f b/f
--- a/f
+++ b/f
@@ -0,0 +1 @@
+f
diff --git a/g b/g
new file mode 100644
index 0000000..01058d8
--- a/g
+++ b/g
@@ -0,0 +1 @@
+g
EOF

check 'patch --dry-run < mixed1.diff || echo "Status: $?"' <<EOF
checking file f
checking file g
EOF

# --------------------------------------------------------------

cat > mixed2.diff <<EOF
diff --git a/f b/f
new file mode 100644
index 0000000..6a69f92
--- a/f
+++ b/f
@@ -0,0 +1 @@
+f
diff a/g b/g
--- a/g
+++ b/g
@@ -0,0 +1 @@
+g
EOF

check 'patch --dry-run < mixed2.diff || echo "Status: $?"' <<EOF
checking file f
checking file g
EOF