Commits

Michał Górny committed 2625bb6

Retain incorrect argv args as well.

Now we pass all args to filter generator, and we just get broken ones
back.

  • Participants
  • Parent commits 10af040

Comments (0)

Files changed (1)

File smartliverebuild/core.py

 				else:
 					self.category = re.compile('.')
 				self.pn = makere(m.group(3))
-			else:
-				sys.stderr.write('Incorrect filter string: %s\n' % wildcard)
+#			XXX: the below test catches cliargs as well
+#			else:
+#				sys.stderr.write('Incorrect filter string: %s\n' % wildcard)
 
 			# .matched is used only on inclusive args
 			self.matched = self.exclusive
 		""" Init filters from pattern list. """
 		if wlist:
 			pmatchers = [self.PackageMatcher(w) for w in wlist]
+			self._broken = filter(lambda f: f.broken, pmatchers)
 			self._pmatchers = filter(lambda f: not f.broken, pmatchers)
 			for f in self._pmatchers:
 				self._default_pass = f.exclusive
 		for m in self._pmatchers:
 			if not m.matched:
 				yield m.wildcard
+		for m in self._broken:
+			yield m.wildcard
 
 def SmartLiveRebuild(opts, db = None, portdb = None, settings = None,
 		cliargs = None):
 
 			bash = BashParser()
 
-			filters = opts.filter_packages or []
-			if cliargs:
-				filters.extend(filter(lambda arg: not arg.startswith('-'), cliargs))
+			filters = (opts.filter_packages or []) + (cliargs or [])
 			filt = PackageFilter(filters)
 
 			try:
 			if cliargs:
 				nm = set(filt.nonmatched)
 				for i, el in enumerate(cliargs):
-					if not el.startswith('-') and el not in nm:
+					if el not in nm:
 						del cliargs[i]
 
 			if childpid == 0: