File: 21_model-detection_fix.dpatch

package info (click to toggle)
linuxinfo 1.1.8-21
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 348 kB
  • ctags: 49
  • sloc: sh: 1,729; ansic: 564; makefile: 80
file content (53 lines) | stat: -rw-r--r-- 1,573 bytes parent folder | download | duplicates (2)
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
#! /bin/sh -e
## 21_model-detection_fix.dpatch by Helge Kreutzmann <debian@helgefjell.de>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix model detection (else Pentium MMX -> Xeon!)

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

if [ $# -lt 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argum&ent"
                exit 1;;
esac

exit 0
@DPATCH@
--- linuxinfo-1.1.8-8/linuxinfo_intel.c	2004-08-09 19:24:22.000000000 +0200
+++ linuxinfo-1.1.8-local/linuxinfo_intel.c	2004-08-09 19:25:39.000000000 +0200
@@ -17,7 +17,8 @@
 	1.0.6   KRE     20040711        Added Opteron
 	1.0.7   KRE     20040726        Added Pentium M
 	1.0.8   KRE     20040809        Add further machines (Athlons, Xeons,
-					Pentium 4s, Celerons)
+					Pentium 4s, Celerons), fix detection of
+					Pentium MMX
 
 
         This is the Intel port of linuxinfo
@@ -123,12 +124,15 @@
 			if (strncmp(temp_string, "model", strlen("model")) == 0) 
 			{
 				int i = 0;
+				int found = 0;
 		
-				while (models[i] != NULL)
+				while ((models[i] != NULL)&&(!found))
 				{
 					if (strncmp(temp_string2, models[i], strlen(models[i])) == 0)
+					{
 						strcpy(model, models[++i]);
-
+						found=1;
+					}
 					i += 2;
 				}
 			}