#!/bin/bash #Copyright 2001, William Stearns #GPL'd. HtmlFileListVer="0.7.1" if [ "$1" = "fullpage" ]; then cat < `pwd | sed -e 's@.*/@@'` file listing EOHEADER fi if [ -f htmlfilelist-header.html ]; then cat htmlfilelist-header.html echo \ fi echo \ echo \\ \\\ Up one level\\\ \\\\\\ \\\ \\\ \ #FIXME doesn't handle files with spaces correctly; -e 's/^/"/' -e 's/$/"/' gives too many quotes to ls and -e 's/ /\\ /g' fails. for OneObj in `find | sed -e 's@\./@@' | grep -v '^\.$' | sort` ; do ObjName=`echo "$OneObj" | sed -e 's@.*/@@'` if echo "$OneObj" | grep -q '/' ; then ObjPath=`echo "$OneObj" | sed -e 's@\(.*\)/.*@\1@'` else ObjPath="." fi #echo X${ObjPath}X${ObjName}X >/dev/stderr if [ -d $OneObj ]; then echo \\ \\\ $OneObj\\\ \\\\\\ \ `ls -ald "$OneObj" | awk '{print $6,$7}'`\\ \ `ls -ald "$OneObj" | awk '{print $8}'`\\ \ #FIXME - do a case on *filelist.html, index. elif [ "$ObjName" = "htmlfilelist-header.html" ]; then : elif [ "$ObjName" = "htmlfilelist-footer.html" ]; then : elif [ "$ObjName" = "filelist.html" ]; then #Leave off size, date and timestamp for the currently-being-modified filelist.html echo \\ \\\ $OneObj\\\ \\\ \\\ \\\ \ elif [ "$ObjName" = "index.html" ] && [ $OneObj -ef $ObjPath/filelist.html ]; then #Same as above (only used if the exact same inode as filelist.html). echo \\ \\\ $OneObj\\\ \\\ \\\ \\\ \ else case "$ObjName" in *.thumb.jpg|*.thumb.gif|*.thumb.JPG|*.thumb.GIF) : ;; toc.gif|prev.gif|next.gif|first0.gif|first1.gif|index.gif|last0.gif|last1.gif|next0.gif|next1.gif|prev0.gif|prev1.gif|text.gif) #Normal file, don't thumbnail these echo \\ \\\ $OneObj\\\ \ `ls -ald "$OneObj" | awk '{print $5}'`\\ \ `ls -ald "$OneObj" | awk '{print $6,$7}'`\\ \ `ls -ald "$OneObj" | awk '{print $8}'`\\ \ ;; *.jpg|*.gif|*.GIF|*.JPG) Images="$Images $ObjPath/$ObjName" echo \\ \\\ $OneObj\\\ \ `ls -ald "$OneObj" | awk '{print $5}'`\\ \ `ls -ald "$OneObj" | awk '{print $6,$7}'`\\ \ `ls -ald "$OneObj" | awk '{print $8}'`\\ \ ;; *) #Normal file echo \\ \\\ $OneObj\\\ \ `ls -ald "$OneObj" | awk '{print $5}'`\\ \ `ls -ald "$OneObj" | awk '{print $6,$7}'`\\ \ `ls -ald "$OneObj" | awk '{print $8}'`\\ \ ;; esac fi done echo \ if [ -n "$Images" ]; then echo \ for OneImage in $Images ; do Thumbnail=`echo $OneImage | sed -e 's/\(\.[gjGJ][[ipIP][fgFG]\)$/.thumb\1/'` if [ ! -f "$Thumbnail" ]; then convert -geometry 100x100 $OneImage $Thumbnail fi echo \\\ done fi for OneFile in README* ; do if [ -f $OneFile ] && [ -s $OneFile ]; then echo \ echo \$OneFile\ case $OneFile in *.html|*.htm|*.HTML|*.HTM) cat $OneFile | grep -v '' | grep -v '' | \ grep -v '' | grep -v '' | \ grep -v '' | grep -v '' | \ grep -v '' | grep -v '' ;; *) echo \ cat $OneFile | sed -e 's/<\([^@]*@[^>]*\)>/\<\1\><\/a>/g' echo \ ;; esac fi done NewestRpm="`ls -A1rt *.rpm 2>/dev/null | grep -v '\.src\.rpm' | grep -v -- '-devel' | tail -1`" if [ -n "$NewestRpm" ]; then echo \ echo \$NewestRpm\ echo \ rpm -qpi "$NewestRpm" | sed -e 's@<@\<@' -e 's@>@\>@' echo \ fi if [ -f htmlfilelist-footer.html ]; then echo \ cat htmlfilelist-footer.html fi if [ "$1" = "fullpage" ]; then cat < Generated `date` by htmlfilelist version $HtmlFileListVer EOFOOTER fi #FIXME - add icons too? # address-book.html 326 bytes Tue Mar 25 10:47:58 1997 Hypertext Markup Language # archive/ 4 Kb Tue Sep 30 23:31:05 1997 Directory # bookmark.htm 402 Kb Tue Jan 21 10:51:46 1997 Hypertext Markup Language # bookmarks.html 494 Kb Tue Oct 9 12:12:49 2001 Hypertext Markup Language # cache/ 4 Kb Fri Oct 5 17:29:19 2001 Directory # cert5.db 32 Kb Tue Sep 30 23:01:31 1997 # cert7.db 376 Kb Tue Apr 17 16:07:27 2001 # cookies 1 Kb Tue Oct 9 08:46:52 2001