From 5c55d163c090ce8004802d99c1110074ca2f96c6 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 5 Oct 2010 14:17:53 -0400 Subject: [PATCH] Fix 'make install' on Cygwin and make_jar.sh on Cygwin and BSD-ish systems. Closes issue #43. --- common/Makefile | 10 ++++++++-- common/make_jar.sh | 18 ++++++++++++++---- pentadactyl/Makefile | 3 ++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/common/Makefile b/common/Makefile index d8400a50..0fea4223 100644 --- a/common/Makefile +++ b/common/Makefile @@ -111,7 +111,10 @@ install: profile=$$(sed 's/^$$/\#/' "$$dir/profiles.ini" |\ awk -v"profile=$(PROFILE)" \ 'BEGIN { RS="#" } \ - index($$0, "\nName=" profile "\n") || !profile && /\nDefault=1/' |\ + index($$0, "\nName=" profile "\n") { print; exit } \ + !profile && /\nName=default\n/ { args["name=default"] = $$0 } \ + !profile && /\nDefault=1/ { args["default=1"] = $$0 } \ + END { if (args["default=1"]) print args["default=1"]; else print args["name=default"] }' |\ awk -F= '{ args[$$1] = $$2 } \ END {\ if (args["IsRelative"]) print ENVIRON["dir"] "/" args["Path"];\ @@ -125,7 +128,10 @@ install: rm -f "$$ext.xpi"; \ rm -rf "$$ext"; \ echo "Installing to $$ext"; \ - pwd >"$$ext" + if which cygpath >/dev/null 2>&1; \ + then cygpath -wa .; \ + else pwd; \ + fi >"$$ext" installxpi: xpi $(FIREFOX) $(XPI) diff --git a/common/make_jar.sh b/common/make_jar.sh index 4437e65f..4abe91ab 100644 --- a/common/make_jar.sh +++ b/common/make_jar.sh @@ -9,19 +9,29 @@ text=$4 bin=$5 shift 5; files="$@" +HG=${HG:-hg} stage="$top/${jar%.*}" mkdir -p $stage -if hg root >/dev/null 2>&1 +sed=$(which sed) +if [ "xoo" = x$(echo foo | sed -E 's/f(o)/\1/' 2>/dev/null) ] +then sed() { $sed -E "$@"; } +else sed() { $sed -r "$@"; } +fi + +if $HG root >/dev/null 2>&1 then - root="$(hg root)" - mf="$(hg --config ui.debug=false --config ui.verbose=false manifest)" + root="$($HG root)" + which cygpath >/dev/null 2>&1 && root=$(cygpath $root) + + mf="$($HG --config ui.debug=false --config ui.verbose=false manifest)" find=$(which find) find() { $find "$@" -name '*.jar' - echo "$mf" | sed -n "s!$(pwd | sed "s!$root/\?!!")/\?!!p" | + echo "$mf" | sed -n "s!$(pwd | sed "s!$root/?!!")/?!!p" | grep "^$1" + exit 1 } fi diff --git a/pentadactyl/Makefile b/pentadactyl/Makefile index e5e39d6d..74afcb96 100644 --- a/pentadactyl/Makefile +++ b/pentadactyl/Makefile @@ -6,6 +6,7 @@ FIREFOX ?= firefox HOSTAPP ?= $(FIREFOX) PROFILEPATHS ?= "$$HOME/.mozilla/firefox" \ "$$HOME/Library/Mozilla/Firefox" \ - "$$APPDATA/Mozilla/Firefox" + "$$APPDATA/Mozilla/Firefox" \ + "$$AppData/Mozilla/Firefox" include ../common/Makefile