Compare commits
2 commits
d4a18461ca
...
d5770bc731
Author | SHA1 | Date | |
---|---|---|---|
d5770bc731 | |||
d33cd6628f |
9 changed files with 19 additions and 49 deletions
|
@ -12,7 +12,7 @@ branch=$2
|
|||
# functions
|
||||
git()
|
||||
{
|
||||
"${libexec}"/utils/git "${@}"
|
||||
"${libexec}"/utils/git/run "${@}"
|
||||
}
|
||||
|
||||
printok()
|
||||
|
@ -38,7 +38,7 @@ if ! "${libexec}"/utils/issourcezap-member > /dev/null 2>&1; then
|
|||
fi
|
||||
|
||||
if [ ! -e "${gitdir}/.git" ]; then
|
||||
printerr "try 'portzap clone' instead"
|
||||
printerr "try 'sourcezap clone' instead"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ branch=$3
|
|||
# functions
|
||||
git()
|
||||
{
|
||||
"${libexec}"/utils/git "${@}"
|
||||
"${libexec}"/utils/git/run "${@}"
|
||||
}
|
||||
|
||||
printok()
|
||||
|
@ -43,10 +43,8 @@ if [ -e "${gitdir}/.git" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
set -x
|
||||
git clone "${giturl}" "${gitdir}"
|
||||
cd "${gitdir}"
|
||||
git config core.filemode off
|
||||
git checkout -t origin/"${branch}"
|
||||
set +x
|
||||
printok "clone complete"
|
||||
|
|
|
@ -15,8 +15,8 @@ revfile=$3
|
|||
perform_update()
|
||||
{
|
||||
rev=$(cat "${revfile}")
|
||||
add=$("${libexec}"/utils/git-changed-files "${gitdir}" "${rev}")
|
||||
del=$("${libexec}"/utils/git-removed-files "${gitdir}" "${rev}")
|
||||
add=$("${libexec}"/utils/git/get-changed-files "${gitdir}" "${rev}")
|
||||
del=$("${libexec}"/utils/git/get-removed-files "${gitdir}" "${rev}")
|
||||
for file in ${del}; do
|
||||
target="${installdir}/${file}"
|
||||
parent=$(dirname "${target}")
|
||||
|
@ -63,6 +63,11 @@ run_install()
|
|||
install -o root -g _sourcezap -m "${mode}" -v "$@"
|
||||
}
|
||||
|
||||
git()
|
||||
{
|
||||
"${libexec}"/utils/git/run "${@}"
|
||||
}
|
||||
|
||||
printok()
|
||||
{
|
||||
"${libexec}"/utils/printok "${1}"
|
||||
|
@ -91,5 +96,5 @@ if [ -e "${revfile}" ]; then
|
|||
else
|
||||
perform_install
|
||||
fi
|
||||
"${libexec}"/utils/git-rev "${gitdir}" > "${revfile}"
|
||||
"${libexec}"/utils/git/run rev-parse HEAD > "${revfile}"
|
||||
printok "install complete"
|
||||
|
|
|
@ -11,7 +11,7 @@ gitdir=$1
|
|||
# functions
|
||||
git()
|
||||
{
|
||||
"${libexec}"/utils/git "${@}"
|
||||
"${libexec}"/utils/git/run "${@}"
|
||||
}
|
||||
|
||||
printok()
|
||||
|
@ -42,9 +42,7 @@ if [ ! -e "${gitdir}/.git" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
set -x
|
||||
cd "${gitdir}"
|
||||
branch=$(git branch --show-current)
|
||||
git pull --rebase origin "${branch}"
|
||||
set +x
|
||||
printok "pull complete"
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
##
|
||||
# variables
|
||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
||||
libexec="${localbase}"/libexec/sourcezap
|
||||
gitdir=$1
|
||||
|
||||
##
|
||||
# functions
|
||||
git()
|
||||
{
|
||||
"${libexec}"/utils/git "${1}"
|
||||
}
|
||||
|
||||
##
|
||||
# main
|
||||
cd "${gitdir}"
|
||||
git rev-parse HEAD
|
|
@ -10,13 +10,13 @@ commit=$2
|
|||
|
||||
##
|
||||
# functions
|
||||
diff()
|
||||
git()
|
||||
{
|
||||
"${libexec}"/utils/gitdiff ${@}
|
||||
"${libexec}"/utils/git/run "${@}"
|
||||
}
|
||||
|
||||
##
|
||||
# main
|
||||
cd "${gitdir}"
|
||||
diff "--name-only" "--diff-filter=A" "${commit}" "HEAD"
|
||||
diff "--name-only" "--diff-filter=M" "${commit}" "HEAD"
|
||||
git diff -l0 --name-only --diff-filter=A "${commit}" "HEAD"
|
||||
git diff -l0 --name-only --diff-filter=M "${commit}" "HEAD"
|
|
@ -10,12 +10,12 @@ commit=$2
|
|||
|
||||
##
|
||||
# functions
|
||||
diff()
|
||||
git()
|
||||
{
|
||||
"${libexec}"/utils/gitdiff ${@}
|
||||
"${libexec}"/utils/git/run "${@}"
|
||||
}
|
||||
|
||||
##
|
||||
# main
|
||||
cd "${gitdir}"
|
||||
diff "--name-only" "--diff-filter=D" "${commit}" "HEAD"
|
||||
git diff -l0 --name-only --diff-filter=D "${commit}" "HEAD"
|
|
@ -1,11 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
##
|
||||
# variables
|
||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
||||
libexec="${localbase}"/libexec/sourcezap
|
||||
|
||||
##
|
||||
# main
|
||||
"${libexec}"/utils/git diff -l0 ${@}
|
Loading…
Reference in a new issue