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

 
 

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

Submitted by:  Oliver Heimlich <oheim>
Submitted on:  Fri 15 May 2015 04:12:22 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: None
Originator Name: Oliver HeimlichOpen/Closed: Closed
Release: otherOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission 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:

(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.

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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 16 Jul 2015 10:38:47 AM UTCcarandraugStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Fri 15 May 2015 04:12:22 PM UTCoheimCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1