Bug 233427

Summary: www/google-sitemapgen: local variable referenced before assignment
Product: Ports & Packages Reporter: Vladyslav Movchan <vladislav.movchan>
Component: Individual Port(s)Assignee: Tobias Kortkamp <tobik>
Status: Closed FIXED    
Severity: Affects Some People    
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch none

Description Vladyslav Movchan 2018-11-23 06:47:42 UTC
Created attachment 199471 [details]
Patch

When www/google-sitemapgen asked to build sitemap_index.xml it throws the following error:
Writing index file "sitemap_index.xml" with 13 Sitemaps
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 2092, in <module>
    sitemap.Generate()
  File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 1665, in Generate
    self.WriteIndex()
  File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 1810, in WriteIndex
    fd.write(sitemap_index_header)
UnboundLocalError: local variable 'sitemap_index_header' referenced before assignment

This caused by the typo (sitemap_index_header -> sitemap__index_header) in the source code of the upstream project. But due to upstream project is not maintained there is no way to submit this fix to upstream.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-11-23 10:16:53 UTC
A commit references this bug:

Author: tobik
Date: Fri Nov 23 10:16:15 UTC 2018
New revision: 485645
URL: https://svnweb.freebsd.org/changeset/ports/485645

Log:
  www/google-sitemapgen: Fix obvious typo

  It causes problems later:

  Writing index file "sitemap_index.xml" with 13 Sitemaps
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 2092, in <module>
      sitemap.Generate()
    File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 1665, in Generate
      self.WriteIndex()
    File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 1810, in WriteIndex
      fd.write(sitemap_index_header)
  UnboundLocalError: local variable 'sitemap_index_header' referenced before assignment

  PR:		233427
  Submitted by:	Vladislav Movchan <vladislav.movchan@gmail.com>

Changes:
  head/www/google-sitemapgen/Makefile
  head/www/google-sitemapgen/files/patch-sitemap__gen.py
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-11-23 10:27:02 UTC
A commit references this bug:

Author: tobik
Date: Fri Nov 23 10:26:25 UTC 2018
New revision: 485646
URL: https://svnweb.freebsd.org/changeset/ports/485646

Log:
  MFH: r485645

  www/google-sitemapgen: Fix obvious typo

  It causes problems later:

  Writing index file "sitemap_index.xml" with 13 Sitemaps
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 2092, in <module>
      sitemap.Generate()
    File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 1665, in Generate
      self.WriteIndex()
    File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 1810, in WriteIndex
      fd.write(sitemap_index_header)
  UnboundLocalError: local variable 'sitemap_index_header' referenced before assignment

  PR:		233427
  Submitted by:	Vladislav Movchan <vladislav.movchan@gmail.com>

  Approved by:	ports-secteam blanket

Changes:
_U  branches/2018Q4/
  branches/2018Q4/www/google-sitemapgen/Makefile
  branches/2018Q4/www/google-sitemapgen/files/patch-sitemap__gen.py