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