tests/test-mac-packages.t
author Matt Harbison <matt_harbison@yahoo.com>
Fri, 31 Jan 2020 22:20:39 -0500
branchstable
changeset 44148 aab70b540d3d
parent 33594 283a7da602ae
child 49066 8d7eaff92f9c
permissions -rw-r--r--
resourceutil: account for the non-resource-like file hierarchy under py2exe After 9e367157a990, config files for py2exe were expected to be in C:\Program Files\Mercurial\mercurial\defaultrc because of the implied resource structure of 'mercurial.defaultrc.*.rc', relative to the executable. Accomodating this would require changes to the WIX and Inno scripts (and perhaps the script that generates the WIX script), as well as 3rd party bundlers like TortoiseHg. But these files aren't read as resources anyway- they fall back to the filesystem APIs. (If we really wanted to carry on the charade, the installer would have to also sprinkle various empty __init__.py files around.) Instead, this simply prunes the 'mercurial.' portion of the resource name when run with py2exe. (PyOxidizer uses the resources API, not the filesystem fallback, so it is unaffected.) Since this hack only affects the py2 Windows installers and is less risky, I think it's reasonable. We haven't needed to load any 3rd party resource up to this point, and would have to make packaging changes anyway to handle that. Differential Revision: https://phab.mercurial-scm.org/D8058
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
     1
#require test-repo slow osx osxpackaging
29219
3c9066ed557c tests: silence test-repo obsolete warning
timeless <timeless@mozdev.org>
parents: 29027
diff changeset
     2
3c9066ed557c tests: silence test-repo obsolete warning
timeless <timeless@mozdev.org>
parents: 29027
diff changeset
     3
  $ . "$TESTDIR/helpers-testrepo.sh"
33204
ddd65b4f3ae6 tests: alias syshg and syshgenv so they can be switched conditionally
Yuya Nishihara <yuya@tcha.org>
parents: 33128
diff changeset
     4
  $ testrepohgenv
29219
3c9066ed557c tests: silence test-repo obsolete warning
timeless <timeless@mozdev.org>
parents: 29027
diff changeset
     5
31615
6dc8caccef8a osx: use more paranoid quoting in test
Augie Fackler <augie@google.com>
parents: 31614
diff changeset
     6
  $ OUTPUTDIR="`pwd`"
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
     7
  $ export OUTPUTDIR
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
     8
  $ KEEPMPKG=yes
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
     9
  $ export KEEPMPKG
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    10
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    11
  $ cd "$TESTDIR"/..
33594
283a7da602ae osx: new script for generating OS X package versions
Augie Fackler <augie@google.com>
parents: 33593
diff changeset
    12
  $ contrib/genosxversion.py --selftest ignoredarg
31615
6dc8caccef8a osx: use more paranoid quoting in test
Augie Fackler <augie@google.com>
parents: 31614
diff changeset
    13
  $ make osx > "$OUTPUTDIR/build.log" 2>&1
6dc8caccef8a osx: use more paranoid quoting in test
Augie Fackler <augie@google.com>
parents: 31614
diff changeset
    14
  $ cd "$OUTPUTDIR"
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    15
  $ ls -d *.pkg
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    16
  Mercurial-*-macosx10.*.pkg (glob)
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    17
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    18
  $ xar -xf Mercurial*.pkg
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    19
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    20
Gather list of all installed files:
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    21
  $ lsbom mercurial.pkg/Bom > boms.txt
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    22
32134
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31615
diff changeset
    23
We've had problems with the filter logic in the past. Make sure no
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31615
diff changeset
    24
.DS_Store files ended up in the final package:
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31615
diff changeset
    25
  $ grep DS_S boms.txt
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31615
diff changeset
    26
  [1]
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 31615
diff changeset
    27
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    28
Spot-check some randomly selected files:
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    29
  $ grep bdiff boms.txt | cut -d '	' -f 1,2,3
32503
0e93dc8c0f9f osx: update Mac packaging tests for bdiff.so install location change
Augie Fackler <augie@google.com>
parents: 31615
diff changeset
    30
  ./Library/Python/2.7/site-packages/mercurial/cext/bdiff.so	100755	0/0
33593
441a4550a80a tests: update mac packaging test expectations
Augie Fackler <augie@google.com>
parents: 33204
diff changeset
    31
  ./Library/Python/2.7/site-packages/mercurial/cffi/bdiff.py	100644	0/0
441a4550a80a tests: update mac packaging test expectations
Augie Fackler <augie@google.com>
parents: 33204
diff changeset
    32
  ./Library/Python/2.7/site-packages/mercurial/cffi/bdiff.pyc	100644	0/0
441a4550a80a tests: update mac packaging test expectations
Augie Fackler <augie@google.com>
parents: 33204
diff changeset
    33
  ./Library/Python/2.7/site-packages/mercurial/cffi/bdiff.pyo	100644	0/0
441a4550a80a tests: update mac packaging test expectations
Augie Fackler <augie@google.com>
parents: 33204
diff changeset
    34
  ./Library/Python/2.7/site-packages/mercurial/cffi/bdiffbuild.py	100644	0/0
441a4550a80a tests: update mac packaging test expectations
Augie Fackler <augie@google.com>
parents: 33204
diff changeset
    35
  ./Library/Python/2.7/site-packages/mercurial/cffi/bdiffbuild.pyc	100644	0/0
441a4550a80a tests: update mac packaging test expectations
Augie Fackler <augie@google.com>
parents: 33204
diff changeset
    36
  ./Library/Python/2.7/site-packages/mercurial/cffi/bdiffbuild.pyo	100644	0/0
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    37
  ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.py	100644	0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    38
  ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyc	100644	0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    39
  ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyo	100644	0/0
32135
501d48bda912 zsh_completion: install as _hg not hg
Kyle Lippincott <spectral@google.com>
parents: 32134
diff changeset
    40
  $ grep zsh/site-functions/_hg boms.txt | cut -d '	' -f 1,2,3
501d48bda912 zsh_completion: install as _hg not hg
Kyle Lippincott <spectral@google.com>
parents: 32134
diff changeset
    41
  ./usr/local/share/zsh/site-functions/_hg	100644	0/0
31152
408dcf7475a7 osx: install bash and zsh completions by default
Augie Fackler <augie@google.com>
parents: 29535
diff changeset
    42
  $ grep hg-completion.bash boms.txt | cut -d '	' -f 1,2,3
31614
8e516f71577a osx: install completion scripts using install(1) to avoid umask badness
Augie Fackler <augie@google.com>
parents: 31152
diff changeset
    43
  ./usr/local/hg/contrib/hg-completion.bash	100644	0/0
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    44
  $ egrep 'man[15]' boms.txt | cut -d '	' -f 1,2,3
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    45
  ./usr/local/share/man/man1	40755	0/0
32505
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32504
diff changeset
    46
  ./usr/local/share/man/man1/chg.1	100644	0/0
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    47
  ./usr/local/share/man/man1/hg.1	100644	0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    48
  ./usr/local/share/man/man5	40755	0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    49
  ./usr/local/share/man/man5/hgignore.5	100644	0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    50
  ./usr/local/share/man/man5/hgrc.5	100644	0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    51
  $ grep bser boms.txt | cut -d '	' -f 1,2,3
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    52
  ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/bser.so	100755	0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    53
  ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.py	100644	0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    54
  ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.pyc	100644	0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    55
  ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.pyo	100644	0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    56
  $ grep localrepo boms.txt | cut -d '	' -f 1,2,3
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    57
  ./Library/Python/2.7/site-packages/mercurial/localrepo.py	100644	0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    58
  ./Library/Python/2.7/site-packages/mercurial/localrepo.pyc	100644	0/0
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    59
  ./Library/Python/2.7/site-packages/mercurial/localrepo.pyo	100644	0/0
32505
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32504
diff changeset
    60
  $ egrep 'bin/' boms.txt | cut -d '	' -f 1,2,3
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32504
diff changeset
    61
  ./usr/local/bin/chg	100755	0/0
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29025
diff changeset
    62
  ./usr/local/bin/hg	100755	0/0
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    63
29535
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
    64
Make sure the built binary uses the system Python interpreter
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
    65
  $ bsdtar xf mercurial.pkg/Payload usr/local/bin
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
    66
Use a glob to find this to avoid check-code whining about a fixed path.
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
    67
  $ head -n 1 usr/local/b?n/hg
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
    68
  #!/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29219
diff changeset
    69
29025
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    70
Note that we're not currently installing any /etc/mercurial stuff,
f2549b0ba9ab tests: add test for Mac OS X package construction
Augie Fackler <augie@google.com>
parents:
diff changeset
    71
including merge-tool configurations.