1. Michał Górny
  2. smart-live-rebuild


Michał Górny  committed 4476d67

Add a --quiet option to silence status messages.

As requested by Rick Farina (Zero_Chaos).

  • Participants
  • Parent commits dd599fe
  • Branches master

Comments (0)

Files changed (4)

File smartliverebuild/cli.py

View file
  • Ignore whitespace
 		help='Only print a list of the packages which were updated; do not call emerge to rebuild them.')
 	opt.add_option('-P', '--profile', action='store', dest='profile',
 		help='Configuration profile (config file section) to use (default: smart-live-rebuild)')
+	opt.add_option('-q', '--quiet', action='store_true', dest='quiet',
+		help='Do not output progress messages, just errors.')
 	opt.add_option('-Q', '--quickpkg', action='store_true', dest='quickpkg',
 		help='Call quickpkg to create binary backups of packages which are going to be updated.')
 	opt.add_option('-r', '--remote-only', action='store_true', dest='remote_only',

File smartliverebuild/config.py

View file
  • Ignore whitespace
 			'pretend': 'False',
 			'profile': 'smart-live-rebuild',
 			'quickpkg': 'False',
+			'quiet': 'False',
 			'remote_only': 'False',
 			'setuid': str(pm_conf.userpriv_enabled),
 			'timeout': '0',

File smartliverebuild/core.py

View file
  • Ignore whitespace
 def SmartLiveRebuild(opts, pm, cliargs = None):
 	if not opts.color:
+	if opts.quiet:
+		out.silence()
 	if opts.jobs <= 0:
 		out.err('The argument to --jobs option must be a positive integer.')

File smartliverebuild/output.py

View file
  • Ignore whitespace
 				if isinstance(v, str) and v.startswith('\033'):
 					setattr(self, k, '')
+	def silence(self):
+		self.s1 = lambda x: None
+		self.s2 = lambda x: None
+		self.s3 = lambda x: None
 	def s1(self, msg):
 		self.out('%s*** %s%s\n' % (self.s1reset, msg, self.reset))
 		self._cur_header = None