Hello community,
here is the log from the commit of package octave-forge-generate_html for
openSUSE:Factory checked in at 2016-09-21 18:48:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/octave-forge-generate_html (Old)
and /work/SRC/openSUSE:Factory/.octave-forge-generate_html.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "octave-forge-generate_html"
Changes:
--------
---
/work/SRC/openSUSE:Factory/octave-forge-generate_html/octave-forge-generate_html.changes
2016-06-09 16:17:39.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.octave-forge-generate_html.new/octave-forge-generate_html.changes
2016-09-21 18:48:37.000000000 +0200
@@ -1,0 +2,6 @@
+Sat Sep 17 18:49:02 UTC 2016 - [email protected]
+
+- Update to version 0.1.12
+ * New option 'older_versions_download'
+
+-------------------------------------------------------------------
Old:
----
generate_html-0.1.11.tar.gz
New:
----
generate_html-0.1.12.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ octave-forge-generate_html.spec ++++++
--- /var/tmp/diff_new_pack.P2OJih/_old 2016-09-21 18:48:39.000000000 +0200
+++ /var/tmp/diff_new_pack.P2OJih/_new 2016-09-21 18:48:39.000000000 +0200
@@ -18,7 +18,7 @@
%define octpkg generate_html
Name: octave-forge-%{octpkg}
-Version: 0.1.11
+Version: 0.1.12
Release: 0
Summary: Generate HTML web page from help texts
License: GPL-3.0+
++++++ generate_html-0.1.11.tar.gz -> generate_html-0.1.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/generate_html-0.1.11/DESCRIPTION
new/generate_html-0.1.12/DESCRIPTION
--- old/generate_html-0.1.11/DESCRIPTION 2016-05-21 22:32:35.000000000
+0200
+++ new/generate_html-0.1.12/DESCRIPTION 2016-07-14 11:01:39.000000000
+0200
@@ -1,6 +1,6 @@
Name: generate_html
-Version: 0.1.11
-Date: 2016-05-21
+Version: 0.1.12
+Date: 2016-07-14
Author: Søren Hauberg <[email protected]> and others
Maintainer: Octave-Forge community <[email protected]>
Title: Generate HTML web page from help texts
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/generate_html-0.1.11/NEWS
new/generate_html-0.1.12/NEWS
--- old/generate_html-0.1.11/NEWS 2016-05-21 22:32:35.000000000 +0200
+++ new/generate_html-0.1.12/NEWS 2016-07-14 11:01:39.000000000 +0200
@@ -1,3 +1,21 @@
+Summary of important user-visible changes for generate_html 0.1.12:
+-------------------------------------------------------------------
+
+ ** New option for generate_package_html
+
+ o generate_package_html, get_html_options: Add new field
+ 'older_versions_download' to the option structure.
+ This field makes it possible for packages to customize (or
+ suppress) the "older versions" download link, which is actually
+ Octave Forge-specific (patch #8984).
+
+ ** Changes to the package index page
+
+ o generate_package_html: The content of the optional "url" field
+ of the DESCRIPTION file is now shown beneath the news link
+ (patch #8990).
+
+
Summary of important user-visible changes for generate_html 0.1.11:
-------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/generate_html-0.1.11/inst/generate_package_html.m
new/generate_html-0.1.12/inst/generate_package_html.m
--- old/generate_html-0.1.11/inst/generate_package_html.m 2016-05-21
22:32:35.000000000 +0200
+++ new/generate_html-0.1.12/inst/generate_package_html.m 2016-07-14
11:01:39.000000000 +0200
@@ -402,8 +402,8 @@
## Read image and css references from generated files and copy images
filelist = glob (fullfile (doc_out_dir, "*.html"));
for id = 1 : numel (filelist)
- copy_images (filelist{id}, doc_root_dir, doc_out_dir);
- copy_css (filelist{id}, doc_root_dir, doc_out_dir);
+ copy_files ("image", filelist{id}, doc_root_dir, doc_out_dir);
+ copy_files ("css", filelist{id}, doc_root_dir, doc_out_dir);
endfor
endif
@@ -477,8 +477,10 @@
fprintf (fid, " class=\"download_link\">\n");
fprintf (fid, " Download Package\n");
fprintf (fid, " </a><br />\n");
- fprintf (fid, " <a
href=\"http://sourceforge.net/projects/octave/files/\"");
- fprintf (fid, " class=\"older_versions_download\">(older
versions)</a>\n");
+ if (! isempty (options.older_versions_download))
+ fprintf (fid, " <a href=\"%s\"\n", options.older_versions_download);
+ fprintf (fid, " class=\"older_versions_download\">(older
versions)</a>\n");
+ end
fprintf (fid, " </td></tr></table>\n");
fprintf (fid, "</div>\n");
endif
@@ -512,6 +514,9 @@
fprintf (fid, " </a>\n");
fprintf (fid, " </td></tr>\n");
endif
+ if (isfield (list, "url")) && (! isempty (list.url))
+ index_write_homepage_links (fid, list.url);
+ endif
fprintf (fid, " </table>\n");
fprintf (fid, "</div>\n");
fprintf (fid, "</td></tr>\n");
@@ -612,73 +617,52 @@
endfunction
-function copy_images (file, doc_root_dir, doc_out_dir)
-
- if ((fid = fopen (file)) < 0)
- error ("Couldn't open %s for reading", file);
- endif
- while (! isnumeric (l = fgetl (fid)))
- m = regexp (l, "<(?:img.+?src|object.+?data)=""([^""]+)"".*?>", "tokens");
- for i = 1 : numel (m)
- url = m{i}{1};
- ## exclude external links
- if (isempty (strfind (url, "//")))
- if (! isempty (strfind (url, "..")))
- warning ("not copying image %s because path contains '..'",
- url);
- else
- if (! isempty (imgdir = fileparts (url)) &&
- ! strcmp (imgdir, "./") &&
- ! exist (imgoutdir = fullfile (doc_out_dir, imgdir), "dir"))
- [succ, msg] = mkdir (imgoutdir);
- if (!succ)
- error ("Unable to create directory %s:\n %s", imgoutdir, msg);
- endif
- endif
- if (! ([status, msg] = copyfile (fullfile (doc_root_dir, url),
- fullfile (doc_out_dir, url))))
- warning ("could not copy image file %s: %s", url, msg);
- endif
- endif
- endif
- endfor
- endwhile
- fclose (fid);
-
-endfunction
-
+function copy_files (filetype, file, doc_root_dir, doc_out_dir)
-function copy_css (file, doc_root_dir, doc_out_dir)
+ switch filetype
+ case "image"
+ pattern = "<(?:img.+?src|object.+?data)=""([^""]+)"".*?>";
+ case "css"
+ pattern = "<(?:link
rel=\"stylesheet\".+?href|object.+?data)=""([^""]+)"".*?>";
+ otherwise
+ error ("copy_files: invalid file type");
+ endswitch
if ((fid = fopen (file)) < 0)
error ("Couldn't open %s for reading", file);
endif
- while (! isnumeric (l = fgetl (fid)))
- m = regexp (l, "<(?:link
rel=\"stylesheet\".+?href|object.+?data)=""([^""]+)"".*?>", "tokens");
- for i = 1 : numel (m)
- url = m{i}{1};
- ## exclude external links
- if (isempty (strfind (url, "//")))
- if (! isempty (strfind (url, "..")))
- warning ("not copying css %s because path contains '..'",
- url);
- else
- if (! isempty (imgdir = fileparts (url)) &&
- ! strcmp (imgdir, "./") &&
- ! exist (imgoutdir = fullfile (doc_out_dir, imgdir), "dir"))
- [succ, msg] = mkdir (imgoutdir);
- if (!succ)
- error ("Unable to create directory %s:\n %s", imgoutdir, msg);
+ unwind_protect
+ while (! isnumeric (l = fgetl (fid)))
+ m = regexp (l, pattern, "tokens");
+ for i = 1 : numel (m)
+ url = m{i}{1};
+ ## exclude external links
+ if (isempty (strfind (url, "//")))
+ if (! isempty (strfind (url, "..")))
+ warning ("not copying %s %s because path contains '..'",
+ filetype, url);
+ else
+ if (! isempty (imgdir = fileparts (url)) &&
+ ! strcmp (imgdir, "./") &&
+ ! exist (imgoutdir = fullfile (doc_out_dir, imgdir), "dir"))
+ [succ, msg] = mkdir (imgoutdir);
+ if (!succ)
+ error ("Unable to create directory %s:\n %s", imgoutdir, msg);
+ endif
+ endif
+ if (isempty (glob (src = fullfile (doc_root_dir, url))))
+ warning ("%s file %s not present, not copied",
+ filetype, url);
+ elseif (! ([status, msg] = copyfile (src,
+ fullfile (doc_out_dir, url))))
+ warning ("could not copy %s file %s: %s", filetype, url, msg);
endif
- endif
- if (! ([status, msg] = copyfile (fullfile (doc_root_dir, url),
- fullfile (doc_out_dir, url))))
- warning ("could not copy css file %s: %s", url, msg);
endif
endif
- endif
- endfor
- endwhile
- fclose (fid);
+ endfor
+ endwhile
+ unwind_protect_cleanup
+ fclose (fid);
+ end_unwind_protect
endfunction
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/generate_html-0.1.11/inst/get_html_options.m
new/generate_html-0.1.12/inst/get_html_options.m
--- old/generate_html-0.1.11/inst/get_html_options.m 2016-05-21
22:32:35.000000000 +0200
+++ new/generate_html-0.1.12/inst/get_html_options.m 2016-07-14
11:01:39.000000000 +0200
@@ -1,5 +1,6 @@
## Copyright (C) 2008 Soren Hauberg <[email protected]>
## Copyright (C) 2014-2016 Julien Bect <[email protected]>
+## Copyright (C) 2016 Fernando Pujaico Rivera
<[email protected]>
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
@@ -109,6 +110,7 @@
## Download link to be inserted on the main package page (index.html)
## Leave empty for no download link
default.download_link = "";
+ default.older_versions_download = "";
## Create package licence page ?
default.include_package_license = false;
@@ -284,6 +286,7 @@
## Options for index package
options.index_title = "The '%name' Package";
options.download_link =
"http://downloads.sourceforge.net/octave/%name-%version.tar.gz?download";
+ options.older_versions_download =
"http://sourceforge.net/projects/octave/files/";
options.include_package_page = true;
options.include_package_license = true;
options.include_package_news = true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/generate_html-0.1.11/inst/private/index_write_homepage_links.m
new/generate_html-0.1.12/inst/private/index_write_homepage_links.m
--- old/generate_html-0.1.11/inst/private/index_write_homepage_links.m
1970-01-01 01:00:00.000000000 +0100
+++ new/generate_html-0.1.12/inst/private/index_write_homepage_links.m
2016-07-14 11:01:39.000000000 +0200
@@ -0,0 +1,43 @@
+## Copyright (C) 2016 Julien Bect <[email protected]>
+## Copyright (C) 2016 Fernando Pujaico Rivera
<[email protected]>
+##
+## This program is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; see the file COPYING. If not, see
+## <http://www.gnu.org/licenses/>.
+
+function index_write_homepage_links (fid, url_list)
+
+## Process url list
+C = strsplit (url_list, ",");
+C = cellfun (@strtrim, C, 'UniformOutput', false);
+L = length (C);
+
+for k = 1:L
+
+ fprintf (fid, " <tr><td>\n");
+ fprintf (fid, " <img src=\"../homepage.png\" alt=\"Package homepage
icon\"/>\n");
+ fprintf (fid, " </td><td>\n");
+ fprintf (fid, " <a href=\"%s\" class=\"homepage_link\">\n", C{k});
+
+ if L == 1
+ fprintf (fid, " Homepage\n");
+ else
+ fprintf (fid, " Homepage #%d\n", k);
+ endif
+
+ fprintf (fid, " </a>\n");
+ fprintf (fid, " </td></tr>\n");
+
+ endfor
+
+endfunction