adding new scripts to the CVS from greg's home directory

pull/2/head
emmajane 19 years ago
parent c2ad007d00
commit 83de645677
  1. 170
      LDP/builder/ldp_cp
  2. 87
      LDP/builder/ldp_cp_faq
  3. 82
      LDP/builder/ldp_cp_html
  4. 12
      LDP/builder/ldp_cp_wn
  5. 21
      LDP/builder/ldp_index
  6. 14
      LDP/builder/mk_pluckerdb

@ -0,0 +1,170 @@
#!/usr/bin/perl
#
# ldp_cp <file_without_extension>
#
# copy all various output forms needed for the LDP to respective locations
#
if($ARGV[0] eq '') {
die "\nusage: $0 <file_without_extension>\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 = <FP_IN>;
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);

@ -0,0 +1,87 @@
#!/usr/bin/perl
#
# ldp_cp_faq <file_without_extension>
#
# copy all various output forms needed for the LDP to respective locations
#
if($ARGV[0] eq '') {
die "\nusage: $0 <file_without_extension>\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);

@ -0,0 +1,82 @@
#!/usr/bin/perl
#
# ldp_cp_html <file_without_extension>
#
# copy all various output forms needed for the LDP to respective locations
#
if($ARGV[0] eq '') {
die "\nusage: $0 <file_without_extension>\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);

@ -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"

@ -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

@ -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
Loading…
Cancel
Save