Show More
@@ -235,16 +235,6 b' osx:' | |||||
235 | # Place a bogon .DS_Store file in the target dir so we can be |
|
235 | # Place a bogon .DS_Store file in the target dir so we can be | |
236 | # sure it doesn't get included in the final package. |
|
236 | # sure it doesn't get included in the final package. | |
237 | touch build/mercurial/.DS_Store |
|
237 | touch build/mercurial/.DS_Store | |
238 | # install zsh completions - this location appears to be |
|
|||
239 | # searched by default as of macOS Sierra. |
|
|||
240 | install -d build/mercurial/usr/local/share/zsh/site-functions/ |
|
|||
241 | install -m 0644 contrib/zsh_completion build/mercurial/usr/local/share/zsh/site-functions/_hg |
|
|||
242 | # install bash completions - there doesn't appear to be a |
|
|||
243 | # place that's searched by default for bash, so we'll follow |
|
|||
244 | # the lead of Apple's git install and just put it in a |
|
|||
245 | # location of our own. |
|
|||
246 | install -d build/mercurial/usr/local/hg/contrib/ |
|
|||
247 | install -m 0644 contrib/bash_completion build/mercurial/usr/local/hg/contrib/hg-completion.bash |
|
|||
248 | make -C contrib/chg \ |
|
238 | make -C contrib/chg \ | |
249 | HGPATH=/usr/local/bin/hg \ |
|
239 | HGPATH=/usr/local/bin/hg \ | |
250 | PYTHON=/usr/bin/python2.7 \ |
|
240 | PYTHON=/usr/bin/python2.7 \ |
@@ -92,10 +92,8 b' override_dh_auto_install: $(DEB_HG_PYTHO' | |||||
92 | mkdir -p "$(CURDIR)"/debian/mercurial/etc/mercurial/hgrc.d/ |
|
92 | mkdir -p "$(CURDIR)"/debian/mercurial/etc/mercurial/hgrc.d/ | |
93 | cp contrib/packaging/debian/*.rc "$(CURDIR)"/debian/mercurial/etc/mercurial/hgrc.d/ |
|
93 | cp contrib/packaging/debian/*.rc "$(CURDIR)"/debian/mercurial/etc/mercurial/hgrc.d/ | |
94 | # completions |
|
94 | # completions | |
95 | mkdir -p "$(CURDIR)"/debian/mercurial/usr/share/bash-completion/completions |
|
|||
96 | cp contrib/bash_completion "$(CURDIR)"/debian/mercurial/usr/share/bash-completion/completions/hg |
|
|||
97 | mkdir -p "$(CURDIR)"/debian/mercurial/usr/share/zsh/vendor-completions |
|
95 | mkdir -p "$(CURDIR)"/debian/mercurial/usr/share/zsh/vendor-completions | |
98 |
|
|
96 | mv "$(CURDIR)"/debian/mercurial/usr/share/zsh/site-functions/_hg "$(CURDIR)"/debian/mercurial/usr/share/zsh/vendor-completions/_hg | |
99 | if [ "$(DEB_HG_CHG_BY_DEFAULT)" -eq 1 ]; then \ |
|
97 | if [ "$(DEB_HG_CHG_BY_DEFAULT)" -eq 1 ]; then \ | |
100 | mkdir -p "$(CURDIR)"/debian/mercurial/usr/lib/mercurial; \ |
|
98 | mkdir -p "$(CURDIR)"/debian/mercurial/usr/lib/mercurial; \ | |
101 | mv "$(CURDIR)"/debian/mercurial/usr/bin/hg "$(CURDIR)"/debian/mercurial/usr/lib/mercurial/hg; \ |
|
99 | mv "$(CURDIR)"/debian/mercurial/usr/bin/hg "$(CURDIR)"/debian/mercurial/usr/lib/mercurial/hg; \ |
@@ -23,7 +23,6 b' from .util import (' | |||||
23 |
|
23 | |||
24 |
|
24 | |||
25 | STAGING_RULES_WINDOWS = [ |
|
25 | STAGING_RULES_WINDOWS = [ | |
26 | ('contrib/bash_completion', 'contrib/'), |
|
|||
27 | ('contrib/hgk', 'contrib/hgk.tcl'), |
|
26 | ('contrib/hgk', 'contrib/hgk.tcl'), | |
28 | ('contrib/hgweb.fcgi', 'contrib/'), |
|
27 | ('contrib/hgweb.fcgi', 'contrib/'), | |
29 | ('contrib/hgweb.wsgi', 'contrib/'), |
|
28 | ('contrib/hgweb.wsgi', 'contrib/'), | |
@@ -36,7 +35,6 b' STAGING_RULES_WINDOWS = [' | |||||
36 | ('contrib/win32/postinstall.txt', 'ReleaseNotes.txt'), |
|
35 | ('contrib/win32/postinstall.txt', 'ReleaseNotes.txt'), | |
37 | ('contrib/win32/ReadMe.html', 'ReadMe.html'), |
|
36 | ('contrib/win32/ReadMe.html', 'ReadMe.html'), | |
38 | ('contrib/xml.rnc', 'contrib/'), |
|
37 | ('contrib/xml.rnc', 'contrib/'), | |
39 | ('contrib/zsh_completion', 'contrib/'), |
|
|||
40 | ('doc/*.html', 'doc/'), |
|
38 | ('doc/*.html', 'doc/'), | |
41 | ('doc/style.css', 'doc/'), |
|
39 | ('doc/style.css', 'doc/'), | |
42 | ('COPYING', 'Copying.txt'), |
|
40 | ('COPYING', 'Copying.txt'), |
@@ -126,14 +126,6 b' install -m 755 contrib/chg/chg $RPM_BUIL' | |||||
126 | install -m 755 contrib/hgk $RPM_BUILD_ROOT%{_bindir}/ |
|
126 | install -m 755 contrib/hgk $RPM_BUILD_ROOT%{_bindir}/ | |
127 | install -m 755 contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}/ |
|
127 | install -m 755 contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}/ | |
128 |
|
128 | |||
129 | bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d |
|
|||
130 | mkdir -p $bash_completion_dir |
|
|||
131 | install -m 644 contrib/bash_completion $bash_completion_dir/mercurial.sh |
|
|||
132 |
|
||||
133 | zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions |
|
|||
134 | mkdir -p $zsh_completion_dir |
|
|||
135 | install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial |
|
|||
136 |
|
||||
137 | mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir} |
|
129 | mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir} | |
138 | install -m 644 contrib/mercurial.el $RPM_BUILD_ROOT%{emacs_lispdir}/ |
|
130 | install -m 644 contrib/mercurial.el $RPM_BUILD_ROOT%{emacs_lispdir}/ | |
139 | install -m 644 contrib/mq.el $RPM_BUILD_ROOT%{emacs_lispdir}/ |
|
131 | install -m 644 contrib/mq.el $RPM_BUILD_ROOT%{emacs_lispdir}/ | |
@@ -148,9 +140,12 b' rm -rf $RPM_BUILD_ROOT' | |||||
148 | %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi contrib/*.wsgi |
|
140 | %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi contrib/*.wsgi | |
149 | %doc %attr(644,root,root) %{_mandir}/man?/hg* |
|
141 | %doc %attr(644,root,root) %{_mandir}/man?/hg* | |
150 | %doc %attr(644,root,root) contrib/*.svg |
|
142 | %doc %attr(644,root,root) contrib/*.svg | |
|
143 | %dir %{_datadir}/bash-completion/ | |||
|
144 | %dir %{_datadir}/bash-completion/completions | |||
|
145 | %{_datadir}/bash-completion/completions/hg | |||
151 | %dir %{_datadir}/zsh/ |
|
146 | %dir %{_datadir}/zsh/ | |
152 | %dir %{_datadir}/zsh/site-functions/ |
|
147 | %dir %{_datadir}/zsh/site-functions/ | |
153 |
%{_datadir}/zsh/site-functions/_ |
|
148 | %{_datadir}/zsh/site-functions/_hg | |
154 | %dir %{_datadir}/emacs/site-lisp/ |
|
149 | %dir %{_datadir}/emacs/site-lisp/ | |
155 | %{_datadir}/emacs/site-lisp/mercurial.el |
|
150 | %{_datadir}/emacs/site-lisp/mercurial.el | |
156 | %{_datadir}/emacs/site-lisp/mq.el |
|
151 | %{_datadir}/emacs/site-lisp/mq.el | |
@@ -158,8 +153,6 b' rm -rf $RPM_BUILD_ROOT' | |||||
158 | %{_bindir}/chg |
|
153 | %{_bindir}/chg | |
159 | %{_bindir}/hgk |
|
154 | %{_bindir}/hgk | |
160 | %{_bindir}/hg-ssh |
|
155 | %{_bindir}/hg-ssh | |
161 | %dir %{_sysconfdir}/bash_completion.d/ |
|
|||
162 | %config(noreplace) %{_sysconfdir}/bash_completion.d/mercurial.sh |
|
|||
163 | %dir %{_sysconfdir}/mercurial |
|
156 | %dir %{_sysconfdir}/mercurial | |
164 | %dir %{_sysconfdir}/mercurial/hgrc.d |
|
157 | %dir %{_sysconfdir}/mercurial/hgrc.d | |
165 | %if "%{?withpython}" |
|
158 | %if "%{?withpython}" |
@@ -982,6 +982,10 b' class hginstall(install):' | |||||
982 | ), |
|
982 | ), | |
983 | ] |
|
983 | ] | |
984 |
|
984 | |||
|
985 | sub_commands = install.sub_commands + [ | |||
|
986 | ('install_completion', lambda self: True) | |||
|
987 | ] | |||
|
988 | ||||
985 | # Also helps setuptools not be sad while we refuse to create eggs. |
|
989 | # Also helps setuptools not be sad while we refuse to create eggs. | |
986 | single_version_externally_managed = True |
|
990 | single_version_externally_managed = True | |
987 |
|
991 | |||
@@ -1101,6 +1105,33 b' class hginstallscripts(install_scripts):' | |||||
1101 | fp.write(data) |
|
1105 | fp.write(data) | |
1102 |
|
1106 | |||
1103 |
|
1107 | |||
|
1108 | class hginstallcompletion(Command): | |||
|
1109 | description = 'Install shell completion' | |||
|
1110 | ||||
|
1111 | def initialize_options(self): | |||
|
1112 | self.install_dir = None | |||
|
1113 | ||||
|
1114 | def finalize_options(self): | |||
|
1115 | self.set_undefined_options( | |||
|
1116 | 'install_data', ('install_dir', 'install_dir') | |||
|
1117 | ) | |||
|
1118 | ||||
|
1119 | def run(self): | |||
|
1120 | for src, dir_path, dest in ( | |||
|
1121 | ( | |||
|
1122 | 'bash_completion', | |||
|
1123 | ('share', 'bash-completion', 'completions'), | |||
|
1124 | 'hg', | |||
|
1125 | ), | |||
|
1126 | ('zsh_completion', ('share', 'zsh', 'site-functions'), '_hg'), | |||
|
1127 | ): | |||
|
1128 | dir = os.path.join(self.install_dir, *dir_path) | |||
|
1129 | self.mkpath(dir) | |||
|
1130 | self.copy_file( | |||
|
1131 | os.path.join('contrib', src), os.path.join(dir, dest) | |||
|
1132 | ) | |||
|
1133 | ||||
|
1134 | ||||
1104 | # virtualenv installs custom distutils/__init__.py and |
|
1135 | # virtualenv installs custom distutils/__init__.py and | |
1105 | # distutils/distutils.cfg files which essentially proxy back to the |
|
1136 | # distutils/distutils.cfg files which essentially proxy back to the | |
1106 | # "real" distutils in the main Python install. The presence of this |
|
1137 | # "real" distutils in the main Python install. The presence of this | |
@@ -1191,6 +1222,7 b' cmdclass = {' | |||||
1191 | 'build_scripts': hgbuildscripts, |
|
1222 | 'build_scripts': hgbuildscripts, | |
1192 | 'build_hgextindex': buildhgextindex, |
|
1223 | 'build_hgextindex': buildhgextindex, | |
1193 | 'install': hginstall, |
|
1224 | 'install': hginstall, | |
|
1225 | 'install_completion': hginstallcompletion, | |||
1194 | 'install_lib': hginstalllib, |
|
1226 | 'install_lib': hginstalllib, | |
1195 | 'install_scripts': hginstallscripts, |
|
1227 | 'install_scripts': hginstallscripts, | |
1196 | 'build_hgexe': buildhgexe, |
|
1228 | 'build_hgexe': buildhgexe, |
@@ -39,8 +39,8 b' Spot-check some randomly selected files:' | |||||
39 | ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyo 100644 0/0 |
|
39 | ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyo 100644 0/0 | |
40 | $ grep zsh/site-functions/_hg boms.txt | cut -d ' ' -f 1,2,3 |
|
40 | $ grep zsh/site-functions/_hg boms.txt | cut -d ' ' -f 1,2,3 | |
41 | ./usr/local/share/zsh/site-functions/_hg 100644 0/0 |
|
41 | ./usr/local/share/zsh/site-functions/_hg 100644 0/0 | |
42 |
$ grep h |
|
42 | $ grep bash-completion/completions/hg boms.txt | cut -d ' ' -f 1,2,3 | |
43 |
./usr/local/ |
|
43 | ./usr/local/share/bash-completion-completions/hg 100644 0/0 | |
44 | $ egrep 'man[15]' boms.txt | cut -d ' ' -f 1,2,3 |
|
44 | $ egrep 'man[15]' boms.txt | cut -d ' ' -f 1,2,3 | |
45 | ./usr/local/share/man/man1 40755 0/0 |
|
45 | ./usr/local/share/man/man1 40755 0/0 | |
46 | ./usr/local/share/man/man1/chg.1 100644 0/0 |
|
46 | ./usr/local/share/man/man1/chg.1 100644 0/0 |
General Comments 0
You need to be logged in to leave comments.
Login now