[go: up one dir, main page]

Menu

[r2685]: / trunk / generate_sf_loll.sh  Maximize  Restore  History

Download this file

101 lines (80 with data), 3.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
#!/bin/bash
RESULTS=sf_results
HTTP_PREFIX=htdocs
# Used for prefix or suffix to various file or directory names.
FIX=sf
# Generates SourceForge version of loll links site in the subdirectory $RESULTS
# WARNING. THIS IS POTENTIALLY AN EXTREMELY DANGEROUS SCRIPT
# since it uses the rm -rf command a lot. For example, A single blank
# inserted in any of those critical lines, e.g.
# rm -rf $RESULTS/$HTTP_PREFIX/linux/links/* ==>
# rm -rf $RESULTS/$HTTP_PREFIX/linux/links /*
# HOSES YOUR ENTIRE SYSTEM SO BE CAREFUL OF YOUR EDITING IN THIS SCRIPT!
#Assumptions:
# (1) Must be run from directory which contains bk2site_prepare.sed
# and subdirectories bk2site_config_$FIX and bk2site_scripts_$FIX.
# (2) Icon files required for the source_forge site are in the subdirectory
# $FIX\_loll_icons (userfriendly.gif, etc.)
# Now get to work!
# Make required directories in $RESULTS (if they aren't there already).
mkdir -p $RESULTS/cgi-bin/bk2site \
$RESULTS/$HTTP_PREFIX/loll_icons \
$RESULTS/$HTTP_PREFIX/linux/links
# Remove everything in cgi-bin/bk2site used by this version
rm -rf $RESULTS/cgi-bin/bk2site/*
# Restore cgi-bin/bk2site from version under CVS control
cp bk2site_scripts_$FIX/*.pl \
$RESULTS/cgi-bin/bk2site
export DATE_TIME=`date`
sed "s?<!--bk2site:date-->?$DATE_TIME?" \
<bk2site_config_$FIX/searchbase.html \
> $RESULTS/cgi-bin/bk2site/searchbase.html
# Remove the local copy of bk2site gifs (in case the main package has
# changed its gifs.)
rm -rf $RESULTS/$HTTP_PREFIX/loll_icons/*
# Grab latest bk2site icons on this Debian system.
# N.B. if this were an rpm-based system would use the
# `rpm -ql bk2site` command instead.
cp `dpkg --listfiles bk2site | grep '\.gif'` $RESULTS/$HTTP_PREFIX/loll_icons
# Grab site icons (e.g., the userfriendly logo) for the news section
# These icons are not distributed with the loll package so you will have
# to come up with your own (or have broken icons on your results site).
cp $FIX\_loll_icons/*.gif \
$FIX\_loll_icons/lcorner_half.png \
$FIX\_loll_icons/valid-atom57.png \
$FIX\_loll_icons/valid-html40.png \
$FIX\_loll_icons/LBP-logo.png \
$FIX\_loll_icons/lxer.png \
$FIX\_loll_icons/groklaw_small.png \
$FIX\_loll_icons/ldp_small.png \
$FIX\_loll_icons/linuxtd_logo_small.png \
$RESULTS/$HTTP_PREFIX/loll_icons
# Remove everything below links.
rm -rf $RESULTS/$HTTP_PREFIX/linux/links/*
# Copy other required files. All under cvs control.
# Copy these with a sed filter to put in correct date.
export DATE_TIME=`date`
sed "s?<!--bk2site:date-->?$DATE_TIME?" \
<bk2site_config_$FIX/about.html \
>$RESULTS/$HTTP_PREFIX/linux/links/about.html
sed "s?<!--bk2site:date-->?$DATE_TIME?" \
<bk2site_config_$FIX/change.html \
>$RESULTS/$HTTP_PREFIX/linux/links/change.html
sed "s?<!--bk2site:date-->?$DATE_TIME?" \
<bk2site_config_$FIX/submit.html \
>$RESULTS/$HTTP_PREFIX/linux/links/submit.html
# Generate new site at $RESULTS/$HTTP_PREFIX/linux/links/ on local computer.
rm -f bk2site_$FIX.out
bk2site -f bk2site_config_$FIX/dot.bk2siterc > bk2site_$FIX.out 2>&1
# Get the cgi-bin/bk2site permissions correct.
# N.B. urls.db created by the above command, the rest were put there
# earlier in the script.
chmod 755 $RESULTS/cgi-bin/bk2site/*.pl
chmod 644 $RESULTS/cgi-bin/bk2site/searchbase.html
chmod 644 $RESULTS/cgi-bin/bk2site/urls.db
# Change the linux/links permissions to rwxrwxr-x so that others have a
# chance to change the linux/links sf site.
chmod -R 775 $RESULTS/$HTTP_PREFIX/linux/links/ $RESULTS/$HTTP_PREFIX/loll_icons
# Follow up with checking results, copying to sourceforge (copy_loll_to_sf.sh),
# and installing at sourceforge (install_loll_at_sf.sh executed
# *AT* shell1.sf.net).