summaryrefslogtreecommitdiff
path: root/usr/src/common/libdrm/Check-patches
blob: 02a212e86df6bcbc1ca4ff14191f52f03a8944fa (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/sh

# Copyright 2015 Gordon W. Ross
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, provided that the above
# copyright notice(s) and this permission notice appear in all copies of
# the Software and that both the above copyright notice(s) and this
# permission notice appear in supporting documentation.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# 
# Except as contained in this notice, the name of a copyright holder
# shall not be used in advertising or otherwise to promote the sale, use
# or other dealings in this Software without prior written authorization
# of the copyright holder.

#
# This is a convenience script for checking that your patches represent
# all the differences between the checked out libdrm and a reference copy.
# The only differences shown should be the name/date lines at the start of
# each per-file section, i.e.
#
# 29,31c29,31
# < index 8adb9d5..f9bedd0 100644
# < --- a/include/drm/drm.h	2016-04-28 03:44:16.000000000 +0300
# < +++ b/include/drm/drm.h	2016-05-24 10:27:22.341573589 +0300
# ---
# > diff ... libdrm-2.4.71/include/drm/drm.h
# > --- libdrm-2.4.71-ref/include/drm/drm.h	Thu Apr 21 09:40:06 2016
# > +++ libdrm-2.4.71/include/drm/drm.h	Sat Nov 19 21:07:12 2016
#
# Check out a "reference" copy of the same version of libdrm
# (i.e. libdrm-2.4.71-ref below) before you run this.
#
# When developing, re-run this, and/or re-run diffs like:
# diff {libdrm-2.4.71,libdrm-2.4.71-ref}/somedir/somefile.c
# and use that to update the patches.
#
# One big patch might be easier than all this...
# but for now the patches are split up as shown below.

ref=libdrm-2.4.75-ref
dir=libdrm-2.4.75

# You make this directory by hand.  Not doing this automatically
# because I want to make srue you to know it's being written into.
chk=checkpatch

diff_ref() {
# echo find "${@:-.}" -type f -print
( cd $dir && find "${@:-.}" -type f -print) |
 sed -e 's:^./::' | sort |
while read f
do
  cmp -s $ref/$f $dir/$f || {
    echo diff ... $dir/$f
    diff -u $ref/$f $dir/$f
  }
done
}



echo patches/etnaviv.patch
diff_ref etnaviv -name '*.[ch]' > $chk/etnaviv.patch

echo patches/exynos.patch
diff_ref exynos tests/exynos -name '*.[ch]' > $chk/exynos.patch

echo patches/freedreno.patch
diff_ref freedreno -name '*.c' > $chk/freedreno.patch

echo patches/intel-drm.patch
diff_ref intel -name '*.c' > $chk/intel-drm.patch

echo patches/omap.patch
diff_ref omap -name '*.c' > $chk/omap.patch

echo patches/pkgconfig-in.patch
diff_ref . -name '*.pc.in' > $chk/pkgconfig-in.patch

echo patches/incl-drm-drm-h.patch
( head -27 patches/incl-drm-drm-h.patch ;
  diff_ref include/drm/drm.h ) > $chk/incl-drm-drm-h.patch

echo patches/incl-drm-i915-drm-h.patch
( head -27 patches/incl-drm-i915-drm-h.patch ;
  diff_ref include/drm/i915_drm.h ) > $chk/incl-drm-i915-drm-h.patch

echo patches/libdrm-lists-h.patch
diff_ref libdrm_lists.h > $chk/libdrm-lists-h.patch

echo patches/util-double-list-h.patch
diff_ref util_double_list.h > $chk/util-double-list-h.patch

echo patches/util-math-h.patch
diff_ref util_math.h > $chk/util-math-h.patch

echo patches/xf86drm-c.patch
diff_ref xf86drm.c > $chk/xf86drm-c.patch

echo patches/xf86drm-h.patch
( head -27 patches/xf86drm-h.patch ;
  diff_ref xf86drm.h ) > $chk/xf86drm-h.patch

echo patches/xf86drmMode-c.patch
diff_ref xf86drmMode.c > $chk/xf86drmMode-c.patch


diff -r patches $chk