Revert "rsync: improve rsync ports driver, thanks to just_fun for the patch. FS#1391"

This reverts commit 02903aa42a.
This commit is contained in:
Juergen Daubert 2017-05-22 16:29:15 +02:00
parent 56fd994ee8
commit ab3ec4e65c
4 changed files with 28 additions and 12 deletions

View File

@ -1,4 +1,4 @@
0f758d7e000c0f7f7d3792610fad70cb rsync-3.1.2.tar.gz
14204afadda00617ce1ff5f0cc414b7e rsync.driver
bd6cc8e2c83d5e845af20a30e105fb5f rsync.driver
d20f1ca0fb415a6788808c75170d951a rsyncd
b4e95fa8c8f3ae13cfdf616abd6a3960 rsyncd.conf

View File

@ -1,8 +1,8 @@
untrusted comment: verify with /etc/ports/core.pub
RWRJc1FUaeVeqg4Sss6VzQhxTYV/ke0Lc0GMDN6bGtGYWO/7YXIAkzALvAVKmJo3zLMdBCh+wv3BL4DmhVfbU54ALt6lurP9pw0=
SHA256 (Pkgfile) = 4f2ec898eb4e3a04b7bb688435473d4fefff9c83bf0575eaf8a945abe5a4c7e6
RWRJc1FUaeVeqo/eo6PI41PWGO6F7OSVUW71UxJF1cg80Q3xrm+6G8dxClUtLeyfZE0ZtoZcpmT05tkxQ4dHyWB35EkrTc6JyQY=
SHA256 (Pkgfile) = 14f7d621c44d11d246a7b2f77ec238bcdd687c16e78952a9b87c321392f0b47d
SHA256 (.footprint) = 66208e83d257797b507df7559291a4059dba7f26019d5832ef535e6f3bd4c71a
SHA256 (rsync-3.1.2.tar.gz) = ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2
SHA256 (rsyncd.conf) = 095447801d8ba0101809c18acfb5a492c65323bed9ef5dd3739b3af5e9f7c56d
SHA256 (rsyncd) = e8dc013ff31ee7b1f249fcfbde579ec76fe3103f61d26d098d45290727060c85
SHA256 (rsync.driver) = 56feeb05146391314a23342880323f62897ab1027009a8b86a389e91a9986ec6
SHA256 (rsync.driver) = 5e0f94a972cf7e47f153ccd0ac454ec2bd3056a834b69e82d3f3984d44308ef7

View File

@ -5,7 +5,7 @@
name=rsync
version=3.1.2
release=2
release=1
source=(https://rsync.samba.org/ftp/$name/src/$name-$version.tar.gz \
rsyncd.conf rsyncd rsync.driver)

View File

@ -58,6 +58,23 @@ if (-e "$destination/.checkouts")
close(FILE);
}
print "Updating file list from " . $host . "::$collection\n";
# get the remote file list (new .checkouts)
open(PIPE, 'rsync -crz --no-human-readable ' . $host . '::' . $collection . '|') or error("Couldn't open pipe to rsync");
while (<PIPE>)
{
chomp;
next if /^MOTD:/; # ignore MOTD lines
s/^(.{43})//; # ignore the first 43 characters (mode, date etc...)
next if /^.$/; # ignore the . directory
$new_checkouts{$_} = 1;
}
close(PIPE);
error("Running rsync failed") unless $? == 0;
print "Updating collection " . basename($destination) . "\n";
# now really run rsync
@ -83,13 +100,12 @@ while (<PIPE>)
close(PIPE);
error("Running rsync failed") unless $? == 0;
open(PIPE, "find $destination -mindepth 1 -printf '%P\n'|") or error("Couldn't open pipe to find");
map { chomp; $new_checkouts{$_}=1 if $_ ne '.checkouts' } <PIPE>;
close(PIPE) or error("pipe to find failed");
# save new checkouts into .checkouts
open(FILE, ">$destination/.checkouts") or error("Couldn't save checkouts to $destination/.checkouts");
print FILE join "\n", keys(%new_checkouts);
foreach my $checkout (sort keys %new_checkouts)
{
print FILE "$checkout\n";
}
close(FILE);
# use chroot as an additional safety measure when removing files
@ -97,7 +113,7 @@ chroot($destination) or error("Couldn't chroot into $destination");
chdir('/');
# iterate through old checkouts, remove obsolete files
foreach my $checkout (keys %old_checkouts)
foreach my $checkout (sort keys %old_checkouts)
{
if (!$new_checkouts{$checkout})
{
@ -110,7 +126,7 @@ foreach my $checkout (keys %old_checkouts)
}
# iterate through old checkouts, remove obsolete directories
foreach my $checkout (keys %old_checkouts)
foreach my $checkout (sort keys %old_checkouts)
{
if (!$new_checkouts{$checkout})
{