Re: side not found
Hi,
Holger Wansing <hwansing@mailbox.org> wrote:
> I found the problem in
> https://salsa.debian.org/webmaster-team/cron/-/blob/master/parts/7doc line 206:
>
> The if clause
>
> if [ "$(basename $page $lang.html)" = "$(basename $page)" ]; then
> pagecopy2 $lang "$pagefile" "$destdir/$(basename $page .html).$lang.html"
> ...
>
> checks if the files to be processed are html files with language extensions,
> otherwise it skips the file in question.
> In case of the file "sect.dist-upgrade.html" the 'if' does not give an EQUAL,
> because the "de.html" at the end is truncated ("de" is seen as language extension,
> not as part of the base-filename). That's why that file is not copied and is
> therefore missing on the webpage.
>
> So adding a dot like
> - if [ "$(basename $page $lang.html)" = "$(basename $page)" ]; then
> + if [ "$(basename $page .$lang.html)" = "$(basename $page)" ]; then
> ensures, that only language extensions are truncated, and everything works
> as expected.
While diffing the results of the original and the changed 7doc script, I found
that there were several more files suffering from this problem:
network-services.es.html
sect.administration-interfaces.es.html
sect.aptosid.id.html
sect.automatic-upgrades.es.html
sect.common-procedures.es.html
sect.dist-upgrade.de.html
sect.office-suites.es.html
sect.other-derivatives.es.html
sect.regular-upgrades.es.html
sect.rtc-services.es.html
sect.searching-packages.es.html
sect.user-group-databases.es.html
unix-services.es.html
... all those files, who have their language extension identical to the last
two characters of the base-filename.
And while we are at it:
the above is with the mvhtml2() stanza, but the same problem is also in the
mvhtml() and mvhtml_sphinx() stanzas (these did not make it into effect on
the webpage though). So I will fix those too.
I have attached a patch, which I will commit shortly.
Holger
--
Holger Wansing <hwansing@mailbox.org>
PGP-Fingerprint: 496A C6E8 1442 4B34 8508 3529 59F1 87CA 156E B076
diff --git a/parts/7doc b/parts/7doc
index b1e91b5..4f45e4e 100755
--- a/parts/7doc
+++ b/parts/7doc
@@ -126,7 +126,7 @@ for page in $pagepattern; do
pagefile="`readlink -f $page`"
if [ -f "$pagefile" ]; then
if [ "${addlang}" = "ADD" ]; then
- if [ "$(basename $page $lang.html)" = "$(basename $page)" ]; then
+ if [ "$(basename $page .$lang.html)" = "$(basename $page)" ]; then
# This is not *.$lang.html file but *.html
pagecopy $lang "$pagefile" "$destdir/$(basename $page .html).$lang.html"
if [ "$lang" = "en" ]; then
@@ -203,7 +203,7 @@ for page in $pagepattern; do
pagefile="`readlink -f $page`"
if [ -f "$pagefile" ]; then
if [ "${addlang}" = "ADD" ]; then
- if [ "$(basename $page $lang.html)" = "$(basename $page)" ]; then
+ if [ "$(basename $page .$lang.html)" = "$(basename $page)" ]; then
# This is not *.$lang.html file but *.html
pagecopy2 $lang "$pagefile" "$destdir/$(basename $page .html).$lang.html"
if [ "$lang" = "en" ]; then
@@ -282,7 +282,7 @@ for page in $pagepattern; do
pagefile="`readlink -f $page`"
if [ -f "$pagefile" ]; then
if [ "${addlang}" = "ADD" ]; then
- if [ "$(basename $page $lang.html)" = "$(basename $page)" ]; then
+ if [ "$(basename $page .$lang.html)" = "$(basename $page)" ]; then
# This is not *.$lang.html file but *.html
pagecopy $lang "$pagefile" "$destdir/$(basename $page .html).$lang.html"
if [ "$lang" = "en" ]; then
Reply to: