Skip to content
Snippets Groups Projects
Verified Commit 3d5834b7 authored by Jan Alexander Steffens (heftig)'s avatar Jan Alexander Steffens (heftig)
Browse files

mkpkg: Change check_* to support sharing sources between packages

parent 016d1860
No related branches found
No related tags found
No related merge requests found
......@@ -100,53 +100,39 @@ usage2() {
echo 'The primary use of this script is running it from cron to build nightlies.'
}
check_bzr() {
local oldver
if [[ -d $srcdest/$1 && $check == 1 ]]; then
pushd $srcdest/$1
oldver=$(bzr revno)
bzr pull &>/dev/null || :
[[ $oldver == $(bzr revno) ]] && exit 0
popd
fi
}
check_bzr() (
[[ -d $srcdest/$1 ]] || return 0
check_git() {
local oldver
cd $srcdest/$1
bzr pull &>/dev/null || :
echo $0 $* $(bzr revno) >> $checkfile
)
if [[ -d $srcdest/$1 && $check == 1 ]]; then
pushd $srcdest/$1
oldver=$(git rev-parse ${2:-HEAD})
git fetch --all -p &>/dev/null || :
[[ $oldver == $(git rev-parse ${2:-HEAD}) ]] && exit 0
popd
fi
}
check_git() (
[[ -d $srcdest/$1 ]] || return 0
: ${2:=HEAD}
check_hg() {
local oldver
cd $srcdest/$1
git fetch --all -p &>/dev/null || :
echo $0 $* $(git rev-parse $2) >> $checkfile
)
if [[ -d $srcdest/$1 && $check == 1 ]]; then
pushd $srcdest/$1
oldver=$(hg id -ir ${2:-tip})
hg pull &>/dev/null || :
[[ $oldver == $(hg id -ir ${2:-tip}) ]] && exit 0
popd
fi
}
check_hg() (
[[ -d $srcdest/$1 ]] || return 0
: ${2:=tip}
cd $srcdest/$1
hg pull &>/dev/null || :
echo $0 $* $(hg id -ir $2) >> $checkfile
)
check_svn() {
local oldver
check_svn() (
[[ -d $srcdest/$1 ]] || return 0
if [[ -d $srcdest/$1 && $check == 1 ]]; then
pushd $srcdest/$1
oldver=$(svnversion)
svn up &>/dev/null || :
[[ $oldver == $(svnversion) ]] && exit 0
popd
fi
}
cd $srcdest/$1
svn up &>/dev/null || :
echo $0 $* $(svnversion) >> $checkfile
)
build() {
[[ $chroot == multilib* ]] && 1=
......@@ -212,8 +198,20 @@ build_and_add() {
mkpkg_one() (
cd $package
checkfile=$PWD/.mkpkg_check.$$
source MKPKG
if [[ ! -s $checkfile ]]; then
rm -f $checkfile
elif [[ $check == 1 ]] && diff -q .mkpkg_check $checkfile &>/dev/null; then
rm -f $checkfile
exit 0
else
mv -f $checkfile .mkpkg_check
fi
if [[ -z $pkgname ]]; then
echo "$0:$LINENO: no pkgnames found for '$package'" >&2
echo "Please set \$pkgname in $PWD/MKPKG" >&2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment