1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 00:39:31 +08:00

Merge pull request #1370 from ipfs/update-sharness

Update sharness
This commit is contained in:
Juan Batiz-Benet
2015-06-13 15:59:33 -07:00
2 changed files with 31 additions and 10 deletions

View File

@ -35,8 +35,8 @@ aggregate: clean-test-results $(T)
deps: $(SHARNESS) $(BINS) curl deps: $(SHARNESS) $(BINS) curl
$(SHARNESS): $(SHARNESS): FORCE
@echo "*** installing $@ ***" @echo "*** checking $@ ***"
lib/install-sharness.sh lib/install-sharness.sh
bin/%: FORCE bin/%: FORCE

View File

@ -6,21 +6,42 @@
# #
# settings # settings
version=50229a79ba22b2f13ccd82451d86570fecbd194c version=5eee9b51b5621cec95a64018f0cc779963b230d2
urlprefix=https://github.com/mlafeldt/sharness.git urlprefix=https://github.com/mlafeldt/sharness.git
clonedir=lib clonedir=lib
sharnessdir=sharness sharnessdir=sharness
if test -f "$clonedir/$sharnessdir/SHARNESS_VERSION_$version"
then
# There is the right version file. Great, we are done!
exit 0
fi
die() { die() {
echo >&2 "$@" echo >&2 "$@"
exit 1 exit 1
} }
mkdir -p "$clonedir" || die "Could not create '$clonedir' directory" checkout_version() {
cd "$clonedir" || die "Could not cd into '$clonedir' directory" git checkout "$version" || die "Could not checkout '$version'"
rm -f SHARNESS_VERSION_* || die "Could not remove 'SHARNESS_VERSION_*'"
touch "SHARNESS_VERSION_$version" || die "Could not create 'SHARNESS_VERSION_$version'"
echo "Sharness version $version is checked out!"
}
git clone "$urlprefix" || die "Could not clone '$urlprefix'" if test -d "$clonedir/$sharnessdir/.git"
cd "$sharnessdir" || die "Could not cd into '$sharnessdir' directory" then
git checkout "$version" || die "Could not checkout '$version'" # We need to update sharness!
cd "$clonedir/$sharnessdir" || die "Could not cd into '$clonedir/$sharnessdir' directory"
git fetch || die "Could not fetch to update sharness"
checkout_version
else
# We need to clone sharness!
mkdir -p "$clonedir" || die "Could not create '$clonedir' directory"
cd "$clonedir" || die "Could not cd into '$clonedir' directory"
git clone "$urlprefix" || die "Could not clone '$urlprefix'"
cd "$sharnessdir" || die "Could not cd into '$sharnessdir' directory"
checkout_version
fi
exit 0 exit 0