Commit Graph

134 Commits

Author SHA1 Message Date
Augie Fackler
4b4be91515 merge with stable 2017-06-24 15:50:13 -04:00
Anton Shestakov
a666e891cf make: add Debian 9 (Stretch) docker target 2017-06-23 13:33:41 +08:00
Anton Shestakov
5f2a285fbe make: templatize Debian build target a la 7766b31dd141 2017-06-23 13:08:46 +08:00
Anton Shestakov
d3bb529590 make: add Ubuntu Zesty docker targets (.deb and ppa)
Zesty Zapus was released on 2017-04-13 and will be supported until 2018-01.
2017-06-23 12:04:12 +08:00
Kyle Lippincott
8175ca534f zsh_completion: install as _hg not hg
The contrib/zsh_completion file itself says to name it _hg.

With a name like `hg`, if the user has a line like `autoload ${^fpath}/*(N-.:t)`
in their zshrc, it will create a shell function named `hg` that will hide the
actual hg command and make hg unusable.

Separately from that though, the underscore prefix makes it actually work. The
zsh man page states:

    The convention for autoloaded functions used in completion is that they
    start with an underscore

This does not seem to just be a "convention", though. With the ill-advised line
removed from my zshrc and the file named
`/usr/local/share/zsh/site-functions/hg` (without the underscore), these
completions did not seem to get loaded and the ones from the zsh installation
were loaded instead.  If I renamed them to be
`/usr/local/share/zsh/site-functions/_hg`, however, they were loaded.

I manually tested the above statement by starting a new zsh instance with the
file in `/usr/local/share/zsh/site-functions` with the following names:
- As `hg`, `which _hg_labels` did not show anything
- As `_hg`, `which _hg_labels` showed the expected function.
2017-05-26 13:24:07 -07:00
Augie Fackler
8e4d9f1f1d osx: override default exclude filter for pkgbuild
To quote `man 1 pkgbuild`:

     --filter filter-expression
                 By default, --root will include the entire contents of the
                 given root-path in the package payload, except for any .svn
                 or CVS directories, and any .DS_Store files. You can override
                 these default filters by specifying one or more --filter
                 options. Each filter-expression is an re_format(7)
                 ``extended'' expression: any path in the root which matches
                 any of the given expressions will be excluded from the pack-
                 age payload. (Note that specifying even one --filter inhibits
                 the default filters, so you must respecify the default fil-
                 ters if you still want them to be used.)

It turns out the default filter these days *also* includes .git and
.hg. Notice how that filter expression is a regular expression?  That
(presumably unintentionally) prevents a file named "chg" or "_hg" from
getting included in the distribution. Many many thanks to spectral@
for trying to include a _hg file which led us to figure this bug out.

Bug filed with Apple for this as rdar://problem/32437369, mentioning
both the gap in documentation and the wrong defaults.
2017-05-26 20:03:05 -04:00
Boris Feld
e2b921724b packaging: add make target for linux wheels
Having linux wheels is going to helps system without compiler or python-dev
plus speed up the installation for everyone.

I followed the manylinux example repository
https://github.com/pypa/python-manylinux-demo
to add a make target (build-linux-wheels) using
official docker image to build python 2 linux wheels
for mercurial. It generates Python 2.6 and Python 2.7 for both
32 and 64 bits architectures.

I had to blacklist several test cases for various reasons:
* test-convert-git.t and test-subrepo-git.t because of the git version
* test-patchbomb-tls.t because of warning using tls 1.0
  It's likely because the docker image is based on centos 5.0 and
  openssl is outdated.
2017-04-25 16:50:01 +02:00
Augie Fackler
2c0fcba7fe osx: always purge build/mercurial before starting build
This prevents stray files from previous builds from polluting newer builds.
2017-03-20 17:58:44 -04:00
Augie Fackler
9e6dae6142 osx: install completion scripts using install(1) to avoid umask badness
This actually fixes some tests that were showing us umask badness that
had been overlooked.
2017-03-20 17:50:05 -04:00
Kyle Lippincott
9cb9648f71 zsh_completion: install as _hg not hg
The contrib/zsh_completion file itself says to name it _hg.

With a name like `hg`, if the user has a line like `autoload ${^fpath}/*(N-.:t)`
in their zshrc, it will create a shell function named `hg` that will hide the
actual hg command and make hg unusable.

Separately from that though, the underscore prefix makes it actually work. The
zsh man page states:

    The convention for autoloaded functions used in completion is that they
    start with an underscore

This does not seem to just be a "convention", though. With the ill-advised line
removed from my zshrc and the file named
`/usr/local/share/zsh/site-functions/hg` (without the underscore), these
completions did not seem to get loaded and the ones from the zsh installation
were loaded instead.  If I renamed them to be
`/usr/local/share/zsh/site-functions/_hg`, however, they were loaded.

I manually tested the above statement by starting a new zsh instance with the
file in `/usr/local/share/zsh/site-functions` with the following names:
- As `hg`, `which _hg_labels` did not show anything
- As `_hg`, `which _hg_labels` showed the expected function.
2017-05-26 13:24:07 -07:00
Augie Fackler
a07746db36 osx: include chg by default 2017-03-20 17:50:31 -04:00
Augie Fackler
af74c9973b osx: override default exclude filter for pkgbuild
To quote `man 1 pkgbuild`:

     --filter filter-expression
                 By default, --root will include the entire contents of the
                 given root-path in the package payload, except for any .svn
                 or CVS directories, and any .DS_Store files. You can override
                 these default filters by specifying one or more --filter
                 options. Each filter-expression is an re_format(7)
                 ``extended'' expression: any path in the root which matches
                 any of the given expressions will be excluded from the pack-
                 age payload. (Note that specifying even one --filter inhibits
                 the default filters, so you must respecify the default fil-
                 ters if you still want them to be used.)

It turns out the default filter these days *also* includes .git and
.hg. Notice how that filter expression is a regular expression?  That
(presumably unintentionally) prevents a file named "chg" or "_hg" from
getting included in the distribution. Many many thanks to spectral@
for trying to include a _hg file which led us to figure this bug out.

Bug filed with Apple for this as rdar://problem/32437369, mentioning
both the gap in documentation and the wrong defaults.
2017-05-26 20:03:05 -04:00
Yuya Nishihara
b4362a7bf8 make: drop deprecated rule to process temporary copy of pure modules
Pure modules never be copied to mercurial/ since d071f155c000.
2016-08-12 11:36:42 +09:00
Augie Fackler
702946a650 osx: install bash and zsh completions by default
The zsh location appears to be on the default $fpath for zsh. bash, on
the other hand, appears to have no default location for completion
scripts, so we follow the lead of Apple's Git distribution and select
a semi-arbitrary place in /usr/local for the file.
2017-02-06 15:19:32 -05:00
Anton Shestakov
060ec61e49 make: update .PHONY targets 2017-02-15 14:49:33 +08:00
FUJIWARA Katsunori
f778068b44 misc: replace domain of mercurial-devel ML address by mercurial-scm.org
This patch also adds new check-code.py pattern to detect invalid usage
of "mercurial-devel@selenic.com".
2017-02-11 00:23:55 +09:00
Anton Shestakov
62425d536d make: remove targets for building packages for ubuntu wily (end of life)
Ubuntu 15.10 (Wily Werewolf) came out on October 22, 2015 and reached end of
life on July 28, 2016 [1]. Users were encouraged to upgrade to 16.04 (Xenial).

PPA doesn't allow new uploads targeting 15.10 anymore.

[1]: https://wiki.ubuntu.com/Releases
2017-01-06 09:56:40 +08:00
Gregory Szorc
e7a98e2138 make: targets for building packages for ubuntu yakkety
Ubuntu 16.10 Yakkety Yak is out. Let's support it.
2016-11-01 18:49:23 -07:00
Augie Fackler
6cbd7d8973 osx: stamp the hg version into the version field in the pkg
This is required for tools like https://github.com/munki/munki, and is
also more semantically correct.
2016-08-12 17:51:48 -04:00
Pierre-Yves David
a098ddad6b make: introduce a target to clean everything but packages
Removing the 'packages' directory makes nightly builder life much harder.
2016-07-29 00:39:59 +02:00
Augie Fackler
c36830f5df osx: explicitly build hg with /usr/bin/python2.7
This should help avoid creating a package that depends on a custom
Python, as happened when I built a package for 3.8.
2016-07-13 10:39:33 -04:00
Sean Farley
ca1aff7fdb ubuntu-xenial-ppa: add makefile rule 2016-04-27 01:07:40 -07:00
Sean Farley
83ef160aa1 ubuntu-wily-ppa: add makefile rule 2016-04-27 01:02:56 -07:00
Sean Farley
49dcbb48fa ubuntu-trusty-ppa: add makefile rule 2016-04-27 00:27:10 -07:00
Sean Farley
492deac0a3 ubuntu-xenial: add makefile rule to build deb 2016-04-27 00:18:18 -07:00
Sean Farley
8d241b8149 ubuntu-wily: add makefile rule to build deb 2016-04-27 00:10:49 -07:00
Sean Farley
bf3866fc9f make: turn ubuntu docker into template
This allows us to easily add more ubuntu docker targets (which following
patches will do).

Also, we no longer need the mkdir command.
2016-04-26 23:33:17 -07:00
Kevin Bullock
971fb62b26 osx: create a modern package including manpages
Instead of using bdist_mpkg, we use the modern Apple-provided tools to
build an OS X Installer package directly. This has several advantages:

* Avoids bdist_mpkg which seems to be barely maintained and is hard to
  use.
* Creates a single unified .pkg instead of a .mpkg.
* The package we produce is in the modern, single-file format instead of
  a directory bundle that we have to zip up for download.

In addition, this way of building the package now correctly:

* Installs the manpages, bringing the `make osx`-generated package in
  line with the official Mac packages we publish on the website.
* Installs files with the correct permissions instead of encoding the
  UID of the user who happened to build the package.

Thanks to Augie for updating the test expectations.
2016-04-27 10:20:36 -05:00
Augie Fackler
8b0b581117 osx: add support for keeping mpkgs
This is a bit of a hack, but I don't really want to mount a dmg during
a test, and I don't see an option with hdiutil to take a dmg and spit
out a folder, so this is what we've got for now.
2016-04-18 23:59:28 -04:00
Augie Fackler
a7f803602c osx: add support for dumping built dmg into OUTPUTDIR 2016-04-18 23:57:22 -04:00
Siddharth Agarwal
74116a4f32 make: backout changeset e3b84d90a55b
Support for '!=' was only added in GNU Make 4.0, and CentOS versions as new as
CentOS 7 only carry 3.82.

I will leave figuring out compatibility with BSD make as an exercise for
interested folks.
2016-04-25 16:34:02 -07:00
Augie Fackler
280edd8f34 make: use shell-command assignment instead of $(eval ...)
This is portable between BSD and GNU make.

As of this change, our Makefile appears to work in both BSD and GNU
make, with the caveat that the test-% and testpy-% wildcard rules
don't work on BSD make. That said, this still seems worthwhile because
it lets the buildbots work more consistently across platforms.
2016-04-21 10:11:20 -04:00
Augie Fackler
da32b6b74d make: do assignment and export in a single statement
This is portable between GNU and BSD make, whereas doing the export on
its own line confuses BSD make.
2016-04-21 10:10:48 -04:00
Augie Fackler
10944bd011 make: alter how we compute compiler flags for setup.py
This is portable between BSD and GNU make. I'm not thrilled with how
it worked out, but it's portable and solves the problem.
2016-04-21 10:05:14 -04:00
Sean Farley
c278aa536d make: add rule for building an ubuntu ppa 2016-04-16 13:02:13 -07:00
Sean Farley
33f8cae522 make: remove packages directory in clean rule 2016-04-15 13:10:34 -07:00
Sean Farley
8110a0a71f make: add forgotten hgext3rd to clean rule 2016-04-15 11:51:57 -07:00
Sean Farley
ec938b217f make: add chg to clean rule 2016-04-15 11:51:41 -07:00
Anton Shestakov
78963e34c6 dockerdeb: add Ubuntu Trusty
One problem reported by lintian is "bad-distribution-in-changes-file unstable"
in changelog, but the current changelog for the official package in Ubuntu also
uses that distribution name (unstable), because they import from Debian. This
certainly doesn't stop the build process.
2016-03-10 23:46:19 +08:00
timeless
d54666f50a setup: create a module for the modulepolicy
Instead of rewriting __init__ to define the modulepolicy,
write out a __modulepolicy__.py file like __version__.py

This should work for both system-wide installation and in-place build. Therefore
we can avoid relying on two separate modulepolicy rules, '@MODULELOADPOLICY@'
and 'mercurial/modulepolicy'.
2016-03-09 15:47:01 +00:00
Anton Shestakov
11e3a4574b builddeb: read default distribution and codename from lsb_release
This makes `make deb` place packages into a more appropriately named directory
instead of just "debian-unknown".
2015-11-25 18:07:33 +08:00
Anton Shestakov
b61eeae0ab builddeb: add --distid option to specify Distributor ID
This allows builddeb to handle distributions that are not Debian.

Distributor ID is reported by lsb_release --id, and in case of builddeb it's
usually Debian or Ubuntu.
2015-11-25 15:15:03 +08:00
Anton Shestakov
b5106c63ef builddeb: rename --release option to --codename
Debian and Ubuntu releases have both codenames and traditional version numbers.
An entire "branch" of releases is referred to by its codename, and version
numbers (e.g. 8.2, 14.04.3) are used to address individual releases.

Since we use codenames for building .deb packages, let's call the option and
the variable appropriately.
2015-11-25 14:59:43 +08:00
Nathan Goldbaum
77c0959268 makefile: add wheel build target 2015-10-09 12:30:46 -05:00
Augie Fackler
bf1f880a9e builddeb: rework how output dir and platform are specified
This makes it possible to write tests for both builddeb and dockerdeb
that actually build .debs and then sanity check the contents.
2015-08-25 00:02:44 -04:00
Augie Fackler
196afc1244 docker-debian-jessie: fix errant mkdir 2015-08-24 23:47:43 -04:00
Augie Fackler
dfa5f19293 makefile: rename debian-jessie to deb
`make debian-jessie` was a poor name choice on my part, because it
really builds a package for the current debian platform, whatever that
happens to be, rather than a specific platform. Rename it to just
`make deb` so that it's a little clearer. As a result, it now places
built debs in a "debian-unknown" directory.
2015-08-27 14:24:39 -04:00
Augie Fackler
c491e8091f dockerdeb: rules to build a debian package using docker
Currently only supports jessie (current stable), but other version
should be trivial.
2015-05-06 13:15:39 -04:00
Augie Fackler
c2c147fe7a builddeb: new script for building a deb package
Future work will allow us to use docker to build debs.

Right now this doesn't install any config files. I plan to do that as
a followup, but getting something basic and working checked in seems
like more of a priority than getting everything done in one big step.

This also does not create a source deb yet. I haven't looked into that
process.

Note that this declares incompatibility with the `mercurial-common`
package. It's typical for debian packages to be split between
architecture-independent bits and native bits, meaning the python bits
downstream live in mercurial-common and the c extension bits live in
mercurial. We don't do that because we want to (ideally) give users a
single deb file to install.
2015-05-06 13:13:54 -04:00
FUJIWARA Katsunori
6d60352ea0 i18n: extract doc string of each web commands as translatable one
Before this patch, doc string of each web commands isn't extracted as
translatable one, even though web commands are listed up in "hg help
hgweb".

This patch adds "mercurial/hgweb/webcommands.py" on to arguments of
"i18n/hggettext". "i18nfunctions" added into "webcommands.py" is used
by "i18n/hggettext" to get the list of functions having translatable
doc string.
2015-04-28 00:38:16 +09:00