From 6ae99dcc6b475ba92a5517f0f603a8e1fb5f32c5 Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Tue, 5 Sep 2017 10:35:29 -0700 Subject: [PATCH 1/2] tools/mkpkg/update_retroplayer-addons: use single branch --- tools/mkpkg/update_retroplayer-addons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mkpkg/update_retroplayer-addons b/tools/mkpkg/update_retroplayer-addons index 8e6eb52e50..9c00276a46 100755 --- a/tools/mkpkg/update_retroplayer-addons +++ b/tools/mkpkg/update_retroplayer-addons @@ -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" From fc4545dcc68608835833022c3d1459cd46117cce Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Tue, 5 Sep 2017 11:00:18 -0700 Subject: [PATCH 2/2] tools/repo-tool: add DEVICE support --- tools/repo-tool | 70 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 20 deletions(-) diff --git a/tools/repo-tool b/tools/repo-tool index 5b3e9ee0f3..867fd41a56 100755 --- a/tools/repo-tool +++ b/tools/repo-tool @@ -69,15 +69,29 @@ update_addons_xml() { touch_addons_xml() { for PROJECT in $(ls -1 projects); do - 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 - break - fi - if [ ! -f target/addons/$ADDON_VERSION/$PROJECT/$ARCH/addons.xml ]; then - touch target/addons/$ADDON_VERSION/$PROJECT/$ARCH/addons.xml - fi - done + 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 + break + fi + if [ ! -f target/addons/$ADDON_VERSION/$PROJECT/$ARCH/addons.xml ]; then + touch target/addons/$ADDON_VERSION/$PROJECT/$ARCH/addons.xml + fi + done + fi done } @@ -95,18 +109,27 @@ upload() { } build() { + [ -n "$3" ] && DEVICE="$3" || DEVICE="" + for PROJECT in $2; do - for archfile in projects/$PROJECT/linux/linux.*.conf ; do - ARCH=`echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p'` - 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 - fi - ) + 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 DEVICE=$DEVICE ARCH=$ARCH ./scripts/create_addon $ADDON + fi + ) done done } @@ -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