diff --git a/Running_Linux_OSX.md b/Running_Linux_OSX.md index d576075ce41b4e2a37188a2549a8d5233c9a144a..ea85963da34698fe4dcd62161a2b56a0ec78420b 100644 --- a/Running_Linux_OSX.md +++ b/Running_Linux_OSX.md @@ -76,7 +76,7 @@ The Sleuth Kit must be installed before trying to install Autopsy. If you are o - Please ensure you have all the prerequisites installed on your system (see the directions [here](#installing-prerequisites)). - If you don't have a copy of the repository on your local machine, clone it (this requires git): ``` - git clone https://github.com/sleuthkit/sleuthkit.git + git clone --depth 1 https://github.com/sleuthkit/sleuthkit.git ``` - If you want to build source from a particular branch or tag (i.e. `develop` or `release-4.11.0`), check out that branch: ``` @@ -97,7 +97,7 @@ The Sleuth Kit must be installed before trying to install Autopsy. If you are o *In most instances, you should download the Autopsy Zip file from the [Autopsy downloads section](https://www.autopsy.com/download/) or in the [Releases section on GitHub](https://github.com/sleuthkit/autopsy/releases/), but if you have a special use case you can do the following. Please make sure you have the [prerequisites installed](#installing-prerequisites) and have [installed The Sleuth Kit](#install-sleuthkit).* - If you haven't already, clone the repo: ``` - git clone https://github.com/sleuthkit/autopsy.git + git clone --depth 1 https://github.com/sleuthkit/autopsy.git ``` - With the autopsy repo as your working directory, you can run: ``` diff --git a/linux_macos_install_scripts/install_tsk_from_src.sh b/linux_macos_install_scripts/install_tsk_from_src.sh index cd9b9e4a0d0ee66b2cb59f92809aaebebe1e54ee..e3a4872e71dbdf75490d41e0ce549ec191d5fcbb 100644 --- a/linux_macos_install_scripts/install_tsk_from_src.sh +++ b/linux_macos_install_scripts/install_tsk_from_src.sh @@ -4,11 +4,12 @@ # called like: build_tsk.sh -r <repo path to be created or existing> -b <tsk branch to checkout> -r <non-standard remote repo (optional)> usage() { - echo "Usage: install_tsk_from_src [-p repo_path] [-b tsk_branch] [-r sleuthkit_repo]" 1>&2 + echo "Usage: install_tsk_from_src [-p repo_path (should end with '/sleuthkit')] [-b tsk_branch] [-r sleuthkit_repo]" 1>&2 } # default repo path REPO="https://github.com/sleuthkit/sleuthkit.git" +TSK_BRANCH="develop" while getopts "p:r:b:" o; do case "${o}" in @@ -28,7 +29,7 @@ while getopts "p:r:b:" o; do esac done -if [[ -z "${SLEUTHKIT_SRC_DIR}" ]] || [[ -z "${TSK_BRANCH}" ]]; then +if [[ -z "${SLEUTHKIT_SRC_DIR}" ]]; then usage exit 1 fi @@ -38,23 +39,25 @@ if [[ ! -d $SLEUTHKIT_SRC_DIR ]]; then echo "Cloning Sleuthkit to $TSK_REPO_PATH..." mkdir -p $TSK_REPO_PATH && pushd $TSK_REPO_PATH && - git clone $REPO && + git clone --depth 1 -b $TSK_BRANCH $REPO && popd if [[ ! -d $SLEUTHKIT_SRC_DIR ]]; then echo "Unable to successfully clone Sleuthkit" >>/dev/stderr exit 1 fi -fi - -echo "Getting latest of Sleuthkit branch: $TSK_BRANCH..." -pushd $SLEUTHKIT_SRC_DIR && - git reset --hard && - git checkout $TSK_BRANCH && - git pull && - popd -if [[ $? -ne 0 ]]; then - echo "Unable to reset Sleuthkit repo and pull latest on $TSK_BRANCH" >>/dev/stderr - exit 1 +else + echo "Getting latest of Sleuthkit branch: $TSK_BRANCH..." + pushd $SLEUTHKIT_SRC_DIR && + git remote set-branches origin '*' && + git fetch -v && + git reset --hard && + git checkout $TSK_BRANCH && + git pull && + popd + if [[ $? -ne 0 ]]; then + echo "Unable to reset Sleuthkit repo and pull latest on $TSK_BRANCH" >>/dev/stderr + exit 1 + fi fi echo "Installing Sleuthkit..."