Merge pull request #1951 from lrusak/script-updates

some minor script updates
This commit is contained in:
Christian Hewitt 2017-09-20 19:39:38 +04:00 committed by GitHub
commit ee5f8dabee
2 changed files with 51 additions and 21 deletions

View File

@ -21,7 +21,7 @@ git_clone() {
# git_clone https://repo.url branch ./target_dir [githash]
echo "[mkpkg] Checking out $1 ..."
if [ ! -d "$3" ]; then
git clone --recursive "$1" -b $2 "$3"
git clone --single-branch --depth=1 --recursive "$1" -b $2 "$3"
else
if [ -d "$3" ] ; then
cd "$3"

View File

@ -69,6 +69,19 @@ update_addons_xml() {
touch_addons_xml() {
for PROJECT in $(ls -1 projects); do
if [ -p "$projects/$PROJECT/devices" ]; then
for DEVICE in $(ls -1 projects/$PROJECT/devices); do
for archfile in projects/$PROJECT/devices/$DEVICE/linux/linux.*.conf; do
ARCH=`echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p'`
if [ ! -d target/addons/$ADDON_VERSION/$DEVICE/$ARCH ]; then
break
fi
if [ ! -f target/addons/$ADDON_VERSION/$DEVICE/$ARCH/addons.xml ]; then
touch target/addons/$ADDON_VERSION/$DEVICE/$ARCH/addons.xml
fi
done
done
else
for archfile in projects/$PROJECT/linux/linux.*.conf; do
ARCH=`echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p'`
if [ ! -d target/addons/$ADDON_VERSION/$PROJECT/$ARCH ]; then
@ -78,6 +91,7 @@ touch_addons_xml() {
touch target/addons/$ADDON_VERSION/$PROJECT/$ARCH/addons.xml
fi
done
fi
done
}
@ -95,20 +109,29 @@ upload() {
}
build() {
[ -n "$3" ] && DEVICE="$3" || DEVICE=""
for PROJECT in $2; do
if [ -n "$DEVICE" ]; then
for archfile in projects/$PROJECT/devices/$DEVICE/linux/linux.*.conf; do
ARCH=`echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p'`
done
else
for archfile in projects/$PROJECT/linux/linux.*.conf; do
ARCH=`echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p'`
done
fi
for package in $(find $1 -iname package.mk) ; do
(
. $package
if [ "$PKG_IS_ADDON" = "yes" ] ; then
ADDON=$PKG_NAME
PROJECT=$PROJECT ARCH=$ARCH ./scripts/create_addon $ADDON
PROJECT=$PROJECT DEVICE=$DEVICE ARCH=$ARCH ./scripts/create_addon $ADDON
fi
)
done
done
done
}
update_revision() {
@ -176,12 +199,19 @@ if [ "$1" = "-b" -o "$1" = "-ru" ]; then
if [ "$1" = "-b" ]; then
[ -n "$3" ] && project="$3" || project="$(ls -1 projects)"
if [ "$3" == "RPi" ]; then
project="RPi"
device="RPi"
elif [ "$3" == "RPi2" ]; then
project="RPi"
device="RPi2"
fi
fi
fi
case $1 in
-b)
build "$repo" "$project"
build "$repo" "$project" "$device"
;;
-u)
upload