[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnutls-dev
Subject:    Re: [gnutls-devel] gnutls 3.5.10
From:       Werner Koch <wk () gnupg ! org>
Date:       2017-03-19 9:41:32
Message-ID: 87tw6pr4c3.fsf () wheatstone ! g10code ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


On Sat, 18 Mar 2017 21:22, martin@martin.st said:

> Despite that, it does seem to exist on disk at that path though, so it
> just seems like the listing isn't refreshed after the last release was

Hmmm, the cron jobs re-creates the index every 3 hours:

# Create HTML index files for the FTP server
20  20/3 * * *   root    /etc/mk-ftp-index.html.sh

it seems that it did not worked this time.  I just kicked it and the
index is now updated.  I attach the script in case someone wants to
check it for for a bug.


Shalom-Salam,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.

["mk-ftp-index.html.sh" (text/x-sh)]

#!/bin/sh

# The script is a bit complicate because we need to make sure that
# the directory entries do not change while processing them.  A changed
# dir entry will lead to a different index.html file and thus they will
# always be re-created.

set -e
top=/home/ftp
scratch=/home/ftp/.scratch
cd "$top"

INDEXER=/usr/local/lib/boa/boa_indexer
if [ ! -x $INDEXER ]; then
  INDEXER=/usr/lib/boa/boa_indexer
fi  
if [ ! -x $INDEXER ]; then
  echo "mk-ftp-index.html.sh: Index tool $INDEXER not found - aborting" >&2
  exit 1
fi

skip_index() {
  awk '/href="index.html"/ {skip=1}; !skip {print;next}; /<\/tr>/ {skip=0}'
}

(find . -type d ! -name '\.*' ! -name dev ! -name index.html; echo .) |\
 while read dir rest; do
  dir=${dir##./}
  if cd "$dir"; then
    if [ "$dir" = "." ]; then
      desc="ftp.gnupg.org"
    else
      desc="ftp.gnupg.org/$dir"
    fi
    
    [ -f $scratch/index.html ] && rm $scratch/index.html
    [ -f index.html ] && cat index.html >$scratch/index.html
    if [ -f README ]; then
      $INDEXER . "$desc" |\
        sed '\!</table>! { a \
<h2>README</h2>\
<pre>
 r README
a \
</pre>
}' | sed 's/^\.[ 	]*$//' | skip_index >$scratch/index.html.new
    else
      $INDEXER . "$desc" | skip_index >$scratch/index.html.new
    fi
    if [ -f $scratch/index.html ]; then
      grep -v '^Index generated' $scratch/index.html     >$scratch/index.html.x
      grep -v '^Index generated' $scratch/index.html.new >$scratch/index.html.new.x
      if ! cmp -s $scratch/index.html.x $scratch/index.html.new.x ; then
         mv $scratch/index.html.new index.html
      fi
      rm $scratch/index.html
      [ -f $scratch/index.html.new ] && rm $scratch/index.html.new
    else
      mv $scratch/index.html.new index.html
    fi
  fi
  cd "$top"
done

[Attachment #8 (application/pgp-signature)]

_______________________________________________
Gnutls-devel mailing list
Gnutls-devel@lists.gnutls.org
http://lists.gnupg.org/mailman/listinfo/gnutls-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic