Skip to content

Commit

Permalink
pbulk upload: ensure rsync ran before moving dirs.
Browse files Browse the repository at this point in the history
Should avoid joyent/pkgsrc#447 when rsync=:
  • Loading branch information
Jonathan Perkin committed Jan 1, 2017
1 parent 8d5431c commit bddd881
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkgtools/pbulk/files/pbulk/scripts/upload
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@ else
# on tmpdest as that is usually a hidden directory, avoiding directory
# listings showing the old directory while it is being deleted.
ssh ${pkg_rsync_target_host} "
if [ -d ${pkg_rsync_target_linkdest} ]; then
mv ${pkg_rsync_target_linkdest} ${pkg_rsync_target_tmpdest}-old
else
mkdir -p $(dirname ${pkg_rsync_target_linkdest})
if [ -f ${pkg_rsync_target_tmpdest}/All/pkg_summary.gz ]; then
if [ -d ${pkg_rsync_target_linkdest} ]; then
mv ${pkg_rsync_target_linkdest} ${pkg_rsync_target_tmpdest}-old
else
mkdir -p $(dirname ${pkg_rsync_target_linkdest})
fi
mv ${pkg_rsync_target_tmpdest} ${pkg_rsync_target_linkdest}
rm -rf ${pkg_rsync_target_tmpdest}-old
fi
mv ${pkg_rsync_target_tmpdest} ${pkg_rsync_target_linkdest}
rm -rf ${pkg_rsync_target_tmpdest}-old
"
fi

Expand Down

0 comments on commit bddd881

Please sign in to comment.