--- layman/action.py +++ layman/action.py @@ -90,6 +90,8 @@ self.rdb = RemoteDB(config) + self.quiet = config['quiet'] + self.selection = config['sync'] if config['sync_all'] or 'ALL' in self.selection: @@ -117,7 +119,7 @@ 'dding the overlay!') try: - self.db.sync(i) + self.db.sync(i, self.quiet) success.append('Successfully synchronized overlay "' + i + '".') except Exception, error: warnings.append( @@ -154,6 +156,8 @@ self.rdb = RemoteDB(config) + self.quiet = config['quiet'] + self.selection = config['add'] enc = sys.getfilesystemencoding() @@ -176,7 +180,7 @@ if overlay: try: - self.db.add(overlay) + self.db.add(overlay, self.quiet) OUT.info('Successfully added overlay "' + i + '".', 2) except Exception, error: OUT.warn('Failed to add overlay "' + i + '".\nError was: ' --- layman/db.py +++ layman/db.py @@ -60,7 +60,7 @@ OUT.debug('DB handler initiated', 6) - def add(self, overlay): + def add(self, overlay, quiet = False): ''' Add an overlay to the local list of overlays. @@ -106,7 +106,7 @@ ''' if overlay.name not in self.overlays.keys(): - result = overlay.add(self.config['storage']) + result = overlay.add(self.config['storage'], quiet) if result == 0: if 'priority' in self.config.keys(): overlay.set_priority(self.config['priority']) @@ -182,13 +182,13 @@ else: raise Exception('No local overlay named "' + overlay.name + '"!') - def sync(self, overlay_name): + def sync(self, overlay_name, quiet = False): '''Synchronize the given overlay.''' overlay = self.select(overlay_name) if overlay: - result = overlay.sync(self.config['storage']) + result = overlay.sync(self.config['storage'], quiet) if result: raise Exception('Syncing overlay "' + overlay_name + '" returned status ' + str(result) + '!') --- layman/overlays/bzr.py +++ layman/overlays/bzr.py @@ -42,7 +42,7 @@ binary_command = '/usr/bin/bzr' - def add(self, base): + def add(self, base, quiet = False): '''Add overlay.''' self.supported() @@ -50,7 +50,7 @@ return self.cmd(self.binary_command + ' get "' + self.src + '/" "' +\ path([base, self.name]) + '"') - def sync(self, base): + def sync(self, base, quiet = False): '''Sync overlay.''' self.supported() --- layman/overlays/cvs.py +++ layman/overlays/cvs.py @@ -49,22 +49,32 @@ else: self.subpath = '' - def add(self, base): + def add(self, base, quiet = False): '''Add overlay.''' self.supported() + if quiet: + quiet_option = ' -q' + else: + quiet_option = '' + return self.cmd('cd "' + base + '" && CVSROOT="' + self.src + '" ' + - self.binary + ' co -d "' + self.name + self.binary + quiet_option + ' co -d "' + self.name + '" "' + self.subpath + '"' ) - def sync(self, base): + def sync(self, base, quiet = False): '''Sync overlay.''' self.supported() + if quiet: + quiet_option = ' -q' + else: + quiet_option = '' + return self.cmd('cd "' + path([base, self.name]) + '" && ' + - self.binary + ' update') + self.binary + quiet_option + ' update') def supported(self): '''Overlay type supported?''' --- layman/overlays/darcs.py +++ layman/overlays/darcs.py @@ -41,7 +41,7 @@ binary_command = '/usr/bin/darcs' - def add(self, base): + def add(self, base, quiet = False): '''Add overlay.''' self.supported() @@ -49,7 +49,7 @@ return self.cmd(self.binary_command + ' get --partial "' + self.src + '/" "' + path([base, self.name]) + '"') - def sync(self, base): + def sync(self, base, quiet = False): '''Sync overlay.''' self.supported() --- layman/overlays/git.py +++ layman/overlays/git.py @@ -40,21 +40,31 @@ binary_command = '/usr/bin/git' - def add(self, base): + def add(self, base, quiet = False): '''Add overlay.''' self.supported() - return self.cmd(self.binary_command + ' clone "' + self.src + '/" "' + if quiet: + quiet_option = '-q ' + else: + quiet_option = '' + + return self.cmd(self.binary_command + ' clone ' + quiet_option + '"' + self.src + '/" "' + path([base, self.name]) + '"') - def sync(self, base): + def sync(self, base, quiet = False): '''Sync overlay.''' self.supported() + if quiet: + quiet_option = ' -q' + else: + quiet_option = '' + return self.cmd('cd "' + path([base, self.name]) + '" && ' - + self.binary_command + ' pull') + + self.binary_command + ' pull' + quiet_option) def supported(self): '''Overlay type supported?''' Pliki layman-1.2.0-/layman/overlays/.git.py.swp i layman-1.2.0/layman/overlays/.git.py.swp różnią się --- layman/overlays/mercurial.py +++ layman/overlays/mercurial.py @@ -41,7 +41,7 @@ binary_command = '/usr/bin/hg' - def add(self, base): + def add(self, base, quiet = False): '''Add overlay.''' self.supported() @@ -49,7 +49,7 @@ return self.cmd(self.binary_command + ' clone "' + self.src + '/" "' + path([base, self.name]) + '"') - def sync(self, base): + def sync(self, base, quiet = False): '''Sync overlay.''' self.supported() --- layman/overlays/overlay.py +++ layman/overlays/overlay.py @@ -123,7 +123,7 @@ return dict_to_node(self.data, document, 'overlay') - def add(self, base): + def add(self, base, quiet = False): '''Add the overlay.''' mdir = path([base, self.name]) @@ -134,7 +134,7 @@ os.makedirs(mdir) - def sync(self, base): + def sync(self, base, quiet = False): '''Sync the overlay.''' pass --- layman/overlays/rsync.py +++ layman/overlays/rsync.py @@ -44,7 +44,7 @@ '--timeout=180 --exclude="distfiles/*" --exclude="local/*" ' + \ '--exclude="packages/*" ' - def add(self, base): + def add(self, base, quiet = False): '''Add overlay.''' self.supported() @@ -53,12 +53,17 @@ return self.sync(base) - def sync(self, base): + def sync(self, base, quiet = False): '''Sync overlay.''' self.supported() - return self.cmd(self.base + '"' + self.src + '/" "' + + if quiet: + quiet_option = '-q ' + else: + quiet_option = '' + + return self.cmd(self.base + quiet_option + '"' + self.src + '/" "' + path([base, self.name]) + '"') def supported(self): --- layman/overlays/svn.py +++ layman/overlays/svn.py @@ -40,22 +40,32 @@ binary = '/usr/bin/svn' - def add(self, base): + def add(self, base, quiet = False): '''Add overlay.''' self.supported() Overlay.add(self, base) - return self.cmd(self.binary + ' co "' + self.src + '/" "' + + if quiet: + quiet_option = '-q ' + else: + quiet_option = '' + + return self.cmd(self.binary + ' co ' + quiet_option + '"' + self.src + '/" "' + path([base, self.name]) + '"') - def sync(self, base): + def sync(self, base, quiet = False): '''Sync overlay.''' self.supported() - return self.cmd(self.binary + ' update "' + path([base, self.name]) + + if quiet: + quiet_option = '-q ' + else: + quiet_option = '' + + return self.cmd(self.binary + ' up ' + quiet_option + '"' + path([base, self.name]) + '"') def supported(self): --- layman/overlays/tar.py +++ layman/overlays/tar.py @@ -88,7 +88,7 @@ else: self.category = '' - def add(self, base): + def add(self, base, quiet = False): '''Add overlay.''' self.supported() @@ -163,7 +163,7 @@ return result - def sync(self, base): + def sync(self, base, quiet = False): '''Sync overlay.''' self.supported()