From 83de6456773f3e448919a8ceb38bef14a9bda6fd Mon Sep 17 00:00:00 2001 From: emmajane <> Date: Fri, 23 Jul 2004 15:04:06 +0000 Subject: [PATCH] adding new scripts to the CVS from greg's home directory --- LDP/builder/ldp_cp | 170 +++++++++++++++++++++++++++++++++++++++ LDP/builder/ldp_cp_faq | 87 ++++++++++++++++++++ LDP/builder/ldp_cp_html | 82 +++++++++++++++++++ LDP/builder/ldp_cp_wn | 12 +++ LDP/builder/ldp_index | 21 +++++ LDP/builder/mk_pluckerdb | 14 ++++ 6 files changed, 386 insertions(+) create mode 100755 LDP/builder/ldp_cp create mode 100755 LDP/builder/ldp_cp_faq create mode 100755 LDP/builder/ldp_cp_html create mode 100755 LDP/builder/ldp_cp_wn create mode 100755 LDP/builder/ldp_index create mode 100755 LDP/builder/mk_pluckerdb diff --git a/LDP/builder/ldp_cp b/LDP/builder/ldp_cp new file mode 100755 index 00000000..9d657e50 --- /dev/null +++ b/LDP/builder/ldp_cp @@ -0,0 +1,170 @@ +#!/usr/bin/perl +# +# ldp_cp +# +# copy all various output forms needed for the LDP to respective locations +# +if($ARGV[0] eq '') { + die "\nusage: $0 \n"; +} + +my($cmd, $dtd, $f, $base) = ''; +my($linuxdoc) = 0; + +$base = '/public/ftp/pub/linux/docs/HOWTO'; +$base_html = '/public/html/LDP/HOWTO'; + +$f = $ARGV[0]; +if( $f =~ /\.[\w]+ml$/ ) { + $f =~ s/\.[\w]+$//; +} + +# determine DTD +# +my($fname) = ''; +if( -e "$f.sgml" ) { + $fname = "$f.sgml"; +} elsif( -e "$f.xml" ) { + $fname = "$f.xml"; +} + +open(FP_IN, "head -100 $fname | grep -i '\!doctype' |") || + die "ldp_cp: cannot determine DTD for $fname\n"; +$cmd = ; +close(FP_IN); +if( $cmd eq '' ) { + die "ldp_cp: cannot determine DTD for $f\n"; +} +if( $cmd =~ /linuxdoc/i ) { + $linuxdoc = 1; +} +if( $cmd =~ /\ xml\ /i ) { + $dtd = 'xml'; +} else { + $dtd = 'sgml'; +} + + +# copy PLAIN TEXT version +# +if( -e "$f.txt" ) { + $cmd = "cp -f $f.txt $base/$f; chmod 664 $base/$f; chgrp ldp $base/$f"; + print "$0: $f $base\n"; + system($cmd); + + $cmd = "cp -f $f.txt $base_html/text/$f; " . + "chmod 664 $base_html/text/$f; " . + "chgrp ldp $base_html/text/$f"; + system($cmd); +} + +# copy HTML version +# +if( -e "$f-html.tar.gz" ) { + $cmd = "cp -f $f-html.tar.gz $base/other-formats/html; " . + "chmod 664 $base/other-formats/html/$f-html.tar.gz; " . + "chgrp ldp $base/other-formats/html/$f-html.tar.gz"; + print "$0: $f-html.tar.gz $base/other-formats/html\n"; + system($cmd); +} +if( (-e "$f.html" && $linuxdoc == 1) + || + (-d "$f" && $linuxdoc == 0) ) { + + if( $linuxdoc == 1 ) { + $cmd = "cp -f $f\*.html $base_html; " . + "chmod 664 $base_html/$f\*.html; " . + "chgrp ldp $base_html/$f\*.html"; + } else { + if( -d "$base_html/$f" ) { + system("rm -f $base_html/$f/\*.html"); + } + $cmd = "cp -rf $f $base_html; " . + "chmod 775 $base_html/$f; " . + "chmod 664 $base_html/$f/\*.html; " . + "chgrp -R ldp $base_html/$f"; + } + print "$0: $base_html\n"; + system($cmd); +} + +# copy single HTML version +# +if( -e "00_$f.html" ) { + $cmd = "cp -f 00_" . "$f.html $base/other-formats/html_single/$f.html; " . + "chmod 664 $base/other-formats/html_single/$f.html; " . + "chgrp ldp $base/other-formats/html_single/$f.html"; + print "$0: $f.html $base/other-formats/html_single\n"; + system($cmd); + + $cmd = "mkdir $base_html/html_single/$f; " . + "cp -f 00_" . "$f.html $base_html/html_single/$f/index.html; " . + "chmod 775 $base_html/html_single/$f/; " . + "chmod 664 $base_html/html_single/$f/index.html; " . + "chgrp -R ldp $base_html/html_single/$f/"; + system($cmd); +} + + +# copy PDF version +# +if( -e "$f.pdf" ) { + $cmd = "cp -f $f.pdf $base/other-formats/pdf; " . + "chmod 664 $base/other-formats/pdf/$f.pdf; " . + "chgrp ldp $base/other-formats/pdf/$f.pdf"; + print "$0: $f.pdf $base/other-formats/pdf\n"; + system($cmd); +} + +# copy PS version +# +if( -e "$f.ps.gz" ) { + $cmd = "cp -f $f.ps.gz $base/other-formats/ps; " . + "chmod 664 $base/other-formats/ps/$f.ps.gz; " . + "chgrp ldp $base/other-formats/ps/$f.ps.gz"; + print "$0: $f.ps.gz $base/other-formats/ps\n"; + system($cmd); +} + +# copy source version +# +if( -e "$f.${dtd}.gz" ) { + + my($ext) = ''; + if( $linuxdoc == 1 ) { + $ext = 'sgml'; + } else { + $ext = 'docbook'; + } + + $cmd = "cp -f $f.${dtd}.gz $base/other-formats/$ext; " . + "chmod 664 $base/other-formats/$ext/$f.${dtd}.gz; " . + "chgrp ldp $base/other-formats/$ext/$f.${dtd}.gz"; + print "$0: $f.${dtd}.gz $base/other-formats/$ext\n"; + system($cmd); + + # docbook SGML generated from linuxdoc + # + if( $linuxdoc == 1 && (-e "DB_$f.sgml.gz") ) { + $ext = 'docbook'; + $cmd = "cp -f DB_$f.sgml.gz $base/other-formats/$ext/$f.sgml.gz; " . + "chmod 664 $base/other-formats/$ext/$f.sgml.gz; " . + "chgrp ldp $base/other-formats/$ext/$f.sgml.gz"; + system($cmd); + } +} + + +# for announce msg +# +print "\n"; +if( $linuxdoc == 1 ) { + system("head -5 $f.txt"); +} else { + system("head -12 $f.txt"); +} +print "\n * updated\n http://tldp.org/HOWTO/" . + ($linuxdoc == 1 ? "$f.html" : "$f/"), "\n\n"; + +exit(0); + diff --git a/LDP/builder/ldp_cp_faq b/LDP/builder/ldp_cp_faq new file mode 100755 index 00000000..716def3a --- /dev/null +++ b/LDP/builder/ldp_cp_faq @@ -0,0 +1,87 @@ +#!/usr/bin/perl +# +# ldp_cp_faq +# +# copy all various output forms needed for the LDP to respective locations +# +if($ARGV[0] eq '') { + die "\nusage: $0 \n"; +} + +my($cmd, $f, $base) = ''; + +$base = '/public/ftp/pub/linux/docs/faqs/'; +$base_html = '/public/html/LDP/FAQ/'; + +$f = $ARGV[0]; +if( $f =~ /\.sgml$/ ) { + $f =~ s/\.[\w]+$//; +} +$base .= $f; +$base_html .= $f; + +print "$0: $base (and) $base_html\n"; + +# copy PLAIN TEXT version +# +if( -e "$f.txt" ) { + $cmd = "cp -f $f.txt $base/$f; chmod 664 $base/$f; chgrp ldp $base/$f"; + system($cmd); + $cmd = "cp -f $f.txt $base_html/faqs/$f; chmod 664 $base_html/faqs/$f; chgrp ldp $base_html/faqs/$f"; + system($cmd); +} + +# copy HTML version +# +if( -e "$f-html.tar.gz" ) { + $cmd = "cp -f $f-html.tar.gz $base/$f.html.tar.gz; " . + "chmod 664 $base/$f.html.tar.gz; " . + "chgrp ldp $base/$f.html.tar.gz"; + system($cmd); +} + +if( -d "$base_html" ) { + system("rm -f $base_html/\*.html"); +} +$cmd = "cp -rf $f/\*.html $base_html; " . + "chmod 775 $base_html; " . + "chmod 664 $base_html/\*.html; " . + "chgrp -R ldp $base_html"; +system($cmd); + +# copy PDF version +# +if( -e "$f.pdf" ) { + $cmd = "cp -f $f.pdf $base/; " . + "chmod 664 $base/$f.pdf; " . + "chgrp ldp $base/$f.pdf"; + system($cmd); +} + +# copy PS version +# +if( -e "$f.ps.gz" ) { + $cmd = "cp -f $f.ps.gz $base/; " . + "chmod 664 $base/$f.ps.gz; " . + "chgrp ldp $base/$f.ps.gz"; + system($cmd); +} + +# copy SGML version +# +if( -e "$f.sgml.gz" ) { + + $cmd = "cp -f $f.sgml.gz $base/; " . + "chmod 664 $base/$f.sgml.gz; " . + "chgrp ldp $base/$f.sgml.gz"; + system($cmd); +} + +# for announce msg +# +print "\n"; +system("head -5 $f.txt"); +print "\n * updated\n http://tldp.org/FAQ/${f}\n\n"; + +exit(0); + diff --git a/LDP/builder/ldp_cp_html b/LDP/builder/ldp_cp_html new file mode 100755 index 00000000..f60657a8 --- /dev/null +++ b/LDP/builder/ldp_cp_html @@ -0,0 +1,82 @@ +#!/usr/bin/perl +# +# ldp_cp_html +# +# copy all various output forms needed for the LDP to respective locations +# +if($ARGV[0] eq '') { + die "\nusage: $0 \n"; +} + +my($cmd, $dtd, $f, $base) = ''; + +$base = '/public/ftp/pub/linux/docs/HOWTO'; +$base_html = '/public/html/LDP/HOWTO'; + +$f = $ARGV[0]; +if( $f =~ /\.[\w]+ml$/ ) { + $f =~ s/\.[\w]+$//; +} + +my($fname) = "$f.html"; + + +# copy PLAIN TEXT version +# +if( -e "$f.txt" ) { + $cmd = "cp -f $f.txt $base/$f; chmod 664 $base/$f; chgrp ldp $base/$f"; + print "$0: $f $base\n"; + system($cmd); +} + +# copy HTML version +# +if( -e "$f-html.tar.gz" ) { + $cmd = "cp -f $f-html.tar.gz $base/other-formats/html; " . + "chmod 664 $base/other-formats/html/$f-html.tar.gz; " . + "chgrp ldp $base/other-formats/html/$f-html.tar.gz"; + print "$0: $f-html.tar.gz $base/other-formats/html\n"; + system($cmd); +} +if( -e "$f.html" ) { + + $cmd = "cp -f $f\*.html $base_html; " . + "chmod 664 $base_html/$f\*.html; " . + "chgrp ldp $base_html/$f\*.html"; + print "$0: $base_html\n"; + system($cmd); +} + +# copy single HTML version +# +if( -e "$f.html" ) { + $cmd = "cp -f $f.html $base/other-formats/html_single/$f.html; " . + "chmod 664 $base/other-formats/html_single/$f.html; " . + "chgrp ldp $base/other-formats/html_single/$f.html"; + print "$0: $f.html $base/other-formats/html_single\n"; + system($cmd); +} + + +# copy PDF version +# +if( -e "$f.pdf" ) { + $cmd = "cp -f $f.pdf $base/other-formats/pdf; " . + "chmod 664 $base/other-formats/pdf/$f.pdf; " . + "chgrp ldp $base/other-formats/pdf/$f.pdf"; + print "$0: $f.pdf $base/other-formats/pdf\n"; + system($cmd); +} + +# copy PS version +# +if( -e "$f.ps.gz" ) { + $cmd = "cp -f $f.ps.gz $base/other-formats/ps; " . + "chmod 664 $base/other-formats/ps/$f.ps.gz; " . + "chgrp ldp $base/other-formats/ps/$f.ps.gz"; + print "$0: $f.ps.gz $base/other-formats/ps\n"; + system($cmd); +} + +exit(0); + diff --git a/LDP/builder/ldp_cp_wn b/LDP/builder/ldp_cp_wn new file mode 100755 index 00000000..ea337658 --- /dev/null +++ b/LDP/builder/ldp_cp_wn @@ -0,0 +1,12 @@ +cp $1.html /public/html/LDP/ldpwn/ +chmod 664 /public/html/LDP/ldpwn/$1.html +chgrp ldp /public/html/LDP/ldpwn/$1.html +cd /public/html/LDP/ldpwn/ +rm latest.html +ln -s $1.html latest.html + +echo 'mail -s "LDP Weekly News" -c "tschlabach@gmx.net, Giridhar.Nag@ubinetics.co.in,tille@soti.org" news@en.tldp.org, lwn@lwn.net, editors@newsforge.com' +echo "~r $1.txt" +echo "" +echo "vi /public/html/LDP/ldpwn/index.html, add $1.html" + diff --git a/LDP/builder/ldp_index b/LDP/builder/ldp_index new file mode 100755 index 00000000..2dd61012 --- /dev/null +++ b/LDP/builder/ldp_index @@ -0,0 +1,21 @@ + +cd /export/sunsite/users/gferg/toolroot/dsssl/docbook/html +cp ldp_index.dsl ldp.dsl + +cd /export/sunsite/users/gferg/howto/ldp_cvs/LDP/howto/docbook/HOWTO-INDEX +cp *.sgml /export/sunsite/users/gferg/howto/index +cd /export/sunsite/users/gferg/howto/index +/export/sunsite/users/gferg/toolroot/ldp_mk -no_index HOWTO-INDEX.sgml +/export/sunsite/users/gferg/toolroot/ldp_cp HOWTO-INDEX + +rm -rf HOWTO-INDEX* *.sgml 00* *.html + +cd /export/sunsite/users/gferg/toolroot/dsssl/docbook/html +cp ldp_main.dsl ldp.dsl + +lynx -dump -nolist /public/html/LDP/HOWTO/HOWTO-INDEX/howtos.html | tail +9 > /public/ftp/pub/linux/docs/HOWTO/INDEX +chmod 664 /public/ftp/pub/linux/docs/HOWTO/INDEX +chgrp linux /public/ftp/pub/linux/docs/HOWTO/INDEX + +/export/sunsite/users/gferg/tools/mk_sortedht + diff --git a/LDP/builder/mk_pluckerdb b/LDP/builder/mk_pluckerdb new file mode 100755 index 00000000..7d8d66ec --- /dev/null +++ b/LDP/builder/mk_pluckerdb @@ -0,0 +1,14 @@ +#/bin/bash +# +# mk_pluckerdb HOWTO_NAME top_level_html +# +PLUCKER_BUILD=/export/sunsite/users/gferg/toolroot/plucker/bin/plucker-build +COMPRESSION=zlib +PLUCKERDIR=/public/ftp/pub/linux/docs/LDP/pluckerdb + +$PLUCKER_BUILD --$COMPRESSION-compression -H $2 -f $1 -M999 -N "$1" \ + --category=LDP --stayonhost --pluckerdir=$PLUCKERDIR + +chgrp ldp $PLUCKERDIR/$1.pdb +chmod 664 $PLUCKERDIR/$1.pdb +