File: 02_remove_unused_bindump.dpatch

package info (click to toggle)
pythoncad 0.1.23-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,044 kB
  • ctags: 3,568
  • sloc: python: 54,867; sh: 100; makefile: 39
file content (111 lines) | stat: -rw-r--r-- 2,837 bytes parent folder | download | duplicates (3)
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
#! /bin/sh -e
## 02_remove_unused_bindump.dpatch by Cdric Delfosse <cedric@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Remove this python executable that has no purpose (for the moment) and
## DP: triggers a Lintian warning

if [ $# -lt 1 ]; then
    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"

case "$1" in
    -patch) patch -p1 ${patch_opts} < $0;;
    -unpatch) patch -R -p1 ${patch_opts} < $0;;
    *)
        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
        exit 1;;
esac

exit 0

@DPATCH@
diff -urNad pythoncad-0.1.19/PythonCAD/Generic/bindump.py /tmp/dpep.onEldl/pythoncad-0.1.19/PythonCAD/Generic/bindump.py
--- pythoncad-0.1.19/PythonCAD/Generic/bindump.py	2004-09-29 23:02:36.000000000 +0200
+++ /tmp/dpep.onEldl/pythoncad-0.1.19/PythonCAD/Generic/bindump.py	1970-01-01 01:00:00.000000000 +0100
@@ -1,81 +0,0 @@
-#!/usr/bin/python
-#
-# simply binary dump
-#
-
-import sys
-import array
-
-if len(sys.argv) < 4:
-    print "bindump.py file offset count"
-    sys.exit(1)
-else:
-    try:
-        _fname = file(sys.argv[1])
-    except:
-        print "invalid file: " + sys.argv[1]
-        sys.exit(1)
-    try:
-        _offset = int(sys.argv[2])
-    except:
-        print "invalid offset: " + sys.argv[2]
-        sys.exit(1)
-    if _offset < 0:
-        print "invalid offset: %d" % _offset
-        sys.exit(1)
-    try:
-        _count = int(sys.argv[3])
-    except:
-        print "invalid byte count: " + sys.argv[3]
-        sys.exit(1)
-    if _count < 0:
-        print "invalid byte count: %d" % _count
-        sys.exit(1)
-
-print "opening file: " + _fname.name
-print "offset: %d" % _offset
-print "count: %d" % _count 
-
-try:
-    _fname.seek(_offset, 0)
-except:
-    _fname.close()
-    print "invalid offset into file: %d" % _offset
-    sys.exit(1)
-
-_data = array.array('B')
-try:
-    _data.fromfile(_fname, _count)
-except:
-    _fname.close()
-    print "invalid read of %d bytes from file: %s" % (_count, _fname.name)
-    sys.exit(1)
-
-_fname.close()
-
-_patterns = [
-    '0 0 0 0', # 0
-    '0 0 0 1', # 1
-    '0 0 1 0', # 2
-    '0 0 1 1', # 3
-    '0 1 0 0', # 4
-    '0 1 0 1', # 5
-    '0 1 1 0', # 6
-    '0 1 1 1', # 7
-    '1 0 0 0', # 8
-    '1 0 0 1', # 9
-    '1 0 1 0', # A
-    '1 0 1 1', # B
-    '1 1 0 0', # C
-    '1 1 0 1', # D
-    '1 1 1 0', # E
-    '1 1 1 1'  # F
-    ]
-
-_i = 0
-while (_i < _count):
-    _bitoffset = _i * 8
-    _nib1 = _patterns[((_data[_i] & 0xf0) >> 4)]
-    _nib2 = _patterns[(_data[_i] & 0x0f)]
-    print "%d [%d]: 0x%02x %s %s" % (_i, _bitoffset, _data[_i], _nib1, _nib2)
-    _i = _i + 1