Was supposed to be a linux distribution, now just a collection of build scripts for packages on top of (ideally) any distribution.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

vcs_git() {
local branch=''
local OPTIND=1
local opt
while getopts 'b:' opt; do case "$opt" in
b) local branch="$OPTARG" ;;
esac; done
shift $((OPTIND-1))
[ "$1" = '--' ] && shift
local reponame="$(basename "$1")"
local dir="$dir_source/$name/$reponame"
mkdir -p "$dir"
if [ ! -d "$dir/.git" ]; then
# Clone new repo
git clone --recursive --depth=1 $([ "$branch" ] && echo "-b $branch") "$1" "$dir"
cd "$dir"
echo "$(git rev-parse @)" > "${dir}_rev_$_satname"
vcs_compile=true
else
cd "$dir"
if git fetch $([ "$branch" ] && echo "origin $branch") > /dev/null; then
git reset --hard FETCH_HEAD > /dev/null
fi
local rev="$(git rev-parse @)"
if [ "$rev" != "$(cat "${dir}_rev_$_satname" 2> /dev/null || true)" ]; then
echo "$rev" > "${dir}_rev_$_satname"
vcs_compile=true
fi
fi
version="$(git rev-list HEAD --count)_$(git rev-parse --short HEAD)"
cd "$OLDPWD"
getfile "$reponame"
}