summaryrefslogtreecommitdiff
path: root/rsync
diff options
context:
space:
mode:
authorJuergen Daubert <jue@jue.li>2017-03-13 11:33:04 +0100
committerJuergen Daubert <jue@jue.li>2017-03-13 11:33:04 +0100
commit02903aa42a48df4610028721cd37b11149d52cc8 (patch)
treecbea0f377eb624940d27d73ecd56b0d24ccd389e /rsync
parentfcb0981015b1f945606bbc770aa9b53c5af7e4b2 (diff)
downloadcore-02903aa42a48df4610028721cd37b11149d52cc8.tar.gz
core-02903aa42a48df4610028721cd37b11149d52cc8.tar.xz
rsync: improve rsync ports driver, thanks to just_fun for the patch. FS#1391
Diffstat (limited to 'rsync')
-rw-r--r--rsync/.md5sum2
-rw-r--r--rsync/.signature6
-rw-r--r--rsync/Pkgfile2
-rw-r--r--rsync/rsync.driver30
4 files changed, 12 insertions, 28 deletions
diff --git a/rsync/.md5sum b/rsync/.md5sum
index e648e66d..19eba034 100644
--- a/rsync/.md5sum
+++ b/rsync/.md5sum
@@ -1,4 +1,4 @@
0f758d7e000c0f7f7d3792610fad70cb rsync-3.1.2.tar.gz
-bd6cc8e2c83d5e845af20a30e105fb5f rsync.driver
+14204afadda00617ce1ff5f0cc414b7e rsync.driver
d20f1ca0fb415a6788808c75170d951a rsyncd
b4e95fa8c8f3ae13cfdf616abd6a3960 rsyncd.conf
diff --git a/rsync/.signature b/rsync/.signature
index 9a6dadda..41b5a157 100644
--- a/rsync/.signature
+++ b/rsync/.signature
@@ -1,8 +1,8 @@
untrusted comment: verify with /etc/ports/core.pub
-RWRJc1FUaeVeqo/eo6PI41PWGO6F7OSVUW71UxJF1cg80Q3xrm+6G8dxClUtLeyfZE0ZtoZcpmT05tkxQ4dHyWB35EkrTc6JyQY=
-SHA256 (Pkgfile) = 14f7d621c44d11d246a7b2f77ec238bcdd687c16e78952a9b87c321392f0b47d
+RWRJc1FUaeVeqg4Sss6VzQhxTYV/ke0Lc0GMDN6bGtGYWO/7YXIAkzALvAVKmJo3zLMdBCh+wv3BL4DmhVfbU54ALt6lurP9pw0=
+SHA256 (Pkgfile) = 4f2ec898eb4e3a04b7bb688435473d4fefff9c83bf0575eaf8a945abe5a4c7e6
SHA256 (.footprint) = 66208e83d257797b507df7559291a4059dba7f26019d5832ef535e6f3bd4c71a
SHA256 (rsync-3.1.2.tar.gz) = ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2
SHA256 (rsyncd.conf) = 095447801d8ba0101809c18acfb5a492c65323bed9ef5dd3739b3af5e9f7c56d
SHA256 (rsyncd) = e8dc013ff31ee7b1f249fcfbde579ec76fe3103f61d26d098d45290727060c85
-SHA256 (rsync.driver) = 5e0f94a972cf7e47f153ccd0ac454ec2bd3056a834b69e82d3f3984d44308ef7
+SHA256 (rsync.driver) = 56feeb05146391314a23342880323f62897ab1027009a8b86a389e91a9986ec6
diff --git a/rsync/Pkgfile b/rsync/Pkgfile
index ec410a0d..ca25a7cf 100644
--- a/rsync/Pkgfile
+++ b/rsync/Pkgfile
@@ -5,7 +5,7 @@
name=rsync
version=3.1.2
-release=1
+release=2
source=(https://rsync.samba.org/ftp/$name/src/$name-$version.tar.gz \
rsyncd.conf rsyncd rsync.driver)
diff --git a/rsync/rsync.driver b/rsync/rsync.driver
index 14dd3e5f..d957853d 100644
--- a/rsync/rsync.driver
+++ b/rsync/rsync.driver
@@ -58,23 +58,6 @@ 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
@@ -100,12 +83,13 @@ 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");
-foreach my $checkout (sort keys %new_checkouts)
-{
- print FILE "$checkout\n";
-}
+print FILE join "\n", keys(%new_checkouts);
close(FILE);
# use chroot as an additional safety measure when removing files
@@ -113,7 +97,7 @@ chroot($destination) or error("Couldn't chroot into $destination");
chdir('/');
# iterate through old checkouts, remove obsolete files
-foreach my $checkout (sort keys %old_checkouts)
+foreach my $checkout (keys %old_checkouts)
{
if (!$new_checkouts{$checkout})
{
@@ -126,7 +110,7 @@ foreach my $checkout (sort keys %old_checkouts)
}
# iterate through old checkouts, remove obsolete directories
-foreach my $checkout (sort keys %old_checkouts)
+foreach my $checkout (keys %old_checkouts)
{
if (!$new_checkouts{$checkout})
{

Generated by cgit