[pcb/f15] Bug fix for L#882712 L#699307 L#891041

Chitlesh GOORAH chitlesh at fedoraproject.org
Tue Nov 29 06:58:56 UTC 2011


commit 16f770f2ecad5c7aaa02f69f54b49c58918baec5
Author: Chitlesh GOORAH <chitlesh at fedoraproject.org>
Date:   Tue Nov 29 07:58:45 2011 +0100

    Bug fix for L#882712 L#699307 L#891041

 .gitignore                                         |    1 +
 0001-Fix-parsing-of-route-styles-with-units.patch  |   38 ++++++++++
 ...ome-instances-of-an-int-being-used-in.patch.txt |   61 +++++++++++++++++
 L-699307-mouse_scrolllbar.patch                    |   15 ++++
 pcb.spec                                           |   72 +++++++++++++++-----
 sources                                            |    2 +-
 6 files changed, 172 insertions(+), 17 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 6543e7b..242acfb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 pcb-20091103.tar.gz
 pcb-reference-card.pdf
 /pcb-20100929.tar.gz
+/pcb-20110918.tar.gz
diff --git a/0001-Fix-parsing-of-route-styles-with-units.patch b/0001-Fix-parsing-of-route-styles-with-units.patch
new file mode 100644
index 0000000..d66b49a
--- /dev/null
+++ b/0001-Fix-parsing-of-route-styles-with-units.patch
@@ -0,0 +1,38 @@
+From ab7925afcc051d42a181bcfb87289b53aa37a935 Mon Sep 17 00:00:00 2001
+From: Richard Barlow <richard at richardbarlow.co.uk>
+Date: Sat, 12 Nov 2011 01:41:47 +0000
+Subject: [PATCH] Fix parsing of route styles with units
+
+A bug appeared after route styles started being saved with units
+suffixed. When loading a PCB file the units were ignored and therefore
+it was assumed the values were in cmils.
+
+This was a problem in the get_unit_struct() function which didn't handle
+long strings well. If the unit was followed by more characters strcmp
+would return non-zero. The function has already worked out the length of
+the unit text and therefore strncmp should be used.
+---
+ src/pcb-printf.c |    6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/pcb-printf.c b/src/pcb-printf.c
+index c57a570..f687e06 100644
+--- a/src/pcb-printf.c
++++ b/src/pcb-printf.c
+@@ -182,10 +182,10 @@ const Unit *get_unit_struct (const char *const_suffix)
+     }
+ 
+   /* Do lookup */
+-  if (*suffix)
++  if (*suffix && s_len > 0)
+     for (i = 0; i < N_UNITS; ++i)
+-      if (strcmp (suffix, Units[i].suffix) == 0 ||
+-          strcmp (suffix, Units[i].alias[0]) == 0)
++      if (strncmp (suffix, Units[i].suffix, s_len) == 0 ||
++          strncmp (suffix, Units[i].alias[0], s_len) == 0)
+         {
+           g_free (m_suffix);
+           return &Units[i];
+-- 
+1.7.4.4
+
diff --git a/0001-png-hid-fixed-some-instances-of-an-int-being-used-in.patch.txt b/0001-png-hid-fixed-some-instances-of-an-int-being-used-in.patch.txt
new file mode 100644
index 0000000..2e35d18
--- /dev/null
+++ b/0001-png-hid-fixed-some-instances-of-an-int-being-used-in.patch.txt
@@ -0,0 +1,61 @@
+From ebb88edf2ef53903980244f44fe891e49d60fb76 Mon Sep 17 00:00:00 2001
+From: Dima Kogan <dima at secretsauce.net>
+Date: Wed, 16 Nov 2011 01:01:06 -0800
+Subject: [PATCH] png hid: fixed some instances of an 'int' being used instead
+ of Coord.
+
+After the unit switch, some cases where an int has sufficed previously no longer
+work. An example is png output of tilted, square pads. Before this patch those
+pads do not get drawn correctly; their size is completely wrong.
+---
+ src/hid/png/png.c |   17 ++++++++++-------
+ 1 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/src/hid/png/png.c b/src/hid/png/png.c
+index f00d407..ff8931a 100644
+--- a/src/hid/png/png.c
++++ b/src/hid/png/png.c
+@@ -70,7 +70,7 @@ static int show_solder_side;
+ #define SCALE(w)   ((int)((w)/scale + 0.5))
+ #define SCALE_X(x) ((int)(((x) - x_shift)/scale))
+ #define SCALE_Y(y) ((int)(((show_solder_side ? (PCB->MaxHeight-(y)) : (y)) - y_shift)/scale))
+-#define SWAP_IF_SOLDER(a,b) do { int c; if (show_solder_side) { c=a; a=b; b=c; }} while (0)
++#define SWAP_IF_SOLDER(a,b) do { Coord c; if (show_solder_side) { c=a; a=b; b=c; }} while (0)
+ 
+ /* Used to detect non-trivial outlines */
+ #define NOT_EDGE_X(x) ((x) != 0 && (x) != PCB->MaxWidth)
+@@ -634,8 +634,9 @@ png_do_export (HID_Attr_Val * options)
+   int save_ons[MAX_LAYER + 2];
+   int i;
+   BoxType *bbox;
+-  int w, h;
+-  int xmax, ymax, dpi;
++  Coord w, h;
++  Coord xmax, ymax;
++  int dpi;
+   const char *fmt;
+   bool format_error = false;
+ 
+@@ -1493,13 +1494,15 @@ png_draw_line (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+        * it as a filled polygon.
+        */
+       int fg = gdImageColorResolve (im, gc->color->r, gc->color->g,
+-				    gc->color->b),
+-	w = gc->width, dx = x2 - x1, dy = y2 - y1, dwx, dwy;
++				    gc->color->b);
++      Coord w = gc->width;
++      Coord dwx, dwy;
++
+       gdPoint p[4];
+-      double l = sqrt (dx * dx + dy * dy) * 2;
++      double l = Distance(x1, y1, x2, y2) * 2;
+ 
+       w += 2 * bloat;
+-      dwx = -w / l * dy; dwy =  w / l * dx;
++      dwx = -w / l * (y2 - y1); dwy =  w / l * (x2 - x1);
+       p[0].x = SCALE_X (x1 + dwx - dwy); p[0].y = SCALE_Y(y1 + dwy + dwx);
+       p[1].x = SCALE_X (x1 - dwx - dwy); p[1].y = SCALE_Y(y1 - dwy + dwx);
+       p[2].x = SCALE_X (x2 - dwx + dwy); p[2].y = SCALE_Y(y2 - dwy - dwx);
+-- 
+1.7.7
+
diff --git a/L-699307-mouse_scrolllbar.patch b/L-699307-mouse_scrolllbar.patch
new file mode 100644
index 0000000..1220c17
--- /dev/null
+++ b/L-699307-mouse_scrolllbar.patch
@@ -0,0 +1,15 @@
+X-Git-Url: http://git.gpleda.org/?p=pcb.git;a=blobdiff_plain;f=src%2Fhid%2Fgtk%2Fgtkhid-main.c;h=a83ee2efc54d1bd2703b3e1fa2f6a69dcce7ec48;hp=9b239e1069855af4240314775ba031825c1449e2;hb=ed9a9d0cd9d054e6fc4a075ec1b8d9a12f1cb376;hpb=cd3bd7f15384402983e71c6673678ce614a3898f
+
+diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
+index 9b239e1..a83ee2e 100644
+--- a/src/hid/gtk/gtkhid-main.c
++++ b/src/hid/gtk/gtkhid-main.c
+@@ -2030,7 +2030,7 @@ HID_Action ghid_main_action_list[] = {
+   {"LayerGroupsChanged", 0, LayerGroupsChanged},
+   {"LibraryChanged", 0, LibraryChanged},
+   {"Load", 0, Load},
+-  {"Pan", N_("Click on a place to pan"), PanAction, pan_help, pan_syntax},
++  {"Pan", 0, PanAction, pan_help, pan_syntax},
+   {"PCBChanged", 0, PCBChanged},
+   {"PointCursor", 0, PointCursor},
+   {"Popup", 0, Popup, popup_help, popup_syntax},
diff --git a/pcb.spec b/pcb.spec
index dc17ca0..bbfc37b 100644
--- a/pcb.spec
+++ b/pcb.spec
@@ -1,8 +1,10 @@
-%global         pcbver    20100929
+# Features in Fedora/Free Electronic Lab
+
+%global         pcbver    20110918
 
 Name:           pcb
 Version:        0.%{pcbver}
-Release:        2%{?dist}
+Release:        3%{?dist}
 
 Summary:        An interactive printed circuit board editor
 License:        GPLv2
@@ -13,12 +15,28 @@ BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  tcl, bison, flex, gawk, ImageMagick, gtk2-devel, gd-devel, fontconfig-devel
 BuildRequires:  cups, tetex-latex, libICE-devel, desktop-file-utils, intltool, gettext-devel
 BuildRequires:  dbus-devel
+BuildRequires:  mesa-libGLU-devel gtkglext-devel
+BuildRequires:  intltool
+# Testsuite
+# 2011-11-29 Disabling testsuite as rawhide has a broken libgmp.so.3
+# BuildRequires:  gerbv geda-gaf
 
 Requires:       m4
 Requires:       electronics-menu
 
 Source0:        http://downloads.sourceforge.net/sourceforge/%{name}/%{name}-%{pcbver}.tar.gz
 
+# L#882712 Route styles are not properly loaded after nm conversion
+# Affected 0.20110918, reported on 2011-10-27
+Patch0:         0001-Fix-parsing-of-route-styles-with-units.patch
+
+# L#699307 Panning problem when mouse button is released on scrollbar (sf-2923335)
+# Affected 0.20110918, patch from upstream's git repo, reported 2009-12-30
+Patch1:         L-699307-mouse_scrolllbar.patch
+
+# L#891041 PNG export broken for tilted, square pads
+# Affected 0.20110918, reported on 2011-11-16 - Upstream has been patched on 2011-11-20
+Patch2:         0001-png-hid-fixed-some-instances-of-an-int-being-used-in.patch.txt
 
 %description
 PCB is an interactive printed circuit board editor.
@@ -28,6 +46,10 @@ output for use in the board fabrication and assembly process. PCB offers
 high end features such as an autorouter and trace optimizer which can
 tremendously reduce layout time.
 
+# rpmlint warnings ignored:
+# pcb.src: W: spelling-error %description -l en_US centroid -> centrist
+# pcb.src: W: spelling-error %description -l en_US autorouter -> auto router, auto-router, autoworker
+
 
 %package doc
 Summary:         Documentation for PCB, An interactive printed circuit board editor
@@ -37,7 +59,7 @@ Requires(post):  info
 Requires(preun): info
 
 %description doc
-This package contains the documentation of PCB, An interactive printed circuit
+This package contains the documentation of PCB, an interactive printed circuit
 board editor.
 
 
@@ -52,6 +74,10 @@ board editor.
    's|tutdir = $(pkgdatadir)/tutorial|tutdir = @docdir@/tutorial|' \
    tutorial/Makefile.*
 
+%patch0 -p1 -b -L882712
+%patch1 -p1 -b -L699307
+%patch2 -p1 -b -L891041
+
 %build
 export WISH=%{_bindir}/wish
 
@@ -126,19 +152,22 @@ cp -p AUTHORS COPYING README NEWS ChangeLog README_FILES/CHANGES \
 
 %{__rm} -rf %{buildroot}%{_datadir}/info/dir
 
-mv doc/refcard.pdf %{buildroot}%{_docdir}/%{name}-%{version}/pcb-reference-card.pdf
+mv %{buildroot}%{_docdir}/%{name}-%{version}/refcard.pdf %{buildroot}%{_docdir}/%{name}-%{version}/pcb-reference-card.pdf
 
 # remove duplicates
 %{__rm} -f %{buildroot}%{_bindir}/Merge*
 
+# L#854396 0.20110918 needlessly installs gts static library & header file
+%{__rm} -f %{buildroot}%{_libdir}/libgts.a %{buildroot}%{_includedir}/gts.h
 
 # locale's
 %find_lang %{name}
 
 
-%check
-%{__make} check
-
+#check
+#{__make} check
+# L#860037 0.20100929 hid_png3 test fails on i386 arch
+# 2011-11-12 FAILED:  See outputs/hid_png3/mismatch
 
 %clean
 %{__rm} -rf %{buildroot}
@@ -174,21 +203,20 @@ fi
 %files doc
 %{_infodir}/%{name}*
 %doc %{_docdir}/%{name}-%{version}/pcb-reference-card.pdf
-%doc %{_docdir}/%{name}-%{version}/pcb.ps
+%doc %{_docdir}/%{name}-%{version}/pcb.pdf
 %doc %{_docdir}/%{name}-%{version}/*.html
-%doc %{_docdir}/%{name}-%{version}/examples/thermal
-%doc %{_docdir}/%{name}-%{version}/examples/pad
-%doc %{_docdir}/%{name}-%{version}/examples/puller
+%doc %{_docdir}/%{name}-%{version}/examples/*
+%doc %{_docdir}/%{name}-%{version}/gcode*
 
 
 %files -f %{name}.lang
 %defattr(-, root, root, -)
 %exclude %{_docdir}/%{name}-%{version}/pcb-reference-card.pdf
-%exclude %{_docdir}/%{name}-%{version}/pcb.ps
+%exclude %{_docdir}/%{name}-%{version}/pcb.pdf
 %exclude %{_docdir}/%{name}-%{version}/*.html
-%exclude %{_docdir}/%{name}-%{version}/examples/thermal
-%exclude %{_docdir}/%{name}-%{version}/examples/pad
-%exclude %{_docdir}/%{name}-%{version}/examples/puller
+%exclude %{_docdir}/%{name}-%{version}/examples/*
+%exclude %{_docdir}/%{name}-%{version}/gcode*
+
 %doc %{_docdir}/%{name}-%{version}/
 %{_datadir}/applications/%{name}.desktop
 %{_bindir}/%{name}
@@ -201,7 +229,20 @@ fi
 %{_datadir}/gEDA/scheme/gnet-pcbfwd.scm
 
 
+
+
 %changelog
+* Tue Nov 29 2011 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20110918-3
+- Temporary removed geda-gaf from BR
+
+* Sun Nov 27 2011 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20110918-2
+- Bug fix L#882712 Route styles are not properly loaded after nm conversion
+- Bug fix L#699307 Panning problem when mouse button is released on scrollbar (sf-2923335)
+- Bug fix L#891041 png export broken for tilted, square pads
+
+* Sat Nov 12 2011 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20110918-1
+- New upstream release
+
 * Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.20100929-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 
@@ -287,4 +328,3 @@ fi
 
 * Wed Apr 19 2006 <pjones at redhat.com> - 0.20060414-1
 - Let there be pcb packaging.
-
diff --git a/sources b/sources
index 56f184a..5970a21 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-4c71f5d1c40ad65539957748b88eb863  pcb-20100929.tar.gz
+54bbc997eeb22b85cf21fed54cb8e181  pcb-20110918.tar.gz


More information about the scm-commits mailing list