ARCH=
WORD=
GIT_PROTOCOL=${GIT_PROTOCOL:="git"}
-GIT_URL=${GIT_URL:=$GIT_PROTOCOL"://factorcode.org/git/factor.git"}
+GIT_URL=${GIT_URL:=$GIT_PROTOCOL"://github.com/factor/factor.git"}
SCRIPT_ARGS="$*"
REQUIRE_CLANG_VERSION=3.1
}
git_clone() {
- $ECHO "Downloading the git repository from factorcode.org..."
+ $ECHO "Downloading the git repository from github.com..."
invoke_git clone $GIT_URL
}
invoke_git diff --stat "$(invoke_git merge-base HEAD FETCH_HEAD)" FETCH_HEAD | grep 'build\.sh' >/dev/null
}
-git_fetch_factorcode() {
- $ECHO "Fetching the git repository from factorcode.org..."
+git_fetch() {
+ $ECHO "Fetching the git repository from github.com..."
+ branch=$(current_git_branch)
rm -f "$(update_script_name)"
- invoke_git fetch "$GIT_URL" master
+ $ECHO git fetch "$GIT_URL" "$branch"
+ invoke_git fetch "$GIT_URL" "$branch"
if update_script_changed; then
$ECHO "Updating and restarting the build.sh script..."
}
current_git_branch() {
- git rev-parse --abbrev-ref HEAD
+ # git rev-parse --abbrev-ref HEAD # outputs HEAD for detached head
+ # outputs nothing for detached HEAD, which is fine for ``git fetch``
+ git describe --all --exact-match 2>/dev/null | sed 's=.*/=='
}
check_url() {
$ECHO "Factorcode md5: $factorcode_md5";
$ECHO "Disk md5: $disk_md5";
if [[ "$factorcode_md5" == "$disk_md5" ]] ; then
- $ECHO "Your disk boot image matches the one on factorcode.org."
+ $ECHO "Your disk boot image matches the one on downloads.factorcode.org."
else
$DELETE $BOOT_IMAGE > /dev/null 2>&1
get_boot_image
update() {
get_config_info
- git_fetch_factorcode
+ git_fetch
backup_factor
make_clean_factor
}
fi
if [ "$#" -gt 3 ]; then
- usage
+ usage
$ECHO "error: too many arguments"
exit 1
fi