Bug 28104 - last line of sitemapindex.xml lacks EOL
Summary: last line of sitemapindex.xml lacks EOL
Status: RESOLVED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: 20.11
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-07 08:14 UTC by Stefano Bargioni
Modified: 2023-07-01 07:25 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefano Bargioni 2021-04-07 08:14:16 UTC
$ /usr/sbin/koha-sitemap --generate instance
generates file 
/var/lib/koha/instance/sitemap/sitemapindex.xml
without the EOL of the last line. 

XML parsers can complain, e.g.:
$ xmllint --format /var/lib/koha/instance/sitemap/sitemapindex.xml 
/var/lib/koha/instance/sitemap/sitemapindex.xml:22: parser error : expected '>'
</sitemapindex>
         ^
/var/lib/koha/instance/sitemap/sitemapindex.xml:22: parser error : Premature end of data in tag sitemapindex line 3
</sitemapindex>
               ^
Comment 1 Jonathan Druart 2021-04-09 10:08:20 UTC
I don't recreate the problem. Can you provide more detail please?

$ perl debian/scripts/koha-sitemap --enable kohadev
Sitemap enabled for kohadev
$ perl debian/scripts/koha-sitemap --generate  kohadev                                                                                                                       
Sitemap directory for kohadev doesn't exist. Creating.

$ xmllint --format /var/lib/koha/kohadev/sitemap/sitemapindex.xml                                                                                                            
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>http://kohadev.myDNSname.org:8080/sitemap0001.xml</loc>
    <lastmod>2021-04-09</lastmod>
  </sitemap>
</sitemapindex>
Comment 2 Jonathan Druart 2021-04-09 10:08:30 UTC
(tested on master)
Comment 3 Stefano Bargioni 2021-04-12 08:00:25 UTC
Sorry: don't use xmllint to test it.
Use vi instead: a [noeol] message is shown at the bottom of the screen.
Anyway, this is a less than minor bug. Please, feel free to move it to trivial or even to delete it.
Comment 4 Katrin Fischer 2023-07-01 07:25:18 UTC
I can see the [noeol] note in vim, but no error in xmllint. After looking into it a bit, it doesn't seem to have any negative effect.