Compare commits
10 commits
4e42e42950
...
aaecf00394
Author | SHA1 | Date | |
---|---|---|---|
aaecf00394 | |||
1c344e0c60 | |||
d54f37d3b6 | |||
03c858a73f | |||
137afd371d | |||
6092eff441 | |||
a9f8daac78 | |||
1218164c9a | |||
436e47f5e2 | |||
1943b94da4 |
11 changed files with 45 additions and 43 deletions
|
@ -10,9 +10,9 @@ branch=$2
|
|||
|
||||
##
|
||||
# functions
|
||||
gitexec()
|
||||
git()
|
||||
{
|
||||
"${libexec}"/utils/gitexec "${1}"
|
||||
"${libexec}"/utils/git "${@}"
|
||||
}
|
||||
|
||||
printok()
|
||||
|
@ -44,8 +44,7 @@ fi
|
|||
|
||||
set -x
|
||||
cd "${gitdir}"
|
||||
gitexec "fetch origin"
|
||||
gitexec "checkout ${branch}" ||
|
||||
gitexec "checkout -t origin/${branch}"
|
||||
git fetch origin
|
||||
git checkout "${branch}" || git checkout -t origin/"${branch}"
|
||||
set +x
|
||||
printok "${branch} checked out"
|
||||
|
|
|
@ -11,9 +11,9 @@ branch=$3
|
|||
|
||||
##
|
||||
# functions
|
||||
gitexec()
|
||||
git()
|
||||
{
|
||||
"${libexec}"/util/gitexec "${1}"
|
||||
"${libexec}"/utils/git "${@}"
|
||||
}
|
||||
|
||||
printok()
|
||||
|
@ -33,7 +33,7 @@ if [ "$(id -u)" = "0" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if ! "${libexec}"/utils/issourcezap-member > /dev/null >2&1; then
|
||||
if ! "${libexec}"/utils/issourcezap-member > /dev/null 2>&1; then
|
||||
printerr "$(id -un) is not a member of _sourcezap"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -44,9 +44,9 @@ if [ -e "${gitdir}/.git" ]; then
|
|||
fi
|
||||
|
||||
set -x
|
||||
gitexec "clone ${giturl} ${gitdir}"
|
||||
git clone "${giturl}" "${gitdir}"
|
||||
cd "${gitdir}"
|
||||
gitexec "config core.filemode off"
|
||||
gitexec "checkout -t origin/${branch}"
|
||||
git config core.filemode off
|
||||
git checkout -t origin/"${branch}"
|
||||
set +x
|
||||
printok "clone complete"
|
||||
|
|
|
@ -55,8 +55,7 @@ perform_install()
|
|||
! -name ".arclint" \
|
||||
! -name ".arcconfig" \
|
||||
-exec cp -Rpv {} "${installdir}" \;
|
||||
set -x
|
||||
chown -R root "${installdir}"
|
||||
chown -Rv root "${installdir}"
|
||||
}
|
||||
|
||||
run_install()
|
||||
|
@ -86,11 +85,11 @@ umask ${mode}
|
|||
cd "${gitdir}"
|
||||
run_install "-d" "${installdir}"
|
||||
chmod ${mode} "${installdir}"
|
||||
set +x
|
||||
if [ -e "${revfile}" ]; then
|
||||
perform_update
|
||||
else
|
||||
perform_install
|
||||
fi
|
||||
"${libexec}"/utils/git-rev "${gitdir}" > "${revfile}"
|
||||
set +x
|
||||
printok "install complete"
|
||||
|
|
|
@ -9,9 +9,9 @@ gitdir=$1
|
|||
|
||||
##
|
||||
# functions
|
||||
gitexec()
|
||||
git()
|
||||
{
|
||||
"${libexec}"/utils/gitexec "${1}"
|
||||
"${libexec}"/utils/git "${@}"
|
||||
}
|
||||
|
||||
printok()
|
||||
|
@ -44,7 +44,7 @@ fi
|
|||
|
||||
set -x
|
||||
cd "${gitdir}"
|
||||
branch=$(gitexec "branch --show-current")
|
||||
gitexec "pull --rebase origin ${branch}"
|
||||
branch=$(git "branch --show-current")
|
||||
git pull --rebase origin "${branch}"
|
||||
set +x
|
||||
printok "pull complete"
|
||||
|
|
|
@ -3,24 +3,20 @@ set -e
|
|||
|
||||
##
|
||||
# variables
|
||||
localbase=${LOCALBASE:-/usr/local}
|
||||
git="${localbase}"/bin/git
|
||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
||||
libexec="${localbase}"/libexec/sourcezap
|
||||
gitdir=$1
|
||||
commit=$2
|
||||
mode=u=rwX,g=rX,o=
|
||||
|
||||
##
|
||||
# functions
|
||||
gitexec()
|
||||
diff()
|
||||
{
|
||||
doas -n -u _sourcezap \
|
||||
/bin/sh -c "umask ${mode}; ${git} ${1}"
|
||||
"${libexec}"/utils/gitdiff ${@}
|
||||
}
|
||||
|
||||
##
|
||||
# main
|
||||
cd "${gitdir}"
|
||||
add=$(gitexec "diff --name-only --diff-filter=A ${commit} HEAD")
|
||||
mod=$(gitexec "diff --name-only --diff-filter=M ${commit} HEAD")
|
||||
echo "${add}"
|
||||
echo "${mod}"
|
||||
diff "--name-only" "--diff-filter=A" "${commit}" "HEAD"
|
||||
diff "--name-only" "--diff-filter=M" "${commit}" "HEAD"
|
||||
|
|
|
@ -3,21 +3,19 @@ set -e
|
|||
|
||||
##
|
||||
# variables
|
||||
localbase=${LOCALBASE:-/usr/local}
|
||||
git="${localbase}"/bin/git
|
||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
||||
libexec="${localbase}"/libexec/sourcezap
|
||||
gitdir=$1
|
||||
commit=$2
|
||||
mode=u=rwX,g=rX,o=
|
||||
|
||||
##
|
||||
# functions
|
||||
gitexec()
|
||||
diff()
|
||||
{
|
||||
doas -n -u _sourcezap \
|
||||
/bin/sh -c "umask ${mode}; ${git} ${1}"
|
||||
"${libexec}"/utils/gitdiff ${@}
|
||||
}
|
||||
|
||||
##
|
||||
# main
|
||||
cd "${gitdir}"
|
||||
gitexec "diff --name-only --diff-filter=D ${commit} HEAD"
|
||||
diff "--name-only" "--diff-filter=D" "${commit}" "HEAD"
|
||||
|
|
|
@ -3,19 +3,18 @@ set -e
|
|||
|
||||
##
|
||||
# variables
|
||||
git=/usr/local/bin/git
|
||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
||||
libexec="${localbase}"/libexec/sourcezap
|
||||
gitdir=$1
|
||||
mode=u=rwX,g=rX,o=
|
||||
|
||||
##
|
||||
# functions
|
||||
gitexec()
|
||||
git()
|
||||
{
|
||||
doas -n -u _sourcezap \
|
||||
/bin/sh -c "umask ${mode}; ${git} ${1}"
|
||||
"${libexec}"/utils/git "${1}"
|
||||
}
|
||||
|
||||
##
|
||||
# main
|
||||
cd "${gitdir}"
|
||||
gitexec "rev-parse HEAD"
|
||||
git rev-parse HEAD
|
||||
|
|
11
libexec/sourcezap/utils/gitdiff
Executable file
11
libexec/sourcezap/utils/gitdiff
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
##
|
||||
# variables
|
||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
||||
libexec="${localbase}"/libexec/sourcezap
|
||||
|
||||
##
|
||||
# main
|
||||
"${libexec}"/utils/git diff -l0 ${@}
|
|
@ -61,7 +61,7 @@ Default: https://git.HardenedBSD.org/HardenedBSD/HardenedBSD.git/
|
|||
.sp
|
||||
.Nm SOURCEZAP_INSTALLDIR
|
||||
.br
|
||||
The directory where the ports collection will be installed
|
||||
The directory where the source tree will be installed
|
||||
.br
|
||||
Default: /usr/src/
|
||||
.sp
|
||||
|
|
|
@ -1 +1 @@
|
|||
v0.1.0-dev
|
||||
v0.1.1
|
||||
|
|
Loading…
Reference in a new issue