public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/deprecated/
@ 2017-07-15  2:08 Brian Dolbec
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2017-07-15  2:08 UTC (permalink / raw
  To: gentoo-commits

commit:     9fc806a9a29433250fb593c5302874bbef74a0c6
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 00:19:12 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jul 15 02:08:27 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9fc806a9

repoman: New linechecks module, deprecated

 .../modules/linechecks/deprecated/__init__.py      | 46 +++++++++++++++
 .../modules/linechecks/deprecated/deprecated.py    | 32 +++++++++++
 .../modules/linechecks/deprecated/inherit.py       | 66 ++++++++++++++++++++++
 3 files changed, 144 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py b/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py
new file mode 100644
index 000000000..8c5f61d49
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py
@@ -0,0 +1,46 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Deprecated plug-in module for repoman LineChecks.
+Performs miscelaneous deprecation checks on ebuilds not covered by
+specialty modules."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'deprecated',
+	'description': doc,
+	'provides':{
+		'useq-check': {
+			'name': "useq",
+			'sourcefile': "deprecated",
+			'class': "DeprecatedUseq",
+			'description': doc,
+		},
+		'hasq-check': {
+			'name': "hasq",
+			'sourcefile': "deprecated",
+			'class': "DeprecatedHasq",
+			'description': doc,
+		},
+		'preserve-check': {
+			'name': "preservelib",
+			'sourcefile': "deprecated",
+			'class': "PreserveOldLib",
+			'description': doc,
+		},
+		'bindnow-check': {
+			'name': "bindnow",
+			'sourcefile': "deprecated",
+			'class': "DeprecatedBindnowFlags",
+			'description': doc,
+		},
+		'inherit-check': {
+			'name': "inherit",
+			'sourcefile': "inherit",
+			'class': "InheritDeprecated",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/deprecated.py b/repoman/pym/repoman/modules/linechecks/deprecated/deprecated.py
new file mode 100644
index 000000000..b33852e74
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/deprecated.py
@@ -0,0 +1,32 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class DeprecatedUseq(LineCheck):
+	"""Checks for use of the deprecated useq function"""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'(^|.*\b)useq\b')
+	error = 'USEQ_ERROR'
+
+
+class DeprecatedHasq(LineCheck):
+	"""Checks for use of the deprecated hasq function"""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'(^|.*\b)hasq\b')
+	error = 'HASQ_ERROR'
+
+
+class PreserveOldLib(LineCheck):
+	"""Check for calls to the deprecated preserve_old_lib function."""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'.*preserve_old_lib')
+	error = 'PRESERVE_OLD_LIB'
+
+
+class DeprecatedBindnowFlags(LineCheck):
+	"""Check for calls to the deprecated bindnow-flags function."""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'.*\$\(bindnow-flags\)')
+	error = 'DEPRECATED_BINDNOW_FLAGS'

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py b/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py
new file mode 100644
index 000000000..8a20f22a4
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py
@@ -0,0 +1,66 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class InheritDeprecated(LineCheck):
+	"""Check if ebuild directly or indirectly inherits a deprecated eclass."""
+
+	repoman_check_name = 'inherit.deprecated'
+
+	# deprecated eclass : new eclass (False if no new eclass)
+	deprecated_eclasses = {
+		"base": False,
+		"bash-completion": "bash-completion-r1",
+		"boost-utils": False,
+		"clutter": "gnome2",
+		"confutils": False,
+		"distutils": "distutils-r1",
+		"games": False,
+		"gems": "ruby-fakegem",
+		"gpe": False,
+		"gst-plugins-bad": "gstreamer",
+		"gst-plugins-base": "gstreamer",
+		"gst-plugins-good": "gstreamer",
+		"gst-plugins-ugly": "gstreamer",
+		"gst-plugins10": "gstreamer",
+		"mono": "mono-env",
+		"python": "python-r1 / python-single-r1 / python-any-r1",
+		"ruby": "ruby-ng",
+		"x-modular": "xorg-2",
+	}
+
+	_inherit_re = re.compile(r'^\s*inherit\s(.*)$')
+
+	def new(self, pkg):
+		self._errors = []
+
+	def check(self, num, line):
+		direct_inherits = None
+		m = self._inherit_re.match(line)
+		if m is not None:
+			direct_inherits = m.group(1)
+			if direct_inherits:
+				direct_inherits = direct_inherits.split()
+
+		if not direct_inherits:
+			return
+
+		for eclass in direct_inherits:
+			replacement = self.deprecated_eclasses.get(eclass)
+			if replacement is None:
+				pass
+			elif replacement is False:
+				self._errors.append(
+					"please migrate from "
+					"'%s' (no replacement) on line: %d" % (eclass, num + 1))
+			else:
+				self._errors.append(
+					"please migrate from "
+					"'%s' to '%s' on line: %d" % (eclass, replacement, num + 1))
+
+	def end(self):
+		for error in self._errors:
+			yield error
+		del self._errors


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/deprecated/
@ 2017-07-15  2:29 Brian Dolbec
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2017-07-15  2:29 UTC (permalink / raw
  To: gentoo-commits

commit:     97374402b22363bb3d21e21a0344072405e9b454
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 00:19:12 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jul 15 02:25:44 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=97374402

repoman: New linechecks module, deprecated

 .../modules/linechecks/deprecated/__init__.py      | 46 +++++++++++++++
 .../modules/linechecks/deprecated/deprecated.py    | 32 +++++++++++
 .../modules/linechecks/deprecated/inherit.py       | 66 ++++++++++++++++++++++
 3 files changed, 144 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py b/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py
new file mode 100644
index 000000000..8c5f61d49
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py
@@ -0,0 +1,46 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Deprecated plug-in module for repoman LineChecks.
+Performs miscelaneous deprecation checks on ebuilds not covered by
+specialty modules."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'deprecated',
+	'description': doc,
+	'provides':{
+		'useq-check': {
+			'name': "useq",
+			'sourcefile': "deprecated",
+			'class': "DeprecatedUseq",
+			'description': doc,
+		},
+		'hasq-check': {
+			'name': "hasq",
+			'sourcefile': "deprecated",
+			'class': "DeprecatedHasq",
+			'description': doc,
+		},
+		'preserve-check': {
+			'name': "preservelib",
+			'sourcefile': "deprecated",
+			'class': "PreserveOldLib",
+			'description': doc,
+		},
+		'bindnow-check': {
+			'name': "bindnow",
+			'sourcefile': "deprecated",
+			'class': "DeprecatedBindnowFlags",
+			'description': doc,
+		},
+		'inherit-check': {
+			'name': "inherit",
+			'sourcefile': "inherit",
+			'class': "InheritDeprecated",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/deprecated.py b/repoman/pym/repoman/modules/linechecks/deprecated/deprecated.py
new file mode 100644
index 000000000..b33852e74
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/deprecated.py
@@ -0,0 +1,32 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class DeprecatedUseq(LineCheck):
+	"""Checks for use of the deprecated useq function"""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'(^|.*\b)useq\b')
+	error = 'USEQ_ERROR'
+
+
+class DeprecatedHasq(LineCheck):
+	"""Checks for use of the deprecated hasq function"""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'(^|.*\b)hasq\b')
+	error = 'HASQ_ERROR'
+
+
+class PreserveOldLib(LineCheck):
+	"""Check for calls to the deprecated preserve_old_lib function."""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'.*preserve_old_lib')
+	error = 'PRESERVE_OLD_LIB'
+
+
+class DeprecatedBindnowFlags(LineCheck):
+	"""Check for calls to the deprecated bindnow-flags function."""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'.*\$\(bindnow-flags\)')
+	error = 'DEPRECATED_BINDNOW_FLAGS'

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py b/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py
new file mode 100644
index 000000000..8a20f22a4
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py
@@ -0,0 +1,66 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class InheritDeprecated(LineCheck):
+	"""Check if ebuild directly or indirectly inherits a deprecated eclass."""
+
+	repoman_check_name = 'inherit.deprecated'
+
+	# deprecated eclass : new eclass (False if no new eclass)
+	deprecated_eclasses = {
+		"base": False,
+		"bash-completion": "bash-completion-r1",
+		"boost-utils": False,
+		"clutter": "gnome2",
+		"confutils": False,
+		"distutils": "distutils-r1",
+		"games": False,
+		"gems": "ruby-fakegem",
+		"gpe": False,
+		"gst-plugins-bad": "gstreamer",
+		"gst-plugins-base": "gstreamer",
+		"gst-plugins-good": "gstreamer",
+		"gst-plugins-ugly": "gstreamer",
+		"gst-plugins10": "gstreamer",
+		"mono": "mono-env",
+		"python": "python-r1 / python-single-r1 / python-any-r1",
+		"ruby": "ruby-ng",
+		"x-modular": "xorg-2",
+	}
+
+	_inherit_re = re.compile(r'^\s*inherit\s(.*)$')
+
+	def new(self, pkg):
+		self._errors = []
+
+	def check(self, num, line):
+		direct_inherits = None
+		m = self._inherit_re.match(line)
+		if m is not None:
+			direct_inherits = m.group(1)
+			if direct_inherits:
+				direct_inherits = direct_inherits.split()
+
+		if not direct_inherits:
+			return
+
+		for eclass in direct_inherits:
+			replacement = self.deprecated_eclasses.get(eclass)
+			if replacement is None:
+				pass
+			elif replacement is False:
+				self._errors.append(
+					"please migrate from "
+					"'%s' (no replacement) on line: %d" % (eclass, num + 1))
+			else:
+				self._errors.append(
+					"please migrate from "
+					"'%s' to '%s' on line: %d" % (eclass, replacement, num + 1))
+
+	def end(self):
+		for error in self._errors:
+			yield error
+		del self._errors


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/deprecated/
@ 2017-09-11 21:43 Brian Dolbec
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2017-09-11 21:43 UTC (permalink / raw
  To: gentoo-commits

commit:     89a1924390edfb173136a8787b0161e377332edb
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 00:19:12 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 11 16:13:14 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=89a19243

repoman: New linechecks module, deprecated

 .../modules/linechecks/deprecated/__init__.py      | 46 +++++++++++++++
 .../modules/linechecks/deprecated/deprecated.py    | 32 +++++++++++
 .../modules/linechecks/deprecated/inherit.py       | 66 ++++++++++++++++++++++
 3 files changed, 144 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py b/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py
new file mode 100644
index 000000000..8c5f61d49
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py
@@ -0,0 +1,46 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Deprecated plug-in module for repoman LineChecks.
+Performs miscelaneous deprecation checks on ebuilds not covered by
+specialty modules."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'deprecated',
+	'description': doc,
+	'provides':{
+		'useq-check': {
+			'name': "useq",
+			'sourcefile': "deprecated",
+			'class': "DeprecatedUseq",
+			'description': doc,
+		},
+		'hasq-check': {
+			'name': "hasq",
+			'sourcefile': "deprecated",
+			'class': "DeprecatedHasq",
+			'description': doc,
+		},
+		'preserve-check': {
+			'name': "preservelib",
+			'sourcefile': "deprecated",
+			'class': "PreserveOldLib",
+			'description': doc,
+		},
+		'bindnow-check': {
+			'name': "bindnow",
+			'sourcefile': "deprecated",
+			'class': "DeprecatedBindnowFlags",
+			'description': doc,
+		},
+		'inherit-check': {
+			'name': "inherit",
+			'sourcefile': "inherit",
+			'class': "InheritDeprecated",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/deprecated.py b/repoman/pym/repoman/modules/linechecks/deprecated/deprecated.py
new file mode 100644
index 000000000..b33852e74
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/deprecated.py
@@ -0,0 +1,32 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class DeprecatedUseq(LineCheck):
+	"""Checks for use of the deprecated useq function"""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'(^|.*\b)useq\b')
+	error = 'USEQ_ERROR'
+
+
+class DeprecatedHasq(LineCheck):
+	"""Checks for use of the deprecated hasq function"""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'(^|.*\b)hasq\b')
+	error = 'HASQ_ERROR'
+
+
+class PreserveOldLib(LineCheck):
+	"""Check for calls to the deprecated preserve_old_lib function."""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'.*preserve_old_lib')
+	error = 'PRESERVE_OLD_LIB'
+
+
+class DeprecatedBindnowFlags(LineCheck):
+	"""Check for calls to the deprecated bindnow-flags function."""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'.*\$\(bindnow-flags\)')
+	error = 'DEPRECATED_BINDNOW_FLAGS'

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py b/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py
new file mode 100644
index 000000000..8a20f22a4
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py
@@ -0,0 +1,66 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class InheritDeprecated(LineCheck):
+	"""Check if ebuild directly or indirectly inherits a deprecated eclass."""
+
+	repoman_check_name = 'inherit.deprecated'
+
+	# deprecated eclass : new eclass (False if no new eclass)
+	deprecated_eclasses = {
+		"base": False,
+		"bash-completion": "bash-completion-r1",
+		"boost-utils": False,
+		"clutter": "gnome2",
+		"confutils": False,
+		"distutils": "distutils-r1",
+		"games": False,
+		"gems": "ruby-fakegem",
+		"gpe": False,
+		"gst-plugins-bad": "gstreamer",
+		"gst-plugins-base": "gstreamer",
+		"gst-plugins-good": "gstreamer",
+		"gst-plugins-ugly": "gstreamer",
+		"gst-plugins10": "gstreamer",
+		"mono": "mono-env",
+		"python": "python-r1 / python-single-r1 / python-any-r1",
+		"ruby": "ruby-ng",
+		"x-modular": "xorg-2",
+	}
+
+	_inherit_re = re.compile(r'^\s*inherit\s(.*)$')
+
+	def new(self, pkg):
+		self._errors = []
+
+	def check(self, num, line):
+		direct_inherits = None
+		m = self._inherit_re.match(line)
+		if m is not None:
+			direct_inherits = m.group(1)
+			if direct_inherits:
+				direct_inherits = direct_inherits.split()
+
+		if not direct_inherits:
+			return
+
+		for eclass in direct_inherits:
+			replacement = self.deprecated_eclasses.get(eclass)
+			if replacement is None:
+				pass
+			elif replacement is False:
+				self._errors.append(
+					"please migrate from "
+					"'%s' (no replacement) on line: %d" % (eclass, num + 1))
+			else:
+				self._errors.append(
+					"please migrate from "
+					"'%s' to '%s' on line: %d" % (eclass, replacement, num + 1))
+
+	def end(self):
+		for error in self._errors:
+			yield error
+		del self._errors


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/deprecated/
@ 2017-11-26 17:46 Brian Dolbec
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2017-11-26 17:46 UTC (permalink / raw
  To: gentoo-commits

commit:     0db35995f2dec3cf647675b8f46be6f5383af5c1
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 00:19:12 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Nov 26 17:32:18 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0db35995

repoman: New linechecks module, deprecated

 .../modules/linechecks/deprecated/__init__.py      | 46 +++++++++++++++
 .../modules/linechecks/deprecated/deprecated.py    | 32 +++++++++++
 .../modules/linechecks/deprecated/inherit.py       | 66 ++++++++++++++++++++++
 3 files changed, 144 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py b/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py
new file mode 100644
index 000000000..8c5f61d49
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py
@@ -0,0 +1,46 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Deprecated plug-in module for repoman LineChecks.
+Performs miscelaneous deprecation checks on ebuilds not covered by
+specialty modules."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'deprecated',
+	'description': doc,
+	'provides':{
+		'useq-check': {
+			'name': "useq",
+			'sourcefile': "deprecated",
+			'class': "DeprecatedUseq",
+			'description': doc,
+		},
+		'hasq-check': {
+			'name': "hasq",
+			'sourcefile': "deprecated",
+			'class': "DeprecatedHasq",
+			'description': doc,
+		},
+		'preserve-check': {
+			'name': "preservelib",
+			'sourcefile': "deprecated",
+			'class': "PreserveOldLib",
+			'description': doc,
+		},
+		'bindnow-check': {
+			'name': "bindnow",
+			'sourcefile': "deprecated",
+			'class': "DeprecatedBindnowFlags",
+			'description': doc,
+		},
+		'inherit-check': {
+			'name': "inherit",
+			'sourcefile': "inherit",
+			'class': "InheritDeprecated",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/deprecated.py b/repoman/pym/repoman/modules/linechecks/deprecated/deprecated.py
new file mode 100644
index 000000000..b33852e74
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/deprecated.py
@@ -0,0 +1,32 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class DeprecatedUseq(LineCheck):
+	"""Checks for use of the deprecated useq function"""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'(^|.*\b)useq\b')
+	error = 'USEQ_ERROR'
+
+
+class DeprecatedHasq(LineCheck):
+	"""Checks for use of the deprecated hasq function"""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'(^|.*\b)hasq\b')
+	error = 'HASQ_ERROR'
+
+
+class PreserveOldLib(LineCheck):
+	"""Check for calls to the deprecated preserve_old_lib function."""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'.*preserve_old_lib')
+	error = 'PRESERVE_OLD_LIB'
+
+
+class DeprecatedBindnowFlags(LineCheck):
+	"""Check for calls to the deprecated bindnow-flags function."""
+	repoman_check_name = 'ebuild.minorsyn'
+	re = re.compile(r'.*\$\(bindnow-flags\)')
+	error = 'DEPRECATED_BINDNOW_FLAGS'

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py b/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py
new file mode 100644
index 000000000..8a20f22a4
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py
@@ -0,0 +1,66 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class InheritDeprecated(LineCheck):
+	"""Check if ebuild directly or indirectly inherits a deprecated eclass."""
+
+	repoman_check_name = 'inherit.deprecated'
+
+	# deprecated eclass : new eclass (False if no new eclass)
+	deprecated_eclasses = {
+		"base": False,
+		"bash-completion": "bash-completion-r1",
+		"boost-utils": False,
+		"clutter": "gnome2",
+		"confutils": False,
+		"distutils": "distutils-r1",
+		"games": False,
+		"gems": "ruby-fakegem",
+		"gpe": False,
+		"gst-plugins-bad": "gstreamer",
+		"gst-plugins-base": "gstreamer",
+		"gst-plugins-good": "gstreamer",
+		"gst-plugins-ugly": "gstreamer",
+		"gst-plugins10": "gstreamer",
+		"mono": "mono-env",
+		"python": "python-r1 / python-single-r1 / python-any-r1",
+		"ruby": "ruby-ng",
+		"x-modular": "xorg-2",
+	}
+
+	_inherit_re = re.compile(r'^\s*inherit\s(.*)$')
+
+	def new(self, pkg):
+		self._errors = []
+
+	def check(self, num, line):
+		direct_inherits = None
+		m = self._inherit_re.match(line)
+		if m is not None:
+			direct_inherits = m.group(1)
+			if direct_inherits:
+				direct_inherits = direct_inherits.split()
+
+		if not direct_inherits:
+			return
+
+		for eclass in direct_inherits:
+			replacement = self.deprecated_eclasses.get(eclass)
+			if replacement is None:
+				pass
+			elif replacement is False:
+				self._errors.append(
+					"please migrate from "
+					"'%s' (no replacement) on line: %d" % (eclass, num + 1))
+			else:
+				self._errors.append(
+					"please migrate from "
+					"'%s' to '%s' on line: %d" % (eclass, replacement, num + 1))
+
+	def end(self):
+		for error in self._errors:
+			yield error
+		del self._errors


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-26 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-15  2:08 [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/deprecated/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2017-07-15  2:29 Brian Dolbec
2017-09-11 21:43 Brian Dolbec
2017-11-26 17:46 Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox