* [gentoo-commits] proj/R_overlay:master commit in: man/, roverlay/remote/
@ 2012-08-02 15:14 André Erdmann
0 siblings, 0 replies; only message in thread
From: André Erdmann @ 2012-08-02 15:14 UTC (permalink / raw
To: gentoo-commits
commit: a8b4e77c50d8f943b2239ce51b5e86bd589f7f31
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Aug 2 14:51:21 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Aug 2 14:51:21 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=a8b4e77c
rsync: remove --delete from default opts
---
man/roverlay-repo.5 | 8 +++++---
roverlay/remote/rsync.py | 30 ++++++++++++------------------
2 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/man/roverlay-repo.5 b/man/roverlay-repo.5
index 212aae9..08a4b52 100644
--- a/man/roverlay-repo.5
+++ b/man/roverlay-repo.5
@@ -24,9 +24,11 @@ It behaves like a local repo if syncing is disabled.
These rsync options are always passed to rsync:
.br
\fB
-\-\-links, \-\-safe-links, \-\-times, \-\-compress,
-\-\-dirs, \-\-prune-empty-dirs, \-\-force, \-\-delete,
-\-\-human-readable, \-\-stats, \-\-chmod=ugo=r,u+w,Dugo+
+\-\-links, \-\-safe-links,
+\-\-times,
+\-\-dirs, \-\-prune-empty-dirs,
+\-\-human-readable, \-\-stats,
+\-\-chmod=ugo=r,u+w,Dugo+
\fR
.IP "\(bu websync repositories (\&'websync_repo\&')"
A \fBwebsync repo\fR fetches an R package list (deb-control file, typically named PACKAGES)
diff --git a/roverlay/remote/rsync.py b/roverlay/remote/rsync.py
index 90f21f5..f0ffb5c 100644
--- a/roverlay/remote/rsync.py
+++ b/roverlay/remote/rsync.py
@@ -23,11 +23,10 @@ RETRY_ON_RETCODE = frozenset ((
24, # "Partial transfer due to vanished source files"
))
-# TODO:
# either reraise an KeyboardInterrupt while running rsync (which stops script
# execution unless the interrupt is catched elsewhere) or just set a
# non-zero return code (-> 'repo cannot be used')
-RERAISE_INTERRUPT = False
+RERAISE_INTERRUPT = True
# --recursive is not in the default opts, subdirs in CRAN/contrib are
# either R releases (2.xx.x[-patches]) or the package archive
@@ -35,11 +34,12 @@ DEFAULT_RSYNC_OPTS = (
'--links', # copy symlinks as symlinks,
'--safe-links', # but ignore links outside of tree
'--times', #
- '--compress', # FIXME: add lzo if necessary
+# '--compress', # .tar.gz ("99%" of synced files) is excluded
+ # from --compress anyway
'--dirs', #
'--prune-empty-dirs', #
- '--force', # allow deletion of non-empty dirs
- '--delete', #
+# '--force', # allow deletion of non-empty dirs
+# '--delete', # --delete is no longer a default opt
'--human-readable', #
'--stats', #
'--chmod=ugo=r,u+w,Dugo+x', # 0755 for transferred dirs, 0644 for files
@@ -96,7 +96,7 @@ class RsyncRepo ( BasicRepo ):
max_bw = config.get ( 'RSYNC_BWLIMIT', None )
if max_bw is not None:
- argv.append ( '--bwlimit=%i' % max_bw )
+ argv.append ( '--bwlimit=' + str ( max_bw ) )
if self.extra_opts:
argv.extend ( self.extra_opts )
@@ -142,12 +142,11 @@ class RsyncRepo ( BasicRepo ):
# this handles retcodes like
# * 24: "Partial transfer due to vanished source files"
- # FIXME replace loop condition "retcode != 0"
retry_count += 1
self.logger.warning (
- "rsync returned {!r}, retrying ({}/{})".format (
- retcode, retry_count, MAX_RSYNC_RETRY
+ "rsync returned {ret!r}, retrying ({now}/{_max})".format (
+ ret=retcode, now=retry_count, _max=MAX_RSYNC_RETRY
)
)
@@ -175,18 +174,13 @@ class RsyncRepo ( BasicRepo ):
except Exception as e:
# catch exceptions, log them and return False
- ## TODO: which exceptions to catch||pass?
self.logger.exception ( e )
self.logger.error (
- 'Repo %s cannot be used for ebuild creation due to errors '
- 'while running rsync (return code was %s).' % ( self.name, retcode )
- )
+ 'Repo {name} cannot be used for ebuild creation due to errors '
+ 'while running rsync (return code was {ret}).'.format (
+ name=self.name, ret=retcode
+ ) )
self._set_fail()
return False
# --- end of _dosync (...) ---
-
- def __str__ ( self ):
- return "rsync repo '%s': DISTDIR '%s', SRC_URI '%s', RSYNC_URI '%s'" \
- % ( self.name, self.distdir, self.src_uri, self.remote_uri )
- # --- end of __str__ (...) ---
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-08-02 15:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-02 15:14 [gentoo-commits] proj/R_overlay:master commit in: man/, roverlay/remote/ André Erdmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox