Skip to content
Snippets Groups Projects
Commit 46bffd11 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Better support for tags in macports

parent 47c40941
No related branches found
No related tags found
No related merge requests found
......@@ -8,16 +8,32 @@
# This would require a portfile that is based on a tag (e.g. v2.3.0),
# optionally including patches, that can be then uploaded to macports
hash=$( git log -1 --format="%h")
prefix=
if git describe --exact-match --tags HEAD 2>/dev/null 1>/dev/null
then
version=$(git describe --exact-match --tags HEAD)
case "$version" in
(v*)
version=${version#v}
prefix=v
esac
else
version=$( git log -1 --format="%h")
fi
if test -n "$plumed_repository" ; then
# get this from environment
repository="$plumed_repository"
else
# parent directory:
repository="${PWD%/*}"
fi
mkdir -p science/plumed
# parent directory:
repository="${PWD%/*}"
cat Portfile.in |
sed "
s/@_VERSION_@/$hash/
s/@_VERSION_@/$version/
s/@_REVISION_@/0/
" | awk '{
if($1=="@_FETCH_@"){
......@@ -25,7 +41,7 @@ sed "
print "git.url '$repository'"
# notice that if instead of hashtag we want to put a version, then it should be
# git.branch v${version}
print "git.branch ${version}"
print "git.branch '$prefix'${version}"
} else print
}' > science/plumed/Portfile
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment