1 |
commit: 00ca5c9b7c573e43daf2088514df52e02c429e07 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed May 6 05:26:30 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed May 6 06:03:56 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00ca5c9b |
7 |
|
8 |
dev-python/django: Redo bash-completion patch for 3.0.6 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-python/django/django-3.0.6.ebuild | 4 ++ |
13 |
.../django/files/django-3.0.6-bashcomp.patch | 56 ++++++++++++++++++++++ |
14 |
2 files changed, 60 insertions(+) |
15 |
|
16 |
diff --git a/dev-python/django/django-3.0.6.ebuild b/dev-python/django/django-3.0.6.ebuild |
17 |
index 0482e460c9a..9b34e353eec 100644 |
18 |
--- a/dev-python/django/django-3.0.6.ebuild |
19 |
+++ b/dev-python/django/django-3.0.6.ebuild |
20 |
@@ -44,6 +44,10 @@ BDEPEND=" |
21 |
dev-python/tblib[${PYTHON_USEDEP}] |
22 |
)" |
23 |
|
24 |
+PATCHES=( |
25 |
+ "${FILESDIR}"/${PN}-3.0.6-bashcomp.patch |
26 |
+) |
27 |
+ |
28 |
distutils_enable_sphinx docs |
29 |
|
30 |
python_test() { |
31 |
|
32 |
diff --git a/dev-python/django/files/django-3.0.6-bashcomp.patch b/dev-python/django/files/django-3.0.6-bashcomp.patch |
33 |
new file mode 100644 |
34 |
index 00000000000..2eca3416db6 |
35 |
--- /dev/null |
36 |
+++ b/dev-python/django/files/django-3.0.6-bashcomp.patch |
37 |
@@ -0,0 +1,56 @@ |
38 |
+From d082b413b0b6edfcae52f64c8a64f16b2bf6110f Mon Sep 17 00:00:00 2001 |
39 |
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o> |
40 |
+Date: Wed, 6 May 2020 07:24:05 +0200 |
41 |
+Subject: [PATCH] Remove completions unsuitable for autoloading |
42 |
+ |
43 |
+The override of 'python*' completions, as well as the attempt |
44 |
+to './manage.py' completion are not going to work with autoloader. |
45 |
+Strip them. |
46 |
+--- |
47 |
+ extras/django_bash_completion | 33 +-------------------------------- |
48 |
+ 1 file changed, 1 insertion(+), 32 deletions(-) |
49 |
+ |
50 |
+diff --git a/extras/django_bash_completion b/extras/django_bash_completion |
51 |
+index 3c2f14c263..abe76e5903 100755 |
52 |
+--- a/extras/django_bash_completion |
53 |
++++ b/extras/django_bash_completion |
54 |
+@@ -37,35 +37,4 @@ _django_completion() |
55 |
+ COMP_CWORD=$COMP_CWORD \ |
56 |
+ DJANGO_AUTO_COMPLETE=1 $1 ) ) |
57 |
+ } |
58 |
+-complete -F _django_completion -o default django-admin.py manage.py django-admin |
59 |
+- |
60 |
+-_python_django_completion() |
61 |
+-{ |
62 |
+- if [[ ${COMP_CWORD} -ge 2 ]]; then |
63 |
+- local PYTHON_EXE=${COMP_WORDS[0]##*/} |
64 |
+- if echo "$PYTHON_EXE" | grep -qE "python([3-9]\.[0-9])?"; then |
65 |
+- local PYTHON_SCRIPT=${COMP_WORDS[1]##*/} |
66 |
+- if echo "$PYTHON_SCRIPT" | grep -qE "manage\.py|django-admin(\.py)?"; then |
67 |
+- COMPREPLY=( $( COMP_WORDS=( "${COMP_WORDS[*]:1}" ) |
68 |
+- COMP_CWORD=$(( COMP_CWORD-1 )) |
69 |
+- DJANGO_AUTO_COMPLETE=1 ${COMP_WORDS[*]} ) ) |
70 |
+- fi |
71 |
+- fi |
72 |
+- fi |
73 |
+-} |
74 |
+- |
75 |
+-# Support for multiple interpreters. |
76 |
+-unset pythons |
77 |
+-if command -v whereis &>/dev/null; then |
78 |
+- python_interpreters=$(whereis python | cut -d " " -f 2-) |
79 |
+- for python in $python_interpreters; do |
80 |
+- [[ $python != *-config ]] && pythons="${pythons} ${python##*/}" |
81 |
+- done |
82 |
+- unset python_interpreters |
83 |
+- pythons=$(echo "$pythons" | tr " " "\n" | sort -u | tr "\n" " ") |
84 |
+-else |
85 |
+- pythons=python |
86 |
+-fi |
87 |
+- |
88 |
+-complete -F _python_django_completion -o default $pythons |
89 |
+-unset pythons |
90 |
++complete -F _django_completion -o default django-admin.py django-admin |
91 |
+-- |
92 |
+2.26.2 |
93 |
+ |