diff options
| author | Paul Buetow (mars.fritz.box) <paul@buetow.org> | 2014-01-11 13:23:27 +0100 |
|---|---|---|
| committer | Paul Buetow (mars.fritz.box) <paul@buetow.org> | 2014-01-11 13:23:27 +0100 |
| commit | bae474ed42c3151658a75e250cd85bb573e02dfe (patch) | |
| tree | c933fef60a87529d059292e3b81c74d611307930 | |
| parent | 86c5276a3319163d8e183c6e91df1d30c00b5cb9 (diff) | |
New release
| -rw-r--r-- | .version | 2 | ||||
| -rw-r--r-- | debian/changelog | 12 | ||||
| -rw-r--r-- | docs/photoalbum.1 | 2 | ||||
| -rwxr-xr-x | src/photoalbum.sh | 60 |
4 files changed, 45 insertions, 31 deletions
@@ -1 +1 @@ -0.2.0 +0.2.2 diff --git a/debian/changelog b/debian/changelog index ba9ea2c..53ed5fc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +photoalbum (0.2.2) stable; urgency=low + + * Some cosmetic source code fixes + + -- Paul Buetow <paul@buetow.org> Sat, 11 Jan 2014 13:22:15 +0100 + +photoalbum (0.2.1) stable; urgency=low + + * Re-tagging due to some irritation + + -- Paul Buetow <paul@buetow.org> Sat, 11 Jan 2014 12:35:16 +0100 + photoalbum (0.2.0) stable; urgency=low * Add support for tarball-inclusion diff --git a/docs/photoalbum.1 b/docs/photoalbum.1 index f285ff4..54bcaa0 100644 --- a/docs/photoalbum.1 +++ b/docs/photoalbum.1 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "PHOTOALBUM 1" -.TH PHOTOALBUM 1 "2013-12-29" "photoalbum 0.2.0" "User Commands" +.TH PHOTOALBUM 1 "2013-12-29" "photoalbum 0.2.2" "User Commands" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/src/photoalbum.sh b/src/photoalbum.sh index 85a1cab..38c6f09 100755 --- a/src/photoalbum.sh +++ b/src/photoalbum.sh @@ -1,30 +1,31 @@ -#!/bin/bash +#!/bin/bash -# photoalbum (c) 2011, 2012, 2013 by Paul Buetow +# photoalbum (c) 2011 - 2014 by Paul Buetow # http://photoalbum.buetow.org declare -r ARG1="${1}" ; shift declare -r VERSION='PHOTOALBUMVERSION' +declare -r DEFAULTRC=/etc/default/photoalbum -usage () { +usage() { cat - <<USAGE >&2 Usage: $0 [clean|init|version|generate|all] USAGE } -init () { +init() { for dir in "${INCOMING_DIR}" "${DIST_DIR}/photos" "${DIST_DIR}/thumbs" "${DIST_DIR}/html"; do [ -d "${dir}" ] || mkdir -vp "${dir}" done } -clean () { +clean() { echo "Not deleting ${INCOMING_DIR}" [ -d "${DIST_DIR}" ] && rm -Rf "${DIST_DIR}" } -tarball () { +tarball() { # Cleanup tarball from prev run if any find "${DIST_DIR}" -maxdepth 1 -type f -name \*.tar -delete @@ -38,7 +39,7 @@ tarball () { fi } -generate () { +generate() { if [ ! -d "${INCOMING_DIR}" ]; then echo "ERROR: You may run init first, no such directory: ${INCOMING_DIR}" >&2 exit 1 @@ -62,41 +63,41 @@ generate () { tarball } -template () { +template() { local -r template=${1} ; shift local -r html=${1} ; shift source "${TEMPLATE_DIR}/${template}.tmpl" >> "${DIST_DIR}/html/${html}.html" } -scale () { +scale() { cd "${INCOMING_DIR}" && find ./ -type f | sort | while read photo; do - photo=$(sed 's#^\./##' <<< "${photo}") + photo=$(sed 's#^\./##' <<< "${photo}") - if [ ! -f "${DIST_DIR}/photos/${photo}" ]; then - # Flatten directories / to __ - if [[ "${photo}" =~ / ]]; then - destphoto="${photo//\//__}" - else - destphoto="${photo}" - fi + if [ ! -f "${DIST_DIR}/photos/${photo}" ]; then + # Flatten directories / to __ + if [[ "${photo}" =~ / ]]; then + destphoto="${photo//\//__}" + else + destphoto="${photo}" + fi - destphoto="${destphoto/./}" + destphoto="${destphoto/./}" - echo "Scaling ${photo} to ${DIST_DIR}/photos/${destphoto}" + echo "Scaling ${photo} to ${DIST_DIR}/photos/${destphoto}" - convert -auto-orient \ - -geometry ${GEOMETRY} "${photo}" "${DIST_DIR}/photos/${destphoto}" - fi -done + convert -auto-orient \ + -geometry ${GEOMETRY} "${photo}" "${DIST_DIR}/photos/${destphoto}" + fi + done -echo 'Removing spaces from file names' -find "${DIST_DIR}/photos" -type f -name '* *' | while read file; do -rename 's/ /_/g' "${file}" -done + echo 'Removing spaces from file names' + find "${DIST_DIR}/photos" -type f -name '* *' | while read file; do + rename 's/ /_/g' "${file}" + done } -makedist () { +makedist() { local num=${1} ; shift local name=page-${num} local -i i=0 @@ -166,7 +167,7 @@ makedist () { done } -source /etc/default/photoalbum +source "${DEFAULTRC}" if [ -f ~/.photoalbumrc ]; then source ~/.photoalbumrc @@ -195,4 +196,5 @@ case "${ARG1}" in ;; esac +exit 0 |
