[debian-www 00865] Debian JP master SVN www commits (rev.2068)

Debian JP webadmin webadmin @ debian.or.jp
2020年 5月 16日 (土) 12:06:45 JST


=======================================================
Repository: /org/svn.debian.or.jp/repos
  Revision: 2068
  Commiter: tach
      Date: 2020-05-16 12:06:44 +0900 (2020年05月16日 (土))
=======================================================
Log:

Update for new www.debian.or.jp container

=======================================================
Changed:

U   www/trunk/include/config
U   www/trunk/progs/fetch-dsa

Modified: www/trunk/include/config
===================================================================
--- www/trunk/include/config	2020-05-12 13:28:14 UTC (rev 2067)
+++ www/trunk/include/config	2020-05-16 03:06:44 UTC (rev 2068)
@@ -5,8 +5,8 @@
    # WPATH = "";
 
    wwworg = 'http://www.debian.org';
-   dsafile = '/tmp/www.debian.or.jp/dsa.ja.euc-jp';
-   newsfile = '/tmp/www.debian.or.jp/news.rss';
+   dsafile = '/org/www.debian.or.jp/var/lib/www.debian.or.jp/dsa.ja.euc-jp';
+   newsfile = '/org/www.debian.or.jp/var/lib/www.debian.or.jp/news.rss';
 
    stable_codename = 'buster'; #安定版のコードネーム
    stable_initialdate = '2019年 7 月 6 日'; #リリース日付

Modified: www/trunk/progs/fetch-dsa
===================================================================
--- www/trunk/progs/fetch-dsa	2020-05-12 13:28:14 UTC (rev 2067)
+++ www/trunk/progs/fetch-dsa	2020-05-16 03:06:44 UTC (rev 2068)
@@ -1,31 +1,34 @@
 #!/bin/sh
-LANG=C
-export LANG
-UPDATE=
 
-if [ $# = 0 -a "$(whoami)" != "wwwadm" ]; then
-  sudo -u wwwadm -H $0
-  exit 0
+set -e
+
+export LANG=C
+STATEDIR=/org/www.debian.or.jp/var/lib/www.debian.or.jp
+DSA_URL=https://www.debian.org/security/dsa.ja
+RSS_URL='http://localhost/blog/index.cgi/index.rss?recache=all'
+do_update=false
+
+if [ "$(whoami)" != "wwwadm" ]; then
+  exec sudo -u wwwadm -H $0
 fi
 
 P=$(pwd)
-[ ! -d /tmp/www.debian.or.jp ] && mkdir /tmp/www.debian.or.jp
-chmod 700 /tmp/www.debian.or.jp
-cd /tmp/www.debian.or.jp
+cd $STATEDIR
 
-if [ -z "$(wget -m http://www.debian.org/security/dsa.ja 2>&1 | grep ' 0 files')" ]; then
-  # updated
+if wget -m $DSA_URL 2>&1 | grep -q 'Downloaded:'; then
   nkf -e www.debian.org/security/dsa.ja | sed -e "s/utf\-8/x-euc-jp-unicode/" > dsa.ja.euc-jp
-  UPDATE=yes
+  do_update=true
 fi
 
-if [ -z "$(wget -m http://osdn2.debian.or.jp/blog/index.cgi/index.rss\?recache=all 2>&1 | grep ' 0 files')" ]; then
-  sed -e "s/EUC-JP/x-euc-jp-unicode/" -e "s/index.cgi\///g" < osdn2.debian.or.jp/blog/index.cgi/index.rss\?recache=all > news.rss
-  # updated
-  UPDATE=yes
+if wget -q --header='Host: www.debian.or.jp' -O index.rss $RSS_URL; then
+  sed -e "s/EUC-JP/x-euc-jp-unicode/" -e "s/index.cgi\///g" < index.rss > news.rss
+  if ! diff -q news.rss.old news.rss; then
+    cp news.rss news.rss.old
+    do_update=true
+  fi
 fi
 
-if [ "$UPDATE" ]; then
+if $do_update; then
   cd $P
   ttree index.tt2
 fi



debian-www メーリングリストの案内