public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ekeyword/
@ 2017-03-22 12:51 Brian Dolbec
  0 siblings, 0 replies; 11+ messages in thread
From: Brian Dolbec @ 2017-03-22 12:51 UTC (permalink / raw
  To: gentoo-commits

commit:     3892055f89dd82ce8bd6c1f759bfabac74e9b98d
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 22 11:47:10 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Mar 22 11:47:10 2017 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=3892055f

ekeyword: Remove ekeyword symlink

 pym/gentoolkit/ekeyword/ekeyword | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pym/gentoolkit/ekeyword/ekeyword b/pym/gentoolkit/ekeyword/ekeyword
deleted file mode 120000
index 8374306..0000000
--- a/pym/gentoolkit/ekeyword/ekeyword
+++ /dev/null
@@ -1 +0,0 @@
-ekeyword.py
\ No newline at end of file


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

* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ekeyword/
@ 2017-09-11 20:20 Sebastian Pipping
  0 siblings, 0 replies; 11+ messages in thread
From: Sebastian Pipping @ 2017-09-11 20:20 UTC (permalink / raw
  To: gentoo-commits

commit:     0bbf21d7c25743e030879ab65af5e432aba2eaa3
Author:     Sebastian Pipping <sebastian <AT> pipping <DOT> org>
AuthorDate: Sat Sep  9 13:04:27 2017 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Sat Sep  9 13:04:27 2017 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=0bbf21d7

ekeyword: Support sorting keywords without additional changes

 pym/gentoolkit/ekeyword/ekeyword.py | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/pym/gentoolkit/ekeyword/ekeyword.py b/pym/gentoolkit/ekeyword/ekeyword.py
index 170c25b..af37a9a 100755
--- a/pym/gentoolkit/ekeyword/ekeyword.py
+++ b/pym/gentoolkit/ekeyword/ekeyword.py
@@ -261,15 +261,29 @@ def process_content(ebuild, data, ops, arch_status=None, verbose=0,
 			continue
 
 		# Ok, we've got it, now let's process things.
-		old_keywords = set(m.group(3).split())
+		old_keywords_original = m.group(3).split()  # preserve original order
+		old_keywords = set(old_keywords_original)
 		new_keywords = process_keywords(
 			old_keywords, ops, arch_status=arch_status)
 
+		were_sorted_already = (
+				old_keywords_original == sort_keywords(old_keywords_original))
+
 		# Finally let's present the results to the user.
-		if (new_keywords != old_keywords) or verbose:
+		if (new_keywords != old_keywords) or \
+				(not ops and not were_sorted_already) or verbose:
 			# Only do the diff work if something actually changed.
 			updated = True
-			old_keywords = sort_keywords(old_keywords)
+
+			if not ops:
+				# We're sorting only so we want to compare with the
+				# unsorted original (or changes in order will not show)
+				old_keywords = old_keywords_original
+			else:
+				# We changed keywords so let's diff sorted versions
+				# so that keywords changes are easy to spot
+				old_keywords = sort_keywords(old_keywords)
+
 			new_keywords = sort_keywords(new_keywords)
 			line = '%s"%s"%s\n' % (m.group(1), ' '.join(new_keywords),
 			                       m.group(5))
@@ -435,14 +449,12 @@ def args_to_work(args, arch_status=None, _repo='gentoo', quiet=0):
 	"""Process |args| into a list of work itmes (ebuild/arches to update)"""
 	work = []
 	todo_arches = []
-	last_todo_arches = None
+	last_todo_arches = []
 
 	for arg in args:
 		if arg.endswith('.ebuild'):
 			if not todo_arches:
 				todo_arches = last_todo_arches
-			if not todo_arches:
-				raise ValueError('missing arches to process for %s' % arg)
 			work.append([arg, todo_arches])
 			last_todo_arches = todo_arches
 			todo_arches = []
@@ -510,7 +522,7 @@ def main(argv):
 	parser = get_parser()
 	opts = parser.parse_args(parse_args)
 	if not work_args:
-		parser.error('need arches/ebuilds to process')
+		parser.error('need ebuilds to process')
 
 	if opts.style == 'auto':
 		if not portage_settings().get('NOCOLOR', 'false').lower() in ('no', 'false'):


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

* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ekeyword/
@ 2019-10-24 15:07 Michael Haubenwallner
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Haubenwallner @ 2019-10-24 15:07 UTC (permalink / raw
  To: gentoo-commits

commit:     8d941d9c0e77eaab787df5f19ab97ca8a2fd6cff
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 24 15:05:35 2019 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Thu Oct 24 15:05:56 2019 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=8d941d9c

ekeyword: fix for when main-repo != "gentoo"

Closes: https://bugs.gentoo.org/698256
Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 pym/gentoolkit/ekeyword/ekeyword.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pym/gentoolkit/ekeyword/ekeyword.py b/pym/gentoolkit/ekeyword/ekeyword.py
index 94c5885..cf2a15e 100755
--- a/pym/gentoolkit/ekeyword/ekeyword.py
+++ b/pym/gentoolkit/ekeyword/ekeyword.py
@@ -346,7 +346,7 @@ def portage_settings():
 	return portage.db[portage.root]['vartree'].settings
 
 
-def load_profile_data(portdir=None, repo='gentoo'):
+def load_profile_data(portdir=None, repo=None):
 	"""Load the list of known arches from the tree
 
 	Args:
@@ -357,6 +357,8 @@ def load_profile_data(portdir=None, repo='gentoo'):
 	  A dict mapping the keyword to its preferred state:
 	  {'x86': 'stable', 'mips': 'dev', ...}
 	"""
+	if repo is None:
+		repo = portage_settings().repositories.mainRepo().name
 	if portdir is None:
 		portdir = portage_settings().repositories[repo].location
 
@@ -444,7 +446,7 @@ def ignorable_arg(arg, quiet=0):
 	return False
 
 
-def args_to_work(args, arch_status=None, _repo='gentoo', quiet=0):
+def args_to_work(args, arch_status=None, _repo=None, quiet=0):
 	"""Process |args| into a list of work itmes (ebuild/arches to update)"""
 	work = []
 	todo_arches = []


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

* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ekeyword/
@ 2019-10-24 15:07 Michael Haubenwallner
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Haubenwallner @ 2019-10-24 15:07 UTC (permalink / raw
  To: gentoo-commits

commit:     f2278785d6833e3e3358cd847280e9c9107f303e
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 24 15:05:15 2019 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Thu Oct 24 15:05:15 2019 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=f2278785

ekeyword: fix for Prefix

Bug: https://bugs.gentoo.org/698256
Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 pym/gentoolkit/ekeyword/ekeyword.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/gentoolkit/ekeyword/ekeyword.py b/pym/gentoolkit/ekeyword/ekeyword.py
index a1910ee..94c5885 100755
--- a/pym/gentoolkit/ekeyword/ekeyword.py
+++ b/pym/gentoolkit/ekeyword/ekeyword.py
@@ -343,7 +343,7 @@ def process_ebuild(ebuild, ops, arch_status=None, verbose=0, quiet=0,
 def portage_settings():
 	"""Return the portage settings we care about."""
 	# Portage creates the db member on the fly which confuses the linter.
-	return portage.db['/']['vartree'].settings
+	return portage.db[portage.root]['vartree'].settings
 
 
 def load_profile_data(portdir=None, repo='gentoo'):


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

* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ekeyword/
@ 2020-04-24  8:06 Michał Górny
  0 siblings, 0 replies; 11+ messages in thread
From: Michał Górny @ 2020-04-24  8:06 UTC (permalink / raw
  To: gentoo-commits

commit:     459cfba47d2522553d076ebaabf656ce8f29cf11
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 24 07:55:49 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Apr 24 07:56:24 2020 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=459cfba4

ekeyword: Use now-common load_profile_data() from eshowkw

This also fixes 'all' to process all architectures using stable keywords
and not just these having stable profiles.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 pym/gentoolkit/ekeyword/ekeyword.py          | 62 ++--------------------------
 pym/gentoolkit/ekeyword/ekeyword_unittest.py | 36 ----------------
 2 files changed, 3 insertions(+), 95 deletions(-)

diff --git a/pym/gentoolkit/ekeyword/ekeyword.py b/pym/gentoolkit/ekeyword/ekeyword.py
index cf2a15e..a86a9c2 100755
--- a/pym/gentoolkit/ekeyword/ekeyword.py
+++ b/pym/gentoolkit/ekeyword/ekeyword.py
@@ -47,6 +47,8 @@ import re
 import subprocess
 import sys
 
+from gentoolkit.profile import load_profile_data
+
 import portage
 from portage.output import colorize, nocolor
 
@@ -179,7 +181,7 @@ def process_keywords(keywords, ops, arch_status=None):
 			if op is None:
 				# Process just stable keywords.
 				arches = [k for k, v in arch_status.items()
-				          if v == 'stable' and k in old_arches]
+					if v[1] == 'arch' and k in old_arches]
 			else:
 				# Process all possible keywords.  We use the arch_status as a
 				# master list.  If it lacks some keywords, then we might miss
@@ -346,64 +348,6 @@ def portage_settings():
 	return portage.db[portage.root]['vartree'].settings
 
 
-def load_profile_data(portdir=None, repo=None):
-	"""Load the list of known arches from the tree
-
-	Args:
-	  portdir: The repository to load all data from (and ignore |repo|)
-	  repo: Look up this repository by name to locate profile data
-
-	Returns:
-	  A dict mapping the keyword to its preferred state:
-	  {'x86': 'stable', 'mips': 'dev', ...}
-	"""
-	if repo is None:
-		repo = portage_settings().repositories.mainRepo().name
-	if portdir is None:
-		portdir = portage_settings().repositories[repo].location
-
-	arch_status = {}
-
-	try:
-		arch_list = os.path.join(portdir, 'profiles', 'arch.list')
-		with open(arch_list) as f:
-			for line in f:
-				line = line.split('#', 1)[0].strip()
-				if line:
-					arch_status[line] = None
-	except IOError:
-		pass
-
-	try:
-		profile_status = {
-			'stable': 0,
-			'dev': 1,
-			'exp': 2,
-			None: 3,
-		}
-		profiles_list = os.path.join(portdir, 'profiles', 'profiles.desc')
-		with open(profiles_list) as f:
-			for line in f:
-				line = line.split('#', 1)[0].split()
-				if line:
-					arch, _profile, status = line
-					arch_status.setdefault(arch, status)
-					curr_status = profile_status[arch_status[arch]]
-					new_status = profile_status[status]
-					if new_status < curr_status:
-						arch_status[arch] = status
-	except IOError:
-		pass
-
-	if arch_status:
-		arch_status['all'] = None
-	else:
-		warning('could not read profile files: %s' % arch_list)
-		warning('will not be able to verify args are correct')
-
-	return arch_status
-
-
 def arg_to_op(arg):
 	"""Convert a command line |arg| to an Op"""
 	arch_prefixes = ('-', '~', '^')

diff --git a/pym/gentoolkit/ekeyword/ekeyword_unittest.py b/pym/gentoolkit/ekeyword/ekeyword_unittest.py
index 5e66afe..7446914 100755
--- a/pym/gentoolkit/ekeyword/ekeyword_unittest.py
+++ b/pym/gentoolkit/ekeyword/ekeyword_unittest.py
@@ -343,42 +343,6 @@ class TestProcessEbuild(unittest.TestCase):
 		self.assertEqual(m.call_count, 0)
 
 
-class TestLoadProfileData(unittest.TestCase):
-	"""Tests for load_profile_data"""
-
-	def _test(self, subdir):
-		portdir = os.path.join(TESTDIR, 'profiles', subdir)
-		return ekeyword.load_profile_data(portdir=portdir)
-
-	def testLoadBoth(self):
-		"""Test loading both arch.list and profiles.desc"""
-		ret = self._test('both')
-		self.assertIn('arm', ret)
-		self.assertEqual(ret['arm'], 'stable')
-		self.assertIn('arm64', ret)
-		self.assertEqual(ret['arm64'], 'exp')
-
-	def testLoadArchOnly(self):
-		"""Test loading only arch.list"""
-		ret = self._test('arch-only')
-		self.assertIn('arm', ret)
-		self.assertEqual(ret['arm'], None)
-		self.assertIn('x86-solaris', ret)
-
-	def testLoadProfilesOnly(self):
-		"""Test loading only profiles.desc"""
-		ret = self._test('profiles-only')
-		self.assertIn('arm', ret)
-		self.assertEqual(ret['arm'], 'stable')
-		self.assertIn('arm64', ret)
-		self.assertEqual(ret['arm64'], 'exp')
-
-	def testLoadNone(self):
-		"""Test running when neither files exists"""
-		ret = self._test('none')
-		self.assertEqual(ret, {})
-
-
 class TestArgToOps(unittest.TestCase):
 	"""Tests for arg_to_op()"""
 


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

* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ekeyword/
@ 2020-12-28 17:52 Matt Turner
  0 siblings, 0 replies; 11+ messages in thread
From: Matt Turner @ 2020-12-28 17:52 UTC (permalink / raw
  To: gentoo-commits

commit:     5e421373f2cc82ad2a000925e01bb5421d280b76
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 21 02:09:06 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Mon Dec 21 03:24:54 2020 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=5e421373

ekeyword: Rename unit test so that it runs

unittests should be named test_*.py so that they are discoverable.

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 pym/gentoolkit/ekeyword/pytest.ini                                 | 2 +-
 pym/gentoolkit/ekeyword/{ekeyword_unittest.py => test_ekeyword.py} | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/gentoolkit/ekeyword/pytest.ini b/pym/gentoolkit/ekeyword/pytest.ini
index 622c9d8..7e21bec 100644
--- a/pym/gentoolkit/ekeyword/pytest.ini
+++ b/pym/gentoolkit/ekeyword/pytest.ini
@@ -1,3 +1,3 @@
 [pytest]
 addopts = --cov
-python_files = *_unittest.py
+python_files = test_*.py

diff --git a/pym/gentoolkit/ekeyword/ekeyword_unittest.py b/pym/gentoolkit/ekeyword/test_ekeyword.py
similarity index 99%
rename from pym/gentoolkit/ekeyword/ekeyword_unittest.py
rename to pym/gentoolkit/ekeyword/test_ekeyword.py
index ef2e256..3d23585 100755
--- a/pym/gentoolkit/ekeyword/ekeyword_unittest.py
+++ b/pym/gentoolkit/ekeyword/test_ekeyword.py
@@ -12,7 +12,7 @@ import unittest
 
 import mock
 
-import ekeyword
+from gentoolkit.ekeyword import ekeyword
 
 
 TESTDIR = os.path.join(os.path.dirname(__file__), 'tests')


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

* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ekeyword/
@ 2020-12-28 17:52 Matt Turner
  0 siblings, 0 replies; 11+ messages in thread
From: Matt Turner @ 2020-12-28 17:52 UTC (permalink / raw
  To: gentoo-commits

commit:     bb443542626c0ecb769c8ab0efc3bae9da8154c3
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 21 03:09:55 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Mon Dec 21 03:24:54 2020 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=bb443542

ekeyword: Fix unit test

arch_status changed from a Dict[str] to Dict[Tuple[str, str]], but these
bits of test data were not updated. Update the examples while we're here
(e.g. arm64 is stable with stable profiles now).

Fixes: 459cfba47d25 (ekeyword: Use now-common load_profile_data() from eshowkw)
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 pym/gentoolkit/ekeyword/test_ekeyword.py | 38 +++++++++++++++-----------------
 1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/pym/gentoolkit/ekeyword/test_ekeyword.py b/pym/gentoolkit/ekeyword/test_ekeyword.py
index 3d23585..12a0b54 100755
--- a/pym/gentoolkit/ekeyword/test_ekeyword.py
+++ b/pym/gentoolkit/ekeyword/test_ekeyword.py
@@ -165,28 +165,26 @@ class TestProcessKeywords(unittest.TestCase):
 			ekeyword.Op(None, 'all', None),
 		)
 		arch_status = {
-			'alpha': None,
-			'arm': 'stable',
-			'arm64': 'exp',
-			'm68k': 'dev',
+			'alpha': ('stable', '~arch'),
+			'arm':   ('stable', 'arch'),
+			'm68k':  ('exp', '~arch'),
+			's390':  ('exp', 'arch'),
 		}
-		self._test('* ~alpha ~arm ~arm64 ~m68k ~mips ~arm-linux', ops,
-		           '* ~alpha arm ~arm64 ~m68k ~mips ~arm-linux', arch_status)
+		self._test('* ~alpha ~arm ~m68k ~mips ~s390 ~arm-linux', ops,
+		           '* ~alpha arm ~m68k ~mips s390 ~arm-linux', arch_status)
 
 	def testAllUnstable(self):
 		ops = (
 			ekeyword.Op('~', 'all', None),
 		)
 		arch_status = {
-			'alpha': None,
-			'arm': 'stable',
-			'arm64': 'exp',
-			'm68k': 'dev',
-			's390': 'dev',
-			'sh': 'dev',
+			'alpha': ('stable', '~arch'),
+			'arm':   ('stable', 'arch'),
+			'm68k':  ('exp', '~arch'),
+			's390':  ('exp', 'arch'),
 		}
-		self._test('-* ~* * alpha arm arm64 m68k arm-linux', ops,
-		           '-* ~* * ~alpha ~arm ~arm64 ~m68k ~arm-linux', arch_status)
+		self._test('-* ~* * alpha arm m68k s390 arm-linux', ops,
+		           '-* ~* * ~alpha ~arm ~m68k ~s390 ~arm-linux', arch_status)
 
 	def testAllMultiUnstableStable(self):
 		ops = (
@@ -194,13 +192,13 @@ class TestProcessKeywords(unittest.TestCase):
 			ekeyword.Op(None, 'all', None),
 		)
 		arch_status = {
-			'alpha': None,
-			'arm': 'stable',
-			'arm64': 'exp',
-			'm68k': 'dev',
+			'alpha': ('stable', '~arch'),
+			'arm':   ('stable', 'arch'),
+			'm68k':  ('exp', '~arch'),
+			's390':  ('exp', 'arch'),
 		}
-		self._test('-* ~* * alpha arm arm64 m68k', ops,
-		           '-* ~* * ~alpha arm ~arm64 ~m68k', arch_status)
+		self._test('-* ~* * alpha arm m68k s390', ops,
+		           '-* ~* * ~alpha arm ~m68k s390', arch_status)
 
 	def testAllDisabled(self):
 		"""Make sure ~all does not change -arch to ~arch"""


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

* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ekeyword/
@ 2020-12-28 18:01 Matt Turner
  0 siblings, 0 replies; 11+ messages in thread
From: Matt Turner @ 2020-12-28 18:01 UTC (permalink / raw
  To: gentoo-commits

commit:     2f572237ebbf2be2b56803394a40d5c4938cbdb7
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 28 18:00:28 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Mon Dec 28 18:00:55 2020 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=2f572237

ekeyword: Use mock from unittest

Since we only support Python 3.6+.

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 pym/gentoolkit/ekeyword/test_ekeyword.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/gentoolkit/ekeyword/test_ekeyword.py b/pym/gentoolkit/ekeyword/test_ekeyword.py
index 12a0b54..0763783 100755
--- a/pym/gentoolkit/ekeyword/test_ekeyword.py
+++ b/pym/gentoolkit/ekeyword/test_ekeyword.py
@@ -10,7 +10,7 @@ import subprocess
 import tempfile
 import unittest
 
-import mock
+from unittest import mock
 
 from gentoolkit.ekeyword import ekeyword
 


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

* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ekeyword/
@ 2021-06-18 14:03 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2021-06-18 14:03 UTC (permalink / raw
  To: gentoo-commits

commit:     237ae83ec64cf06271609abe79acddf94033f447
Author:     Petr Vaněk <pv <AT> excello <DOT> cz>
AuthorDate: Fri Nov  6 13:39:52 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 18 14:02:46 2021 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=237ae83e

ekeyword: fix typo

Signed-off-by: Petr Vaněk <pv <AT> excello.cz>
Closes: https://github.com/gentoo/gentoolkit/pull/12
Signed-off-by: Sam James <sam <AT> gentoo.org>

 pym/gentoolkit/ekeyword/ekeyword.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/gentoolkit/ekeyword/ekeyword.py b/pym/gentoolkit/ekeyword/ekeyword.py
index 4e57c09..da0fd58 100755
--- a/pym/gentoolkit/ekeyword/ekeyword.py
+++ b/pym/gentoolkit/ekeyword/ekeyword.py
@@ -429,7 +429,7 @@ def get_parser():
 		help='Be quiet while processing things (only show errors)')
 	parser.add_argument('--format', default='auto', dest='style',
 		choices=('auto', 'color-inline', 'inline', 'short-multi', 'long-multi'),
-		help='Selet output format for showing differences')
+		help='Select output format for showing differences')
 	parser.add_argument('-V', '--version', action='version', version=__version__,
 		help='Show version information')
 	return parser


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

* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ekeyword/
@ 2022-07-09 19:50 Brian Dolbec
  0 siblings, 0 replies; 11+ messages in thread
From: Brian Dolbec @ 2022-07-09 19:50 UTC (permalink / raw
  To: gentoo-commits

commit:     04e8fd5252c9bc1efad66fdb8cb40d376550d580
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 29 02:00:42 2020 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jul  9 19:46:35 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=04e8fd52

ekeyword: remove .ebuild file suffix requirement (bug 762331)

We'd like to use ekeyword in a git merge driver implementation, but the
files that the driver will pass to ekeyword do not necessarily have a
.ebuild suffix. Therefore, it would be handy to be able to distinguish
ebuild arguments some other way. If the ignorable_arg(arg) function
returns False and os.path.isfile(arg) returns True, then simply assume
that the argument is an ebuild.

Bug: https://bugs.gentoo.org/762331
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoolkit/pull/13
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/gentoolkit/ekeyword/ekeyword.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pym/gentoolkit/ekeyword/ekeyword.py b/pym/gentoolkit/ekeyword/ekeyword.py
index 7d3a1ef..4d017d4 100755
--- a/pym/gentoolkit/ekeyword/ekeyword.py
+++ b/pym/gentoolkit/ekeyword/ekeyword.py
@@ -253,7 +253,7 @@ def process_content(
 
     else:
         # Chop the full path and the .ebuild suffix.
-        disp_name = os.path.basename(ebuild)[:-7]
+        disp_name, _, _ = os.path.basename(ebuild).partition(".ebuild")
 
         def logit(msg):
             print("%s: %s" % (disp_name, msg))
@@ -430,7 +430,9 @@ def args_to_work(args, arch_status=None, _repo=None, quiet=0):
     last_todo_arches = []
 
     for arg in args:
-        if arg.endswith(".ebuild"):
+        if ignorable_arg(arg, quiet=quiet):
+            pass
+        elif os.path.isfile(arg):
             if not todo_arches:
                 todo_arches = last_todo_arches
             work.append([arg, todo_arches])
@@ -440,7 +442,7 @@ def args_to_work(args, arch_status=None, _repo=None, quiet=0):
             op = arg_to_op(arg)
             if not arch_status or op.arch in arch_status:
                 todo_arches.append(op)
-            elif not ignorable_arg(arg, quiet=quiet):
+            else:
                 raise ValueError("unknown arch/argument: %s" % arg)
 
     if todo_arches:


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

* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ekeyword/
@ 2024-06-24 18:05 Matt Turner
  0 siblings, 0 replies; 11+ messages in thread
From: Matt Turner @ 2024-06-24 18:05 UTC (permalink / raw
  To: gentoo-commits

commit:     e0e7c2e9119fda47a10bc882a976000a08994f0d
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Tue May 28 17:06:39 2024 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Fri Jun  7 15:02:43 2024 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=e0e7c2e9

ekeyword: Remove dead Makefile

Has been dead since commit c819d14 in 2009.

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 pym/gentoolkit/ekeyword/Makefile    | 18 ------------------
 pym/gentoolkit/ekeyword/meson.build |  1 -
 2 files changed, 19 deletions(-)

diff --git a/pym/gentoolkit/ekeyword/Makefile b/pym/gentoolkit/ekeyword/Makefile
deleted file mode 100644
index 1219d19..0000000
--- a/pym/gentoolkit/ekeyword/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2004 Karl Trygve Kalleberg <karltk@gentoo.org>
-# Copyright 2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-include ../../makedefs.mak
-
-.PHONY: all clean dist
-all:
-
-dist:
-	mkdir -p ../../$(DISTDIR)/src/ekeyword
-	cp Makefile AUTHORS README ekeyword.py ekeyword_unittest.py \
-		../../$(DISTDIR)/src/ekeyword/
-
-install: all
-	install -m 0755 ekeyword.py $(BINDIR)/ekeyword
-	install -d $(DOCDIR)/ekeyword
-	install -m 0644 AUTHORS README $(DOCDIR)/ekeyword/

diff --git a/pym/gentoolkit/ekeyword/meson.build b/pym/gentoolkit/ekeyword/meson.build
index f4f86f8..92b68eb 100644
--- a/pym/gentoolkit/ekeyword/meson.build
+++ b/pym/gentoolkit/ekeyword/meson.build
@@ -16,7 +16,6 @@ py.install_sources(
 
 install_data(
     [
-        'Makefile',
         'README',
         'pytest.ini',
     ],


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

end of thread, other threads:[~2024-06-24 18:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-09 19:50 [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ekeyword/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2024-06-24 18:05 Matt Turner
2021-06-18 14:03 Sam James
2020-12-28 18:01 Matt Turner
2020-12-28 17:52 Matt Turner
2020-12-28 17:52 Matt Turner
2020-04-24  8:06 Michał Górny
2019-10-24 15:07 Michael Haubenwallner
2019-10-24 15:07 Michael Haubenwallner
2017-09-11 20:20 Sebastian Pipping
2017-03-22 12:51 Brian Dolbec

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