Commits

Michał Górny committed ef62275

Revert the implementation of global action support.

This partially reverts commits 09d0fdf9f322e610600d757446efcfa03ed76d45
and bbba31e6c0f8f6df130d299b6a770ea3e62bce3e.

The approach of passing additional MakeConf object next to PackageFiles
required a lot of changes and duplications in the action handling code.
A new approach will be used instead, merging MakeConf partially into
PackageFiles.

Comments (0)

Files changed (3)

lib/flaggie/action.py

 			return out
 
 	class enable(EffectiveEntryOp):
-		def __call__(self, pkgs, pfiles, mkconf):
+		def __call__(self, pkgs, pfiles):
 			for p in pkgs:
 				for ns, arg in self.expand_patterns(self.args, p):
 					f = self.grab_effective_entry(p, arg, pfiles[ns], rw = True)
 				raise NotImplementedError('Global actions are not supported yet.')
 
 	class disable(EffectiveEntryOp):
-		def __call__(self, pkgs, pfiles, mkconf):
+		def __call__(self, pkgs, pfiles):
 			for p in pkgs:
 				for ns, arg in self.expand_patterns(self.args, p):
 					f = self.grab_effective_entry(p, arg, pfiles[ns], rw = True)
 				raise NotImplementedError('Global actions are not supported yet.')
 
 	class reset(BaseAction):
-		def __call__(self, pkgs, pfiles, mkconf):
+		def __call__(self, pkgs, pfiles):
 			for ns in self.ns:
 				puse = pfiles[ns]
 				for p in pkgs:
 					raise NotImplementedError('Global actions are not supported yet.')
 
 	class output(BaseAction):
-		def __call__(self, pkgs, pfiles, mkconf):
+		def __call__(self, pkgs, pfiles):
 			for ns in self.ns:
 				puse = pfiles[ns]
 				for p in pkgs:
 						l.append(flags[fn].toString() if flags[fn] is not None else '?%s' % fn)
 
 					print(' '.join(l))
-
 				if not pkgs:
-					mvar = mkconf[ns]
-					flags = {}
-					l = ['<global>']
-					for arg in self.args:
-						for f in mvar[arg]:
-							if f.name not in flags:
-								flags[f.name] = f
-					for arg in self.args:
-						if arg not in flags and not isinstance(arg, self.Pattern):
-							flags[arg] = None
-					if not flags:
-						continue
-					for fn in sorted(flags):
-						l.append(flags[fn].toString() if flags[fn] is not None else '?%s' % fn)
-
-					print(' '.join(l))
+					raise NotImplementedError('Global actions are not supported yet.')
 
 	mapping = {
 		'+': enable,
 		else:
 			self.pkgs.append(item)
 
-	def __call__(self, pfiles, mkconf):
+	def __call__(self, pfiles):
 		self.sort()
 		for a in self:
-			a(self.pkgs, pfiles, mkconf)
+			a(self.pkgs, pfiles)

lib/flaggie/cleanup.py

 			raise AssertionError('pkgs not empty in cleanup action')
 		self._cache = cache
 
-	def __call__(self, pkgs, pfiles, mkconf):
+	def __call__(self, pkgs, pfiles):
 		if pkgs:
 			raise AssertionError('pkgs not empty in cleanup action')
 		for f in pfiles:
 					pe.remove(flag)
 
 class DropUnmatchedFlags(BaseCleanupAction):
-	def __call__(self, pkgs, pfiles, mkconf):
+	def __call__(self, pkgs, pfiles):
 		if pkgs:
 			raise AssertionError('pkgs not empty in cleanup action')
 		
 
 	for actset in act:
 		try:
-			actset(pfiles, mkconf)
+			actset(pfiles)
 		except NotImplementedError as e:
 			output.write('Warning: %s\n' % e)