From 28026e53148d94b0388d285c4429929d9b6aa3b8 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 27 Jan 2013 18:38:28 +0000 Subject: Hide publish.ttl files and create them by default git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@581 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- publish | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'publish') diff --git a/publish b/publish index 460e0d2..0f6b790 100755 --- a/publish +++ b/publish @@ -51,6 +51,8 @@ base_rsync=marvin.example.com:/var/www/www.example.com/htdocs/pub history_file=~/.publish.history history_lines=1000 +ttl=180 + date_format='%Y-%m-%d-' rsync_args="--compress --times --chmod=u=rwX,go=rX" @@ -220,12 +222,12 @@ d_server="$d_date$d_random" d_server_http_base=$( echo -n "$d_server" | uri_encode ) base_uri="$base_http/$d_server_http_base/" main_uri="$base_uri" -trail="" one_dir_only="" if [ "$#" = 1 ]; then if [ -d "$1" ]; then - trail="/" + set dummy "$1/" + shift one_dir_only=1 else main_uri="$base_uri$( echo -n "$(basename "$1")" | uri_encode )" @@ -276,20 +278,22 @@ while [ "$#" -gt 0 ]; do file="$1" shift - if [ -z "$relative" ]; then - if [ -z "$one_dir_only" ]; then - uri="$base_uri""$( echo -n "`basename "$file"`" | uri_encode )" + if [ "${file%/.publish.ttl}" == "$file" ]; then + if [ -z "$relative" ]; then + if [ -z "$one_dir_only" ]; then + uri="$base_uri""$( echo -n "`basename "$file"`" | uri_encode )" + else + uri="$base_uri" + fi else - uri="$base_uri" + uri="$base_uri""$( echo -n $file | uri_encode )" fi - else - uri="$base_uri""$( echo -n $file | uri_encode )" + echo "$uri" + history_append "$uri" fi - echo "$uri" - history_append "$uri" rsync_pre_invoke - $NODO rsync --recursive $rsync_args $relative "$file$trail" $base_rsync"/$d_server/" + $NODO rsync --recursive $rsync_args $relative "$file" $base_rsync"/$d_server/" rsync_post_invoke done -- cgit v1.2.3