diff options
author | Peter Palfrader <peter@palfrader.org> | 2013-01-27 18:38:28 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2013-01-27 18:38:28 +0000 |
commit | 28026e53148d94b0388d285c4429929d9b6aa3b8 (patch) | |
tree | ad8198c288f6c3004b437a156d4853cb3bb0e99c | |
parent | be4b425891d26deb1f58b4d9e74accce206e4785 (diff) |
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
-rwxr-xr-x | publish | 26 |
1 files changed, 15 insertions, 11 deletions
@@ -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 |