]> git.sommitrealweird.co.uk Git - bpgallery.git/commitdiff
Fix caption generation code
authorBrett Parker <arch@sommitrealweird.co.uk>
Mon, 14 May 2007 00:28:15 +0000 (00:28 +0000)
committerBrett Parker <arch@sommitrealweird.co.uk>
Mon, 14 May 2007 00:28:15 +0000 (00:28 +0000)
* Fixes captions
* Removes silly logging

git-archimport-id: arch@sommitrealweird.co.uk--2005-desktop/bpgallery--mainline--1.1--patch-8

bpgallery.sh

index 247e5a590fc126d4f5dc019e960980054c109fa9..50c3b72b0a6d5a5fcf5e5ab7c6b920fb54d2b371 100755 (executable)
@@ -17,7 +17,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-set -e
 set -f
 
 VERSION="1.1.0"
@@ -486,7 +485,6 @@ function generate_pages() {
                        nextpage=${nextimage}.html
                fi
                filename=${extradir}${currentimage}
-               echo "'$previouspage' '$currentpage' '$nextpage' '$addlink'" >> /tmp/bpgallery-tmp.log
                if [ "x$currentpage" != "x" ]; then
                        generate_general_page "$previouspage" "$currentpage" "$nextpage" $addlink
                fi
@@ -525,8 +523,6 @@ function generate_medium_pages() {
 
 function generate_general_page() {
 
-       echo 'Generating the page...' >> /tmp/bpgallery-tmp.log
-
        if [[ -z $1 ]]; then
                previouspage=""
        fi
@@ -545,7 +541,8 @@ function generate_general_page() {
        fi
 
        if [ -r captions.txt ]; then
-               caption=$($GREPCOMMAND -E "^${filename}   " captions.txt); caption=${caption#*    }
+               imagefilename=${filename##*/}
+               caption=$($GREPCOMMAND -E "^${imagefilename}    " captions.txt); caption=${caption#*    }
        else
                caption=""
        fi