Skip to content

Commit 5673bfd

Browse files
author
Seth Schoen
committed
Merge branch 'master' of git://git.torproject.org/git/https-everywhere
2 parents e37c829 + 543febe commit 5673bfd

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
*.xpi
1+
pkg/*.xpi
2+
*~
3+
*.swp

makexpi.sh

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,59 @@ APP_NAME=https-everywhere
77
# invoke with no arguments to pull a prerelease of the current
88
# development point.
99

10-
# invoke with a tag name to build a specific branch.
10+
# invoke with the literal argument "uncommitted" to build from the
11+
# current src directory.
12+
13+
# invoke with a tag name to build a specific branch or tag.
1114

1215
# e.g.:
1316
# ./makexpi.sh 0.2.3.development.2
1417

1518
# or just:
1619
# ./makexpi.sh
1720

18-
if [ "$1" ] ; then
21+
# BUGS: if you have a branch or tagged named "uncommitted" then this
22+
# is kind of ambiguous.
23+
24+
cd "$(dirname $0)"
25+
26+
if [ -n "$1" ] && [ "$1" != "uncommitted" ]; then
1927
VERSION="$1"
2028
TARG="$1"
2129
else
2230
VERSION="$(grep em:version src/install.rdf | sed -e 's/[<>]/ /g' | cut -f3)~pre"
2331
TARG=HEAD
32+
if [ "$1" != "uncommitted" ] && [ -n "$(git status src -s)" ] ; then
33+
printf >&2 "\
34+
WARNING: There are uncommitted changes in your current repostitory.
35+
WARNING: These changes will not be included in the generated .xpi
36+
WARNING: Run 'git status' for information about the uncommitted changes.
37+
WARNING: Or, use 'makexpi.sh uncommitted' to include them in the build.
38+
"
39+
fi
2440
fi
2541
XPI_NAME="pkg/$APP_NAME-$VERSION.xpi"
2642
[ -d pkg ] || mkdir pkg
2743

28-
cd "$(dirname $0)/src"
29-
git archive --format=zip -9 "$TARG" . > "../$XPI_NAME"
44+
cd "src"
45+
if [ "$1" = "uncommitted" ]; then
46+
printf >&2 "WARNING: using zip instead of git archive to build .xpi\n"
47+
CHANGES="$(git status . -s)"
48+
if [ -n "$CHANGES" ]; then
49+
printf >&2 "WARNING: uncommitted changes were included:\n%s\n" "$CHANGES"
50+
fi
51+
# FIXME: is it really acceptable to reuse .gitignore to specify
52+
# include patterns for /usr/bin/zip? It seems to work for our
53+
# current patterns (2010-11-09)
54+
zip -X -q -9r "../$XPI_NAME" . "-x@../.gitignore"
55+
else
56+
git archive --format=zip -9 "$TARG" . > "../$XPI_NAME"
57+
fi
58+
3059
ret="$?"
3160
if [ "$ret" != 0 ]; then
3261
rm -f "../$XPI_NAME"
3362
exit "$?"
3463
else
35-
echo Created $XPI_NAME
64+
printf >&2 "Created %s\n" "$XPI_NAME"
3665
fi

0 commit comments

Comments
 (0)