contrib/plan9/mkfile
author Martin von Zweigbergk <martinvonz@google.com>
Tue, 28 Oct 2014 22:47:22 -0700
changeset 25233 9789b4a7c595
parent 16556 f9262456fb01
permissions -rw-r--r--
match: introduce boolean prefix() method tl;dr: This is another step towards a (previously unstated) goal of eliminating match.files() in conditions. There are four types of matchers: * always: Matches everything, checked with always(), files() is empty * exact: Matches exact set of files, checked with isexact(), files() contains the files to match * patterns: Matches more complex patterns, checked with anypats(), files() contains roots of the matched patterns * prefix: Matches simple 'path:' patterns as prefixes ('foo' matches both 'foo' and 'foo/bar'), no single method to check, files() contains the prefixes to match For completeness, it would be nice to have a method for checking for the "prefix" type of matcher as well, so let's add that, making it return True simply when none of the others do. The larger goal here is to eliminate uses of match.files() in conditions (i.e. bool(match.files())). The reason for this is that there are scenarios when you would like to create a "prefix" matcher that happens to match no files. One example is for 'hg files -I foo bar'. The narrowmatcher also restricts the set of files given and it would not surprise me if have bugs caused by that already. Note that 'if m.files() and not m.anypats()' and similar is sometimes used to catch the "exact" and "prefix" cases above.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16383
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
     1
APE=/sys/src/ape
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
     2
<$APE/config
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
     3
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
     4
PYTHON=python
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
     5
PYTHONBIN=/rc/bin
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
     6
SH=ape/psh
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
     7
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
     8
PURE=--pure
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
     9
ROOT=../..
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    10
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    11
# This is slightly underhanded; Plan 9 does not support GNU gettext nor
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    12
# does it support dynamically loaded extension modules. We work around
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    13
# this by calling build_py and build_scripts directly; this avoids
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    14
# additional platform hacks in setup.py.
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    15
build:VQ:
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    16
	@{
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    17
		cd $ROOT
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    18
		$SH -c '$PYTHON setup.py $PURE build_py build_scripts'
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    19
	}
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    20
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    21
clean:VQ:
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    22
	@{
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    23
		cd $ROOT
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    24
		$SH -c '$PYTHON setup.py $PURE clean --all'
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    25
	}
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    26
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    27
install:VQ:	build
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    28
	@{
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    29
		cd $ROOT
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    30
		$SH -c '$PYTHON setup.py $PURE install \
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    31
			--install-scripts $PYTHONBIN \
16556
f9262456fb01 plan9: mkfile and 9diff fixes
Steven Stallion <sstallion@gmail.com>
parents: 16383
diff changeset
    32
			--skip-build \
f9262456fb01 plan9: mkfile and 9diff fixes
Steven Stallion <sstallion@gmail.com>
parents: 16383
diff changeset
    33
			--force'
16383
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    34
	}
f5dd179bfa4a plan9: initial support for plan 9 from bell labs
Steven Stallion <sstallion@gmail.com>
parents:
diff changeset
    35
	mkdir -p /lib/mercurial/hgrc.d
16556
f9262456fb01 plan9: mkfile and 9diff fixes
Steven Stallion <sstallion@gmail.com>
parents: 16383
diff changeset
    36
	dircp hgrc.d /lib/mercurial/hgrc.d/
f9262456fb01 plan9: mkfile and 9diff fixes
Steven Stallion <sstallion@gmail.com>
parents: 16383
diff changeset
    37
	cp 9diff /rc/bin/