#!/usr/bin/awk -f # # info2web -- call hepu2fet_key appropriately # # usage: info2web webbase=/data/www galleries.info # # http://www.heikopurnhagen.net/software/info2web # # This program is available under the terms of the GNU General Public # License (GPL). All usual disclaimers apply! # # Heiko Purnhagen (mail@heikopurnhagen.net) # HP 20080817 # HP 20090930 if DIRIDX copy and touch index.html if source newer BEGIN { numinfo = 0; diridx = 0; webbase = "/tmp"; } { if ($1 == "DIRIDX") { idxhepudir = $2; getline; idxtitle = $0; getline; idxcaption = $0; getline; idxyear = $0; getline; idxwebdir = $0; getline; idxthumb = $0; diridx = 1; } else if ($1 == "DIRKEY") { hepudir[numinfo] = $2; key[numinfo] = $3; getline; title[numinfo] = $0; getline; caption[numinfo] = $0; getline; srcdir[numinfo] = $0; getline; year[numinfo] = $0; getline; webdir[numinfo] = $0; getline; thumb[numinfo] = $0; numinfo++; } } END { print "INFO2WEB diridx=" diridx " numinfo=" numinfo > "/dev/stderr"; for (i=0; i "/dev/stderr"; system("cp -a " idxhepudir "/index.html " webbase "/" idxwebdir "/index.html"); system("touch " webbase "/" idxwebdir "/index.html"); } } } #--