Date: Thursday, February 14, 2013 @ 12:54:29 Author: spupykin Revision: 84234
archrelease: copy trunk to community-any Added: arch-wiki-docs/repos/community-any/PKGBUILD (from rev 84233, arch-wiki-docs/trunk/PKGBUILD) arch-wiki-docs/repos/community-any/filter.pl (from rev 84233, arch-wiki-docs/trunk/filter.pl) arch-wiki-docs/repos/community-any/get.sh (from rev 84233, arch-wiki-docs/trunk/get.sh) arch-wiki-docs/repos/community-any/index.pl (from rev 84233, arch-wiki-docs/trunk/index.pl) Deleted: arch-wiki-docs/repos/community-any/PKGBUILD arch-wiki-docs/repos/community-any/filter.pl arch-wiki-docs/repos/community-any/get.sh arch-wiki-docs/repos/community-any/index.pl -----------+ PKGBUILD | 56 ++++++++++++++++++------------------ filter.pl | 92 ++++++++++++++++++++++++++++++------------------------------ get.sh | 50 ++++++++++++++++---------------- index.pl | 70 ++++++++++++++++++++++----------------------- 4 files changed, 134 insertions(+), 134 deletions(-) Deleted: PKGBUILD =================================================================== --- PKGBUILD 2013-02-14 11:54:15 UTC (rev 84233) +++ PKGBUILD 2013-02-14 11:54:29 UTC (rev 84234) @@ -1,28 +0,0 @@ -# $Id$ -# Maintainer: Sergej Pupykin <pupykin.s+a...@gmail.com> - -pkgname=arch-wiki-docs -pkgver=20121125 -pkgrel=1 -pkgdesc="Documentation from wiki.archlinux.org" -arch=('any') -makedepends=('wget' 'perl' 'perl-json-xs') -url="http://wiki.archlinux.org" -license=('FDL') -options=('docs' '!strip') -source=("get.sh" - "index.pl" - "filter.pl") -md5sums=('7f9aec77fbf319aa8247149319ff7f7c' - 'dddb4258bd93acc1a0102bfee3e077f0' - '6430f9db1d0f0be5999e2c247f4ca2a1') - -build() { - bash $srcdir/get.sh $srcdir $srcdir/pages - (cd $srcdir/pages && perl -w $srcdir/filter.pl) -} - -package() { - mkdir -p $pkgdir/usr/share/doc/arch-wiki/html - cp -r $srcdir/pages/* $pkgdir/usr/share/doc/arch-wiki/html/ -} Copied: arch-wiki-docs/repos/community-any/PKGBUILD (from rev 84233, arch-wiki-docs/trunk/PKGBUILD) =================================================================== --- PKGBUILD (rev 0) +++ PKGBUILD 2013-02-14 11:54:29 UTC (rev 84234) @@ -0,0 +1,28 @@ +# $Id$ +# Maintainer: Sergej Pupykin <pupykin.s+a...@gmail.com> + +pkgname=arch-wiki-docs +pkgver=20130214 +pkgrel=1 +pkgdesc="Documentation from wiki.archlinux.org" +arch=('any') +makedepends=('wget' 'perl' 'perl-json-xs') +url="http://wiki.archlinux.org" +license=('FDL') +options=('docs' '!strip') +source=("get.sh" + "index.pl" + "filter.pl") +md5sums=('7f9aec77fbf319aa8247149319ff7f7c' + 'dddb4258bd93acc1a0102bfee3e077f0' + '6430f9db1d0f0be5999e2c247f4ca2a1') + +build() { + bash $srcdir/get.sh $srcdir $srcdir/pages + (cd $srcdir/pages && perl -w $srcdir/filter.pl) +} + +package() { + mkdir -p $pkgdir/usr/share/doc/arch-wiki/html + cp -r $srcdir/pages/* $pkgdir/usr/share/doc/arch-wiki/html/ +} Deleted: filter.pl =================================================================== --- filter.pl 2013-02-14 11:54:15 UTC (rev 84233) +++ filter.pl 2013-02-14 11:54:29 UTC (rev 84234) @@ -1,46 +0,0 @@ -#!/usr/bin/perl -w - -%INDEX=(); - -print "Reading index\n"; - -open FH, "<index.html" || die; - -while(<FH>) -{ - if(/HREF='([0-9]+).html'\>(.+)\<\/A\>$/) - { - $INDEX{$1} = $2; - } -} - -close FH; - -sub fix_file { - my $in = shift @_; - - open FH, "<$in" || die; - open FHO, ">tmpout.html" || die; - - $_ = join "", <FH>; - - foreach $i (keys %INDEX) - { - s/href=\"\/index.php\/\Q$INDEX{$i}\E\"/href=\"$i.html\"/gsm; - s/href=\"htt\S+\/\/wiki.archlinux.org\/index.php\/\Q$INDEX{$i}\E\"/href=\"$i.html\"/gsm; - } - print FHO; - - close FH; - close FHO; - - rename("tmpout.html", "$in"); -} - -@files=<0*.html>; - -foreach $f (@files) -{ - print "Fixing $f\n"; - fix_file($f); -} Copied: arch-wiki-docs/repos/community-any/filter.pl (from rev 84233, arch-wiki-docs/trunk/filter.pl) =================================================================== --- filter.pl (rev 0) +++ filter.pl 2013-02-14 11:54:29 UTC (rev 84234) @@ -0,0 +1,46 @@ +#!/usr/bin/perl -w + +%INDEX=(); + +print "Reading index\n"; + +open FH, "<index.html" || die; + +while(<FH>) +{ + if(/HREF='([0-9]+).html'\>(.+)\<\/A\>$/) + { + $INDEX{$1} = $2; + } +} + +close FH; + +sub fix_file { + my $in = shift @_; + + open FH, "<$in" || die; + open FHO, ">tmpout.html" || die; + + $_ = join "", <FH>; + + foreach $i (keys %INDEX) + { + s/href=\"\/index.php\/\Q$INDEX{$i}\E\"/href=\"$i.html\"/gsm; + s/href=\"htt\S+\/\/wiki.archlinux.org\/index.php\/\Q$INDEX{$i}\E\"/href=\"$i.html\"/gsm; + } + print FHO; + + close FH; + close FHO; + + rename("tmpout.html", "$in"); +} + +@files=<0*.html>; + +foreach $f (@files) +{ + print "Fixing $f\n"; + fix_file($f); +} Deleted: get.sh =================================================================== --- get.sh 2013-02-14 11:54:15 UTC (rev 84233) +++ get.sh 2013-02-14 11:54:29 UTC (rev 84234) @@ -1,25 +0,0 @@ -#!/bin/sh - -TARGETDIR=$2 - -mkdir -p $TARGETDIR - -cat >$TARGETDIR/index.html <<EOF -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<HTML> - <HEAD> - <TITLE>ArchWiki index</TITLE> - <META http-equiv="content-type" content="text/html; charset=utf-8"/> - </HEAD> - <BODY> -EOF - -perl $1/index.pl https://wiki.archlinux.org | while read A; do - TITLE=`echo $A | cut -d \ -f 2- | tr ' ' '_'` - ID=`echo $A | cut -d \ -f 1` - echo "$ID => $TITLE" - echo "<P><A HREF='$ID.html'>$TITLE</A>" >>$TARGETDIR/index.html - [ -f "$TARGETDIR/$ID.html" ] || wget --no-check-certificate -q "https://wiki.archlinux.org/index.php?title=$TITLE&printable=yes" -O "$TARGETDIR/$ID.html" -done - -echo "</BODY></HTML>" >>$TARGETDIR/index.html Copied: arch-wiki-docs/repos/community-any/get.sh (from rev 84233, arch-wiki-docs/trunk/get.sh) =================================================================== --- get.sh (rev 0) +++ get.sh 2013-02-14 11:54:29 UTC (rev 84234) @@ -0,0 +1,25 @@ +#!/bin/sh + +TARGETDIR=$2 + +mkdir -p $TARGETDIR + +cat >$TARGETDIR/index.html <<EOF +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<HTML> + <HEAD> + <TITLE>ArchWiki index</TITLE> + <META http-equiv="content-type" content="text/html; charset=utf-8"/> + </HEAD> + <BODY> +EOF + +perl $1/index.pl https://wiki.archlinux.org | while read A; do + TITLE=`echo $A | cut -d \ -f 2- | tr ' ' '_'` + ID=`echo $A | cut -d \ -f 1` + echo "$ID => $TITLE" + echo "<P><A HREF='$ID.html'>$TITLE</A>" >>$TARGETDIR/index.html + [ -f "$TARGETDIR/$ID.html" ] || wget --no-check-certificate -q "https://wiki.archlinux.org/index.php?title=$TITLE&printable=yes" -O "$TARGETDIR/$ID.html" +done + +echo "</BODY></HTML>" >>$TARGETDIR/index.html Deleted: index.pl =================================================================== --- index.pl 2013-02-14 11:54:15 UTC (rev 84233) +++ index.pl 2013-02-14 11:54:29 UTC (rev 84234) @@ -1,35 +0,0 @@ -#!/usr/bin/perl -w - -use Encode; -use JSON::XS; - -$URL=$ARGV[0]; - -@ALLPAGES=(); - -my $pageid; -my $pagetitle; -my $from = ""; -my $ret; -again: -my $count = 0; -$cmd="wget --no-check-certificate -q \"$URL/api.php?action=query&list=allpages&aplimit=500&format=json&apfilterredir=nonredirects&apfrom=$from\" -O -"; -#print STDERR $cmd."\n"; -$text=`$cmd`; -$ret = JSON::XS->new->utf8->decode($text); -$H = $ret->{query}->{allpages}; -foreach $i (@$H) -{ - push @ALLPAGES, encode("UTF-8", "$i->{title}"); - printf("%08u %s", $i->{pageid}, encode("UTF-8", "$i->{title}\n")); - $count++; -} - -if($count == 1) -{ - exit 0; -} - -@ALLPAGES = sort @ALLPAGES; -$from = $ALLPAGES[-1]; -goto again; Copied: arch-wiki-docs/repos/community-any/index.pl (from rev 84233, arch-wiki-docs/trunk/index.pl) =================================================================== --- index.pl (rev 0) +++ index.pl 2013-02-14 11:54:29 UTC (rev 84234) @@ -0,0 +1,35 @@ +#!/usr/bin/perl -w + +use Encode; +use JSON::XS; + +$URL=$ARGV[0]; + +@ALLPAGES=(); + +my $pageid; +my $pagetitle; +my $from = ""; +my $ret; +again: +my $count = 0; +$cmd="wget --no-check-certificate -q \"$URL/api.php?action=query&list=allpages&aplimit=500&format=json&apfilterredir=nonredirects&apfrom=$from\" -O -"; +#print STDERR $cmd."\n"; +$text=`$cmd`; +$ret = JSON::XS->new->utf8->decode($text); +$H = $ret->{query}->{allpages}; +foreach $i (@$H) +{ + push @ALLPAGES, encode("UTF-8", "$i->{title}"); + printf("%08u %s", $i->{pageid}, encode("UTF-8", "$i->{title}\n")); + $count++; +} + +if($count == 1) +{ + exit 0; +} + +@ALLPAGES = sort @ALLPAGES; +$from = $ALLPAGES[-1]; +goto again;