forked from freifunk-franken/firmware
buildscript: do not overwrite build directory on prepare
So far, we remove the old and copy a fresh new OpenWrt directory into the build directory on prepare. There is no need to do this, as OpenWrt/Make is capable of detecting changes and we do properly update the feeds and patches already. So, just clone the OpenWrt main repo into builddir directly, and just checkout/apply patches during prepare. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Reviewed-by: Fabian Bläse <fabian@blaese.de>
This commit is contained in:
parent
ec0586bdf6
commit
0c83c0e820
23
buildscript
23
buildscript
|
@ -64,7 +64,10 @@ checkout_git(){
|
||||||
if [ -d "$DIRECTORY" ]; then
|
if [ -d "$DIRECTORY" ]; then
|
||||||
if $MYGIT remote -v | grep -q "$REPO_URL" ; then
|
if $MYGIT remote -v | grep -q "$REPO_URL" ; then
|
||||||
echo "Right remote detected"
|
echo "Right remote detected"
|
||||||
if ! $MYGIT checkout "$COMMITID" ; then
|
# Remove untracked files
|
||||||
|
$MYGIT clean -f -d
|
||||||
|
# Select desired commit and remove local changes (-f)
|
||||||
|
if ! $MYGIT checkout -f "$COMMITID" ; then
|
||||||
echo "commitid not found trying to fetch new commits"
|
echo "commitid not found trying to fetch new commits"
|
||||||
$MYGIT pull && $MYGIT checkout "$COMMITID"
|
$MYGIT pull && $MYGIT checkout "$COMMITID"
|
||||||
fi
|
fi
|
||||||
|
@ -84,14 +87,11 @@ checkout_git(){
|
||||||
}
|
}
|
||||||
|
|
||||||
get_source() {
|
get_source() {
|
||||||
test -d src || mkdir src
|
#Get the OpenWrt main repo
|
||||||
cd src
|
checkout_git $builddir $OPENWRTURL $OPENWRTREV
|
||||||
|
|
||||||
#Get the OpenWrt Core Source for Firmware
|
test -d src/packages || mkdir -p src/packages
|
||||||
checkout_git openwrt $OPENWRTURL $OPENWRTREV
|
cd src/packages
|
||||||
|
|
||||||
test -d packages || mkdir packages
|
|
||||||
cd packages
|
|
||||||
|
|
||||||
#checkout needed package feeds
|
#checkout needed package feeds
|
||||||
for FEEDVAR in "${FEEDS[@]}" ; do
|
for FEEDVAR in "${FEEDS[@]}" ; do
|
||||||
|
@ -131,11 +131,6 @@ patch_target() {
|
||||||
prepare() {
|
prepare() {
|
||||||
get_source
|
get_source
|
||||||
|
|
||||||
test -d $builddir || mkdir $builddir
|
|
||||||
|
|
||||||
/bin/rm -rf "$builddir"
|
|
||||||
cp -a src/openwrt "$builddir"
|
|
||||||
|
|
||||||
patch_target
|
patch_target
|
||||||
|
|
||||||
# apply variant to ensure the included file "variant.mk"
|
# apply variant to ensure the included file "variant.mk"
|
||||||
|
@ -344,7 +339,7 @@ buildrelease() {
|
||||||
}
|
}
|
||||||
|
|
||||||
clean() {
|
clean() {
|
||||||
/bin/rm -rf bin $builddir src/openwrt
|
/bin/rm -rf bin $builddir
|
||||||
|
|
||||||
# remove downloaded package feeds
|
# remove downloaded package feeds
|
||||||
for FEEDVAR in "${FEEDS[@]}" ; do
|
for FEEDVAR in "${FEEDS[@]}" ; do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user