diff options
author | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-10-21 22:06:06 +0200 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-10-21 22:11:24 +0200 |
commit | 23f48e65a5f4133be8a5d2883de6ffb2f4f04962 (patch) | |
tree | 2106d4d3a956424e9068e231b55c98ffc99c558c /db-update | |
parent | 0dd49e0e02f40a1687814f15d4aea55e1cc8411a (diff) | |
download | dbscripts-23f48e65a5f4133be8a5d2883de6ffb2f4f04962.tar.gz dbscripts-23f48e65a5f4133be8a5d2883de6ffb2f4f04962.tar.xz |
Add copy_helper function to ensure correct permissions
This will force all files copied back and forth to have
0664 permissions so that we can attempt to do away with
this permission adjusting cron job
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'db-update')
-rwxr-xr-x | db-update | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -76,7 +76,7 @@ cd "$WORKDIR" # copy the db file into our working area if [ -f "$ftppath/$reponame.db.tar.$DB_COMPRESSION" ]; then - cp "$ftppath/$reponame.db.tar.$DB_COMPRESSION" build/ + copy_helper "$ftppath/$reponame.db.tar.$DB_COMPRESSION" build/ else touch "build/$reponame.db.tar.$DB_COMPRESSION" fi @@ -130,7 +130,7 @@ if [ -n "$ADDPKGS" ]; then if [ -n "$to_add" ]; then cd "$WORKDIR/build/" - /bin/cp $to_add . + for f in $to_add; do copy_helper "$f" .; done pkgs="" for pkg in $to_add; do pkgs="$pkgs $(basename $pkg)"; done @@ -192,9 +192,11 @@ fi # if non empty, move all build dirs if [ $(/bin/ls "$WORKDIR/build/" 2>/dev/null | wc -l) != 0 ]; then echo "Copying new files to '$ftppath'" - if ! /bin/cp -r "$WORKDIR/build/"* "$ftppath"; then - die "error: failure while copying files to $ftppath" - fi + for f in "$WORKDIR/build/"*; do + if ! copy_helper "$f" "$ftppath"; then + die "error: failure while copying files to $ftppath" + fi + done else echo "Nothing to copy, no work done" |