bugGNU Octave - Bugs: bug #45111, generate_package_html fails on...

 
 

bug #45111: generate_package_html fails on second run if package_doc contains images

Submitter:  Oliver Heimlich <oheim>
Submitted:  Fri 15 May 2015 04:12:22 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Oliver Heimlich Open/Closed:  * Closed
Release:  * other Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 16 Jul 2015 06:10:27 AM UTC, comment #8: 

This bug report can be closed.

Julien Bect <jbect>
Thu 16 Jul 2015 05:40:03 AM UTC, comment #7: 

Julien, your latest patch resolves it nicely.

All known problems with old files are now gone, and it is safe to not delete the output directory.  :-)

A warning would now be a false positive, you may put that idea aside.

Thanks
Oliver

Oliver Heimlich <oheim>
Thu 16 Jul 2015 04:55:28 AM UTC, comment #6: 

Hello Oliver,

I have pushed a new patch that makes image numbering reproducible.

I don't like the idea of deleting a directory automatically, without the user's consent. Perhaps could we, instead, produce a warning if the directory already exists ?

@++
Julien

Julien Bect <jbect>
Wed 15 Jul 2015 10:47:28 PM UTC, comment #5: 

Maybe it is easier and more robust to just delete the output directory in generate_package_html as a first step.  Everything is generated from scratch anyway.

If you keep an existing directory, there will also be problems with old functions which have been removed from the INDEX file and so on…

However, I don't know if this would mess with peoples build chains.

Oliver Heimlich <oheim>
Wed 15 Jul 2015 09:20:56 PM UTC, comment #4: 

I just realized that my second patch doesn't solve the problem of duplicated image files. I will implement something better tomorrow.

Julien Bect <jbect>
Wed 15 Jul 2015 08:13:10 PM UTC, comment #3: 

Hello Oliver,

I have pushed two patches, tell me if it's ok for you.

@++
Julien

Julien Bect <jbect>
Wed 15 Jul 2015 06:43:20 PM UTC, comment #2: 

It no longer crashes with your proposed change, so it is good to create the patch.

I have worked around the issue by deleting the output directory before generate_package_html.  Now that I do not delete the output directory anymore, a different problem shows up: The “images” subdirectory of the demos for the function reference contains deprecated, duplicate images after the second run.

The following line in html_help_text/get_output could be changed and you could use a counter instead of a random number:


r = round (1000*rand ());


(Also there is a certain risk that several images for the same function produce file name conflicts)

Oliver Heimlich <oheim>
Wed 15 Jul 2015 06:43:50 AM UTC, comment #1: 

Hello Oliver,

The following simple fix seems to do the job: replace "*" by "*.html" in the glob argument.

Can you check that it works for you?

If it's ok I'll prepare a patch.

@++
Julien

Julien Bect <jbect>
Fri 15 May 2015 04:12:22 PM UTC, original submission:  

If generate_package_html has already been run once, the following code adds the already existing image subdirectories to the filelist in the second run.

    ## Read image references from generated files and copy images
    filelist = glob (fullfile (doc_out_dir, "*"));
    for id = 1 : numel (filelist)
      copy_images (filelist{id}, doc_root_dir, doc_out_dir);
    endfor


Then, the copy_images function fails during fopen (file), because “file” actually denotes a directory.

Maybe the doc_out_dir should be cleared before each run.


Oliver Heimlich <oheim>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jbect (Posted a comment)
  • -email is unavailable- added by oheim (Submitted the item)
  • -email is unavailable- added by oheim
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-07-16 carandraug StatusNone Fixed
        Open/ClosedOpen Closed
    2015-05-15 oheim Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code