Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sébastien Luttringer
infrastructure
Commits
3d5834b7
Verified
Commit
3d5834b7
authored
Apr 30, 2017
by
Jan Alexander Steffens (heftig)
Browse files
mkpkg: Change check_* to support sharing sources between packages
parent
016d1860
Changes
1
Hide whitespace changes
Inline
Side-by-side
roles/archbuild/files/mkpkg
View file @
3d5834b7
...
...
@@ -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
push
d
$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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment