From 168865f1387dc40e12bd395a8cfccdcd39418eb8 Mon Sep 17 00:00:00 2001 From: William Ting Date: Tue, 17 Apr 2012 13:40:53 -1000 Subject: [PATCH] fix install.sh to reflect new locations, tweak documentation where necessary --- Makefile | 11 ++++++++--- docs/install.md | 13 +++++++++---- install.sh | 28 ++++++++++++++-------------- uninstall.sh | 4 ++-- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 3392c52..57f9a85 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,14 @@ VERSION = v20 TAGNAME = release-$(VERSION) -.PHONY: docs install +.PHONY: docs install uninstall install: install.sh +uninstall: + uninstall.sh + docs: pandoc -s -w man docs/manpage.md -o docs/autojump.1 pandoc -s -w markdown docs/manpage.md docs/install.md -o README.md @@ -14,12 +17,14 @@ release: # Check for tag existence # git describe release-$(VERSION) 2>&1 >/dev/null || exit 1 - tools/git-version.sh $(TAGNAME) + # Modify autojump with version + ./tools/git-version.sh $(TAGNAME) # Commit the version change - git commit -m "version numbering" autojump + git commit -m "version numbering" ./bin/autojump # Create tag git tag -a $(TAGNAME) + # Create tagged archive git archive --format=tar --prefix autojump_$(VERSION)/ $(TAGNAME) | gzip > autojump_$(VERSION).tar.gz diff --git a/docs/install.md b/docs/install.md index 16fda4a..e8d4676 100644 --- a/docs/install.md +++ b/docs/install.md @@ -6,11 +6,11 @@ Python v2.7+ or 3.2+ Bash v4.0+ for tab completion -If you are unable to update Python to a supported version, older versions of autojump can be [downloaded](https://github.com/joelthelion/autojump/downloads) and installed manually. +If you are unable to update Python to a supported version, older versions of autojump can be [downloaded][dl] and installed manually. -Python v2.6+ is supported by [release v19](https://github.com/downloads/joelthelion/autojump/autojump_v19.tar.gz). +Python v2.6+ is supported by [release v19][v19]. -Python v2.4+ is supported by [release v12](https://github.com/downloads/joelthelion/autojump/autojump_v12.tar.gz). +Python v2.4+ is supported by [release v12][v12]. ### AUTOMATIC INSTALLATION @@ -40,7 +40,7 @@ MacPorts also available: **Other** -Please check the [Wiki](https://github.com/joelthelion/autojump/wiki) for an up to date listing of installation methods. +Please check the [Wiki][wiki] for an up to date listing of installation methods. ### MANUAL INSTALLATION @@ -71,3 +71,8 @@ Run the uninstallation script: and follow on screen instructions. If you keep getting `autojump: command not found` at the prompt, do:`unset PROMPT_COMMAND`. You can also restart your shell. + +[dl]: https://github.com/joelthelion/autojump/downloads +[v12]: https://github.com/downloads/joelthelion/autojump/autojump_v12.tar.gz +[v19]: https://github.com/downloads/joelthelion/autojump/autojump_v19.tar.gz +[wiki]: https://github.com/joelthelion/autojump/wiki diff --git a/install.sh b/install.sh index 88d72eb..67a3fcc 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#Copyright Joel Schaerer 2008, 2009 +#Copyright Joel Schaerer 2008-2012 #This file is part of autojump #autojump is free software: you can redistribute it and/or modify @@ -21,9 +21,9 @@ function add_msg { echo if [ "${1}" == "global" ]; then - echo -e "\t[[ -f /etc/profile.d/autojump.${2} ]] && source /etc/profile.d/autojump.${2}" + echo -e "\t[[ -s /etc/profile.d/autojump.${2} ]] && source /etc/profile.d/autojump.${2}" elif [ "${1}" == "local" ]; then - echo -e "\t[[ -f ~/.autojump/etc/profile.d/autojump.${2} ]] && source ~/.autojump/etc/profile.d/autojump.${2}" + echo -e "\t[[ -s ~/.autojump/etc/profile.d/autojump.${2} ]] && source ~/.autojump/etc/profile.d/autojump.${2}" fi echo @@ -179,16 +179,16 @@ echo "Installing ${shell} version of autojump to ${prefix} ..." echo # add git revision to autojump -./git-version.sh +./tools/git-version.sh # INSTALL AUTOJUMP mkdir -p ${prefix}/share/autojump/ mkdir -p ${prefix}/bin/ mkdir -p ${prefix}/share/man/man1/ -cp -v icon.png ${prefix}/share/autojump/ -cp -v jumpapplet ${prefix}/bin/ -cp -v autojump ${prefix}/bin/ -cp -v autojump.1 ${prefix}/share/man/man1/ +cp -v ./bin/icon.png ${prefix}/share/autojump/ +cp -v ./bin/jumpapplet ${prefix}/bin/ +cp -v ./bin/autojump ${prefix}/bin/ +cp -v ./docs/autojump.1 ${prefix}/share/man/man1/ # global installation if [ ! ${local} ]; then @@ -197,7 +197,7 @@ if [ ! ${local} ]; then success= fpath=`/usr/bin/env zsh -c 'echo $fpath'` for f in ${fpath}; do - cp -v _j ${f} && success=true && break + cp -v ./bin/_j ${f} && success=true && break done if [ ! ${success} ]; then @@ -209,20 +209,20 @@ if [ ! ${local} ]; then fi if [ -d "/etc/profile.d" ]; then - cp -v autojump.sh /etc/profile.d/ - cp -v autojump.${shell} /etc/profile.d/ + cp -v ./bin/autojump.sh /etc/profile.d/ + cp -v ./bin/autojump.${shell} /etc/profile.d/ add_msg "global" ${shell} else echo "Your distribution does not have a '/etc/profile.d/' directory, please create it manually or use the local install option." fi else # local installation mkdir -p ${prefix}/etc/profile.d/ - cp -v autojump.sh ${prefix}/etc/profile.d/ - cp -v autojump.${shell} ${prefix}/etc/profile.d/ + cp -v ./bin/autojump.sh ${prefix}/etc/profile.d/ + cp -v ./bin/autojump.${shell} ${prefix}/etc/profile.d/ if [ ${shell} == "zsh" ]; then mkdir -p ${prefix}/functions/ - cp _j ${prefix}/functions/ + cp ./bin/_j ${prefix}/functions/ fi add_msg "local" ${shell} diff --git a/uninstall.sh b/uninstall.sh index 9bbe2bb..72f6cee 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -24,9 +24,9 @@ function remove_msg { echo "Please remove the line from .${2}rc :" echo if [ "${1}" == "global" ]; then - echo -e "\t[[ -f /etc/profile.d/autojump.${2} ]] && source /etc/profile.d/autojump.${2}" + echo -e "\t[[ -s /etc/profile.d/autojump.${2} ]] && source /etc/profile.d/autojump.${2}" elif [ "${1}" == "local" ]; then - echo -e "\t[[ -f ~/.autojump/etc/profile.d/autojump.${2} ]] && source ~/.autojump/etc/profile.d/autojump.${2}" + echo -e "\t[[ -s ~/.autojump/etc/profile.d/autojump.${2} ]] && source ~/.autojump/etc/profile.d/autojump.${2}" fi echo }