Bug 431407

Summary: createdoctemplates.sh --check claims to check existence of xml files, but it doesn't
Product: [Translations] i18n Reporter: Alexander Potashev <aspotashev>
Component: generalAssignee: Albert Astals Cid <aacid>
Status: REPORTED ---    
Severity: normal CC: luigi.toscano
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Alexander Potashev 2021-01-10 21:37:53 UTC
SUMMARY
createdoctemplates.sh does not work with modern versions of docbookl10nhelper, expects kde-custom-l10n.xml to exist.

Modern versions of docbookl10nhelper do not generate the file kde-custom-l10n.xml anymore, see source code at https://invent.kde.org/frameworks/kdoctools/-/blob/master/src/docbookl10nhelper.cpp

However createdoctemplates.sh (https://invent.kde.org/sysadmin/l10n-scripty/-/blob/master/createdoctemplates.sh) expects that file to exist and fails otherwise, see lines 34-36:

  if test -z "${DOCBOOK_L10N_ALL}" || test -z "${DOCBOOK_L10N_CUSTOM}"; then
    echo "No custom l10n files for DocBook XSLT were found. Exiting..."
    exit 1

Same problem at https://invent.kde.org/sysadmin/l10n-scripty/-/blob/master/checkdocs.sh#L13:

  DOCBOOK_L10N_CUSTOM="$kdoctoolsdir/src/customization/xsl/kde-custom-l10n.xml"



STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Albert Astals Cid 2021-01-10 22:33:10 UTC
This one is for Luigi
Comment 2 Luigi Toscano 2021-01-10 22:54:44 UTC
Only --checks (and checkdocs.sh) doesn't work, otherwise scripty would have been totally broken. Still need to be fixed.
Comment 3 Alexander Potashev 2021-01-11 00:45:58 UTC
--check is used at https://invent.kde.org/sysadmin/l10n-scripty/-/blob/master/update_translations#L422:

    bash $scriptydir/createdoctemplates.sh --commit --check --autosvnadd


I can't explain why scripty is not broken.
Comment 4 Luigi Toscano 2021-01-14 01:16:50 UTC
Unless I read it incorrectly (and it may), test -z only checks that the string is not empty - and indeed it is not - and not for the file existence (that would be `if ! test -f ${FILE_FOO} || ! test -f ${FILE_BAR}; then`). So while the condition should be fixed, the code still works as it is.
Comment 5 Alexander Potashev 2021-01-14 02:39:11 UTC
Ah, right. Sorry for confusion.