Merge lp:~mtmiller/ubuntu/trusty/octave/lp1288136 into lp:ubuntu/trusty/octave

Proposed by Mike Miller
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~mtmiller/ubuntu/trusty/octave/lp1288136
Merge into: lp:ubuntu/trusty/octave
Diff against target: 141 lines (+92/-1)
6 files modified
.pc/applied-patches (+1/-0)
.pc/fix-pkg-depends-hyphen.diff/scripts/pkg/private/fix_depends.m (+67/-0)
debian/changelog (+6/-0)
debian/patches/fix-pkg-depends-hyphen.diff (+16/-0)
debian/patches/series (+1/-0)
scripts/pkg/private/fix_depends.m (+1/-1)
To merge this branch: bzr merge lp:~mtmiller/ubuntu/trusty/octave/lp1288136
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+210206@code.launchpad.net

Description of the change

This change fixes a high priority bug in the octave source package, preventing proper installation or upgrade when certain other octave-* packages are installed. I've built and tested locally on trusty, requires installing octave and octave-vrml together and ensuring the dpkg postinst script runs without error.

To post a comment you must log in.
Revision history for this message
Mike Miller (mtmiller) wrote :

FYI, octave 3.8.1-1 was just uploaded to Debian unstable. The debdiff will be much larger, which is why I proposed this patch originally. Feel free to reject this change if it would be preferable to pull the new version from Debian (with Ubuntu-specific changes reapplied).

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks Mike! I'll sponsor this fix for now. If you think that the new Debian version contains useful fixes, this can still be merged.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.pc/applied-patches'
2--- .pc/applied-patches 2014-02-25 20:41:26 +0000
3+++ .pc/applied-patches 2014-03-10 13:34:35 +0000
4@@ -11,3 +11,4 @@
5 hurd_path_max.diff
6 save-uint8-in-text-format.diff
7 always-build-octave-jar.patch
8+fix-pkg-depends-hyphen.diff
9
10=== added directory '.pc/fix-pkg-depends-hyphen.diff'
11=== added directory '.pc/fix-pkg-depends-hyphen.diff/scripts'
12=== added directory '.pc/fix-pkg-depends-hyphen.diff/scripts/pkg'
13=== added directory '.pc/fix-pkg-depends-hyphen.diff/scripts/pkg/private'
14=== added file '.pc/fix-pkg-depends-hyphen.diff/scripts/pkg/private/fix_depends.m'
15--- .pc/fix-pkg-depends-hyphen.diff/scripts/pkg/private/fix_depends.m 1970-01-01 00:00:00 +0000
16+++ .pc/fix-pkg-depends-hyphen.diff/scripts/pkg/private/fix_depends.m 2014-03-10 13:34:35 +0000
17@@ -0,0 +1,67 @@
18+## Copyright (C) 2005-2013 Søren Hauberg
19+## Copyright (C) 2010 VZLU Prague, a.s.
20+##
21+## This file is part of Octave.
22+##
23+## Octave is free software; you can redistribute it and/or modify it
24+## under the terms of the GNU General Public License as published by
25+## the Free Software Foundation; either version 3 of the License, or (at
26+## your option) any later version.
27+##
28+## Octave is distributed in the hope that it will be useful, but
29+## WITHOUT ANY WARRANTY; without even the implied warranty of
30+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31+## General Public License for more details.
32+##
33+## You should have received a copy of the GNU General Public License
34+## along with Octave; see the file COPYING. If not, see
35+## <http://www.gnu.org/licenses/>.
36+
37+## -*- texinfo -*-
38+## @deftypefn {Function File} {@var{deps_cell} =} fix_depends (@var{depends})
39+## Undocumented internal function.
40+## @end deftypefn
41+
42+## Make sure the depends field is of the right format.
43+## This function returns a cell of structures with the following fields:
44+## package, version, operator
45+function deps_cell = fix_depends (depends)
46+ deps = strtrim (ostrsplit (tolower (depends), ","));
47+ deps_cell = cell (1, length (deps));
48+ dep_pat = ...
49+ '\s*(?<name>\w+)+\s*(\(\s*(?<op>[<>=]+)\s*(?<ver>\d+\.\d+(\.\d+)*)\s*\))*\s*';
50+
51+ ## For each dependency.
52+ for i = 1:length (deps)
53+ dep = deps{i};
54+ [start, nm] = regexp (dep, dep_pat, 'start', 'names');
55+ ## Is the dependency specified
56+ ## in the correct format?
57+ if (! isempty (start))
58+ package = tolower (strtrim (nm.name));
59+ ## Does the dependency specify a version
60+ ## Example: package(>= version).
61+ if (! isempty (nm.ver))
62+ operator = nm.op;
63+ if (! any (strcmp (operator, {">", ">=", "<=", "<", "=="})))
64+ error ("unsupported operator: %s", operator);
65+ endif
66+ version = fix_version (nm.ver);
67+ ## If no version is specified for the dependency
68+ ## we say that the version should be greater than
69+ ## or equal to "0.0.0".
70+ else
71+ package = tolower (strtrim (dep));
72+ operator = ">=";
73+ version = "0.0.0";
74+ endif
75+ deps_cell{i} = struct ("package", package,
76+ "operator", operator,
77+ "version", version);
78+ else
79+ error ("incorrect syntax for dependency '%s' in the DESCRIPTION file\n",
80+ dep);
81+ endif
82+ endfor
83+endfunction
84+
85
86=== modified file 'debian/changelog'
87--- debian/changelog 2014-02-26 16:39:01 +0000
88+++ debian/changelog 2014-03-10 13:34:35 +0000
89@@ -1,3 +1,9 @@
90+octave (3.8.0-5ubuntu5) trusty; urgency=medium
91+
92+ * Fix installing packages where dependency name contains '-'. (LP: #1288136)
93+
94+ -- Mike Miller <mtmiller@debian.org> Mon, 10 Mar 2014 09:11:34 -0400
95+
96 octave (3.8.0-5ubuntu4) trusty; urgency=medium
97
98 * Build again with default optimization on ppc64el.
99
100=== added file 'debian/patches/fix-pkg-depends-hyphen.diff'
101--- debian/patches/fix-pkg-depends-hyphen.diff 1970-01-01 00:00:00 +0000
102+++ debian/patches/fix-pkg-depends-hyphen.diff 2014-03-10 13:34:35 +0000
103@@ -0,0 +1,16 @@
104+Description: Fix installing packages where dependency name contains '-'
105+Origin: upstream, http://hg.savannah.gnu.org/hgweb/octave/rev/442bca7dea44
106+Bug: http://savannah.gnu.org/bugs/?41087
107+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1288136
108+
109+--- a/scripts/pkg/private/fix_depends.m
110++++ b/scripts/pkg/private/fix_depends.m
111+@@ -29,7 +29,7 @@ function deps_cell = fix_depends (depend
112+ deps = strtrim (ostrsplit (tolower (depends), ","));
113+ deps_cell = cell (1, length (deps));
114+ dep_pat = ...
115+- '\s*(?<name>\w+)+\s*(\(\s*(?<op>[<>=]+)\s*(?<ver>\d+\.\d+(\.\d+)*)\s*\))*\s*';
116++ '\s*(?<name>[-\w]+)\s*(\(\s*(?<op>[<>=]+)\s*(?<ver>\d+\.\d+(\.\d+)*)\s*\))*\s*';
117+
118+ ## For each dependency.
119+ for i = 1:length (deps)
120
121=== modified file 'debian/patches/series'
122--- debian/patches/series 2014-02-25 20:41:26 +0000
123+++ debian/patches/series 2014-03-10 13:34:35 +0000
124@@ -11,3 +11,4 @@
125 hurd_path_max.diff
126 save-uint8-in-text-format.diff
127 always-build-octave-jar.patch
128+fix-pkg-depends-hyphen.diff
129
130=== modified file 'scripts/pkg/private/fix_depends.m'
131--- scripts/pkg/private/fix_depends.m 2013-12-20 20:49:52 +0000
132+++ scripts/pkg/private/fix_depends.m 2014-03-10 13:34:35 +0000
133@@ -29,7 +29,7 @@
134 deps = strtrim (ostrsplit (tolower (depends), ","));
135 deps_cell = cell (1, length (deps));
136 dep_pat = ...
137- '\s*(?<name>\w+)+\s*(\(\s*(?<op>[<>=]+)\s*(?<ver>\d+\.\d+(\.\d+)*)\s*\))*\s*';
138+ '\s*(?<name>[-\w]+)\s*(\(\s*(?<op>[<>=]+)\s*(?<ver>\d+\.\d+(\.\d+)*)\s*\))*\s*';
139
140 ## For each dependency.
141 for i = 1:length (deps)

Subscribers

People subscribed via source and target branches

to all changes: