Commits

Michał Górny committed 1a84bf8

Set remote_only globally for VCSLoader.

Comments (0)

Files changed (2)

smartliverebuild/core.py

 
 			filters = (opts.filter_packages or []) + (cliargs or [])
 			filt = PackageFilter(filters)
-			getvcs = VCSLoader()
+			getvcs = VCSLoader(remote_only = opts.remote_only)
 
 			try:
 				for pkg in pm.installed.filter(filt):
 					try:
 						for vcs in pkg.inherits:
-							vcscl = getvcs(vcs, allowed, remote_only = opts.remote_only)
+							vcscl = getvcs(vcs, allowed)
 							if vcscl is not None:
 								vcs = vcscl(str(pkg.slotted_atom), pkg.environ, opts)
 

smartliverebuild/vcsload.py

 class VCSLoader(object):
 	vcs_cache = {}
 
-	def __call__(self, eclassname, allowed = [], remote_only = False):
+	def __init__(self, remote_only = False):
+		self._remote_only = remote_only
+
+	def __call__(self, eclassname, allowed = []):
 		if eclassname not in self.vcs_cache:
 			self.vcs_cache[eclassname] = None
 			if not allowed or eclassname in allowed:
 						if k.endswith('Support') and \
 								k[:-7].lower() == eclassname.replace('-', ''):
 							vcscl = getattr(mod, k)
-							if remote_only and not issubclass(vcscl, RemoteVCSSupport):
+							if self._remote_only and not issubclass(vcscl, RemoteVCSSupport):
 								break
 							self.vcs_cache[eclassname] = vcscl
 							break