cleanup scripts: tools/

This commit is contained in:
CvH 2024-07-06 11:24:18 +02:00
parent 52d0bad764
commit 7f543e3c98
25 changed files with 350 additions and 338 deletions

View File

@ -10,8 +10,7 @@ fi
DEPTH=1000 DEPTH=1000
usage() usage() {
{
local me="$(basename $0)" local me="$(basename $0)"
echo "Usage: ${me} <popcornmix-branch> <sha>|<xbmc branch>" echo "Usage: ${me} <popcornmix-branch> <sha>|<xbmc branch>"

View File

@ -12,5 +12,5 @@ for COMMIT in $DROP_COMMITS; do
sed -i -E "s/^pick ([0-9a-f]+) (${COMMIT}.*)/drop \1 \2/g" $TODO sed -i -E "s/^pick ([0-9a-f]+) (${COMMIT}.*)/drop \1 \2/g" $TODO
done done
grep -E "^drop " $TODO > /tmp/dropped grep -E "^drop " $TODO >/tmp/dropped
sed -i -E "/^drop /d" $TODO sed -i -E "/^drop /d" $TODO

View File

@ -59,11 +59,11 @@ OPTION=$(whiptail --title "Update ADDON-VERSION" --menu "" 12 60 4 \
"3" "Exit" 3>&1 1>&2 2>&3) "3" "Exit" 3>&1 1>&2 2>&3)
case $OPTION in case $OPTION in
"1") "1")
update_addon_version update_addon_version
update_package update_package
;; ;;
"2") "2")
BUMP_ADDON_VERSION=$(whiptail --inputbox "Enter ADDON-VERSION:" 10 25 ${DISTRO_ADDON_VERSION} 3>&1 1>&2 2>&3) BUMP_ADDON_VERSION=$(whiptail --inputbox "Enter ADDON-VERSION:" 10 25 ${DISTRO_ADDON_VERSION} 3>&1 1>&2 2>&3)
EXITSTATUS=$? EXITSTATUS=$?
if [ $EXITSTATUS = 0 ]; then if [ $EXITSTATUS = 0 ]; then
@ -73,7 +73,7 @@ case $OPTION in
exit exit
fi fi
;; ;;
"3") "3")
exit exit
;; ;;
esac esac

View File

@ -32,7 +32,7 @@ if [ -f "${DISTRO_DIR}/${DISTRO}/kernel_options" ]; then
$PKG_BUILD/scripts/config --file $PKG_KERNEL_CFG_FILE --set-str ${OPTION%%=*} $(echo ${OPTION##*=} | tr -d '"') $PKG_BUILD/scripts/config --file $PKG_KERNEL_CFG_FILE --set-str ${OPTION%%=*} $(echo ${OPTION##*=} | tr -d '"')
fi fi
done < ${DISTRO_DIR}/${DISTRO}/kernel_options done <${DISTRO_DIR}/${DISTRO}/kernel_options
else else
echo "kernel options file doesn't exist: ${DISTRO_DIR}/${DISTRO}/kernel_options" echo "kernel options file doesn't exist: ${DISTRO_DIR}/${DISTRO}/kernel_options"
fi fi

View File

@ -37,12 +37,25 @@ USING_FILTER="no"
while getopts "f:cvSh" opt; do while getopts "f:cvSh" opt; do
case ${opt} in case ${opt} in
f) FILTER="${OPTARG}"; USING_FILTER="yes";; f)
c) RMPROGRESS="yes";; FILTER="${OPTARG}"
v) VERBOSE="yes";; USING_FILTER="yes"
S) SHOW_SKIPPED="yes";; ;;
h) usage;; c)
*) usage;; RMPROGRESS="yes"
;;
v)
VERBOSE="yes"
;;
S)
SHOW_SKIPPED="yes"
;;
h)
usage
;;
*)
usage
;;
esac esac
done done
@ -59,7 +72,10 @@ SKIPPED="$(cut -d' ' -f1 ${RESTART_FILE} 2>/dev/null | sort -u | wc -l || true)"
[ "${USING_FILTER}" = "no" -a "${SKIPPED:-0}" -ne 0 ] && echo -e "WARNING: skipping ${SKIPPED} packages.\n" >&2 [ "${USING_FILTER}" = "no" -a "${SKIPPED:-0}" -ne 0 ] && echo -e "WARNING: skipping ${SKIPPED} packages.\n" >&2
for pkg_name in $(get_all_package_names | grep -E "${FILTER}"); do for pkg_name in $(get_all_package_names | grep -E "${FILTER}"); do
stamp=$(source_package ${pkg_name}; calculate_stamp) stamp=$(
source_package ${pkg_name}
calculate_stamp
)
if [ -z "${stamp}" ]; then if [ -z "${stamp}" ]; then
[ "${SHOW_SKIPPED}" = "yes" ] && printf "Checking: %-40s IGNORED\n" "${pkg_name}" [ "${SHOW_SKIPPED}" = "yes" ] && printf "Checking: %-40s IGNORED\n" "${pkg_name}"
continue continue

View File

@ -854,7 +854,7 @@ generate_work_worker() {
echo " \"${var}\": \"${!var}\"${comma}" >>${workfile_o} echo " \"${var}\": \"${!var}\"${comma}" >>${workfile_o}
done done
echo " }," >>${workfile_o} echo " }," >>${workfile_o}
done < ${workfile_i} done <${workfile_i}
) )
} }
@ -909,17 +909,17 @@ get_packages() {
} }
init_progress() { init_progress() {
echo 0 > ${LOCKFILE} echo 0 >${LOCKFILE}
} }
progress() { progress() {
local count local count
( (
flock -x 9 flock -x 9
count=$(($(< ${LOCKFILE}) + 1)) count=$(($(<${LOCKFILE}) + 1))
echo "${count}" >${LOCKFILE} echo "${count}" >${LOCKFILE}
printf "Generating workload... %3d%% (%d of %d)\r" $((count * 100 / $1)) ${count} $1 >&2 printf "Generating workload... %3d%% (%d of %d)\r" $((count * 100 / $1)) ${count} $1 >&2
) 9< "${LOCKFILE}" ) 9<"${LOCKFILE}"
} }
end_progress() { end_progress() {
@ -939,43 +939,43 @@ exec_worker_prog() {
while [ : ]; do while [ : ]; do
[ -z "$1" ] && break [ -z "$1" ] && break
case $1 in case $1 in
-d|--download) -d | --download)
shift shift
DOWNLOAD_DIR=$1 DOWNLOAD_DIR=$1
;; ;;
-l|--libreelec) -l | --libreelec)
shift shift
LIBREELEC_DIR=$1 LIBREELEC_DIR=$1
;; ;;
-t|--target) -t | --target)
shift shift
TARGET_DIR=$1 TARGET_DIR=$1
;; ;;
-a|--all) -a | --all)
IGNORE_ERRORS=yes IGNORE_ERRORS=yes
;; ;;
-p|--package) -p | --package)
shift shift
PACKAGE=$1 PACKAGE=$1
;; ;;
-r|--revision) -r | --revision)
shift shift
REVISION=$1 REVISION=$1
;; ;;
-m|--mirror) -m | --mirror)
IS_MIRROR=yes IS_MIRROR=yes
;; ;;
-s|--source) -s | --source)
IS_MIRROR=no IS_MIRROR=no
;; ;;
--dry-run|--dryrun) --dry-run | --dryrun)
DRY_RUN=yes DRY_RUN=yes
LINE_PREFIX="**DRY-RUN** " LINE_PREFIX="**DRY-RUN** "
;; ;;
--git) --git)
DOGIT=yes DOGIT=yes
;; ;;
-n|--notnewer) -n | --notnewer)
CHECK_NEWER=no CHECK_NEWER=no
;; ;;
--check-ver) --check-ver)
@ -990,19 +990,19 @@ while [ : ]; do
--check-main) --check-main)
CHECK_FILTER_CLASS=Main CHECK_FILTER_CLASS=Main
;; ;;
-T|--threads) -T | --threads)
shift shift
[ $1 -gt 0 ] && WORKER_THREADS=$1 [ $1 -gt 0 ] && WORKER_THREADS=$1
;; ;;
-U|--gituser) -U | --gituser)
shift shift
GIT_USERNAME=$1 GIT_USERNAME=$1
;; ;;
-P|--gitpass) -P | --gitpass)
shift shift
GIT_PASSWORD=$1 GIT_PASSWORD=$1
;; ;;
-v|--verbose) -v | --verbose)
VERBOSE=$((VERBOSE + 1)) VERBOSE=$((VERBOSE + 1))
;; ;;
--no-progress) --no-progress)
@ -1015,7 +1015,7 @@ while [ : ]; do
--verify-checksum) --verify-checksum)
VERIFY_CHECKSUM=yes VERIFY_CHECKSUM=yes
;; ;;
-h|--help) -h | --help)
help help
exit 0 exit 0
;; ;;

View File

@ -25,9 +25,8 @@ BUILD_SOURCES="false"
REPLACE_OLD="false" REPLACE_OLD="false"
NEW_SOURCES="${NEW_SOURCES_DIR:-${SOURCES}.new}" NEW_SOURCES="${NEW_SOURCES_DIR:-${SOURCES}.new}"
# helper functions # helper functions
help(){ help() {
echo "Usage: ${0} [-hdfbr]" echo "Usage: ${0} [-hdfbr]"
echo "Set PROJECT, DEVICE and ARCH as required." echo "Set PROJECT, DEVICE and ARCH as required."
echo " -h this help" echo " -h this help"
@ -37,7 +36,6 @@ help(){
echo " -r replace old SOURCES when rebuilding (default: no)" echo " -r replace old SOURCES when rebuilding (default: no)"
} }
# command line opts # command line opts
while getopts hdfrb OPT; do while getopts hdfrb OPT; do
case "${OPT}" in case "${OPT}" in
@ -65,8 +63,7 @@ while getopts hdfrb OPT; do
esac esac
done done
shift $((${OPTIND}-1)) shift $((${OPTIND} - 1))
# sanity checking # sanity checking
if [ ! -d "${SOURCES}" ]; then if [ ! -d "${SOURCES}" ]; then
@ -75,7 +72,6 @@ elif [ "${DESTRUCTIVE_RUN}" = "true" -a "${BUILD_SOURCES}" = "true" ]; then
die "error: options '-d' and '-b' are mutually exclusive" die "error: options '-d' and '-b' are mutually exclusive"
fi fi
# main # main
# process files in SOURCES # process files in SOURCES
for SOURCE_PACKAGE in $(find "${SOURCES}/" -mindepth 1 -type d); do for SOURCE_PACKAGE in $(find "${SOURCES}/" -mindepth 1 -type d); do

View File

@ -15,17 +15,18 @@ help() {
} }
case $1 in case $1 in
-a|--all) -a | --all)
ALL_PACKAGES="true" ALL_PACKAGES="true"
;; ;;
-h|--help) -h | --help)
help help
exit 0 exit 0
;;
esac esac
for package in $(find packages/ -name package.mk); do for package in $(find packages/ -name package.mk); do
if [ -n "$(echo $package | grep addons)" -a -z "$ALL_PACKAGES" ]; then if [ -n "$(echo $package | grep addons)" -a -z "$ALL_PACKAGES" ]; then
continue continue
fi fi
./scripts/get $(basename `dirname $package`) ./scripts/get $(basename $(dirname $package))
done done

View File

@ -13,7 +13,10 @@ if [ $# -eq 0 ]; then
fi fi
FFMPEG_ROOT="$(pwd)" FFMPEG_ROOT="$(pwd)"
LE_ROOT="$(cd $(dirname $0)/../.. ; pwd)" LE_ROOT="$(
cd $(dirname $0)/../..
pwd
)"
create_patch() { create_patch() {
FEATURE_SET="$1" FEATURE_SET="$1"
@ -25,7 +28,7 @@ create_patch() {
PATCH_CREATE_DIFF="no" PATCH_CREATE_DIFF="no"
case "${FEATURE_SET}" in case "${FEATURE_SET}" in
v4l2-drmprime|v4l2-request|vf-deinterlace-v4l2m2m) v4l2-drmprime | v4l2-request | vf-deinterlace-v4l2m2m)
REPO="https://github.com/jernejsk/FFmpeg" REPO="https://github.com/jernejsk/FFmpeg"
REFSPEC="${FEATURE_SET}-${FFMPEG_VERSION}" REFSPEC="${FEATURE_SET}-${FFMPEG_VERSION}"
;; ;;
@ -67,14 +70,14 @@ create_patch() {
if [ "${PATCH_CREATE_DIFF}" = "yes" ]; then if [ "${PATCH_CREATE_DIFF}" = "yes" ]; then
# create diff in case format-patch doesn't work, eg when we have non-linear history # create diff in case format-patch doesn't work, eg when we have non-linear history
git diff "${BASE_REV}..${REV}" > "${LE_ROOT}/${PATCH_FILE}" git diff "${BASE_REV}..${REV}" >"${LE_ROOT}/${PATCH_FILE}"
else else
git format-patch --stdout --no-signature "${BASE_REV}..${REV}" > "${LE_ROOT}/${PATCH_FILE}" git format-patch --stdout --no-signature "${BASE_REV}..${REV}" >"${LE_ROOT}/${PATCH_FILE}"
fi fi
MSG=$(mktemp) MSG=$(mktemp)
cat << EOF > "${MSG}" cat <<EOF >"${MSG}"
ffmpeg: ${ACTION} ${FEATURE_SET} patch ffmpeg: ${ACTION} ${FEATURE_SET} patch
Patch created using revisions ${BASE_REV:0:7}..${REV:0:7} Patch created using revisions ${BASE_REV:0:7}..${REV:0:7}

View File

@ -7,27 +7,27 @@
GIT_DIR="raspberrypi-firmware.git" GIT_DIR="raspberrypi-firmware.git"
echo "getting sources..." echo "getting sources..."
if [ ! -d "${GIT_DIR}" ]; then if [ ! -d "${GIT_DIR}" ]; then
git clone https://github.com/raspberrypi/firmware.git --depth=1 -b master "${GIT_DIR}" git clone https://github.com/raspberrypi/firmware.git --depth=1 -b master "${GIT_DIR}"
fi fi
cd "${GIT_DIR}" cd "${GIT_DIR}"
git fetch git fetch
if [ $# -eq 1 ]; then if [ $# -eq 1 ]; then
git checkout "$1" git checkout "$1"
else else
git checkout origin/master git checkout origin/master
fi fi
GIT_REV=$(git log -n1 --format=%H) GIT_REV=$(git log -n1 --format=%H)
cd .. cd ..
BOOT_DIR="${GIT_DIR}/boot" BOOT_DIR="${GIT_DIR}/boot"
PKG_DIR="bcm2835-bootloader-${GIT_REV}" PKG_DIR="bcm2835-bootloader-${GIT_REV}"
echo "copying sources..." echo "copying sources..."
rm -rf "${PKG_DIR}" rm -rf "${PKG_DIR}"
mkdir -p "${PKG_DIR}" mkdir -p "${PKG_DIR}"
cp \ cp \
"${BOOT_DIR}"/LICENCE* \ "${BOOT_DIR}"/LICENCE* \
"${BOOT_DIR}"/bootcode.bin \ "${BOOT_DIR}"/bootcode.bin \
"${BOOT_DIR}"/fixup*.dat \ "${BOOT_DIR}"/fixup*.dat \
@ -35,7 +35,7 @@ echo "copying sources..."
"${PKG_DIR}" "${PKG_DIR}"
echo "packing sources..." echo "packing sources..."
tar cvJf "${PKG_DIR}.tar.xz" "${PKG_DIR}" tar cvJf "${PKG_DIR}.tar.xz" "${PKG_DIR}"
echo "remove temporary sourcedir..." echo "remove temporary sourcedir..."
rm -rf "${PKG_DIR}" rm -rf "${PKG_DIR}"

View File

@ -4,23 +4,23 @@
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) # Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
echo "getting sources..." echo "getting sources..."
svn checkout http://boblight.googlecode.com/svn/trunk/ boblightd-latest svn checkout http://boblight.googlecode.com/svn/trunk/ boblightd-latest
echo "getting version..." echo "getting version..."
cd boblightd-latest cd boblightd-latest
SVN_REV=`LANG=C svn info 2>/dev/null | grep Revision: | sed -e 's/.*\: //'` SVN_REV=$(LANG=C svn info 2>/dev/null | grep Revision: | sed -e 's/.*\: //')
echo $SVN_REV echo $SVN_REV
cd .. cd ..
echo "copying sources..." echo "copying sources..."
rm -rf boblightd-$SVN_REV rm -rf boblightd-$SVN_REV
cp -R boblightd-latest boblightd-$SVN_REV cp -R boblightd-latest boblightd-$SVN_REV
#echo "cleaning sources..." #echo "cleaning sources..."
find boblightd-$SVN_REV -name ".svn" -exec rm -rf {} \; 2>/dev/null find boblightd-$SVN_REV -name ".svn" -exec rm -rf {} \; 2>/dev/null
echo "packing sources..." echo "packing sources..."
tar cvJf boblightd-$SVN_REV.tar.xz boblightd-$SVN_REV tar cvJf boblightd-$SVN_REV.tar.xz boblightd-$SVN_REV
echo "remove temporary sourcedir..." echo "remove temporary sourcedir..."
rm -rf boblightd-$SVN_REV rm -rf boblightd-$SVN_REV

View File

@ -5,24 +5,24 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
echo "getting sources..." echo "getting sources..."
if [ ! -d libcec.git ]; then if [ ! -d libcec.git ]; then
git clone --depth=1 https://github.com/Pulse-Eight/libcec.git libcec.git git clone --depth=1 https://github.com/Pulse-Eight/libcec.git libcec.git
fi fi
cd libcec.git cd libcec.git
git pull git pull
GIT_REV=`git log -n1 --format=%H` GIT_REV=$(git log -n1 --format=%H)
cd .. cd ..
echo "copying sources..." echo "copying sources..."
rm -rf libcec-$GIT_REV rm -rf libcec-$GIT_REV
cp -R libcec.git libcec-$GIT_REV cp -R libcec.git libcec-$GIT_REV
echo "cleaning sources..." echo "cleaning sources..."
rm -rf libcec-$GIT_REV/.git rm -rf libcec-$GIT_REV/.git
echo "packing sources..." echo "packing sources..."
tar cvJf libcec-$GIT_REV.tar.xz libcec-$GIT_REV tar cvJf libcec-$GIT_REV.tar.xz libcec-$GIT_REV
echo "remove temporary sourcedir..." echo "remove temporary sourcedir..."
rm -rf libcec-$GIT_REV rm -rf libcec-$GIT_REV

View File

@ -30,23 +30,23 @@ fi
#get log #get log
cd media_build/ cd media_build/
git pull git pull
git checkout $MEDIA_BUILD_HASH git checkout $MEDIA_BUILD_HASH
GIT_LOG_MEDIA_BUILD=`git log --pretty=oneline -n1` GIT_LOG_MEDIA_BUILD=$(git log --pretty=oneline -n1)
cd $DVB_MKPKG_FOLDER/ cd $DVB_MKPKG_FOLDER/
# media_tree dl # media_tree dl
echo "getting sources ..." echo "getting sources ..."
if [ ! -d linux_media.git ]; then if [ ! -d linux_media.git ]; then
git clone --depth=1 https://bitbucket.org/CrazyCat/linux_media.git -b latest media_tree git clone --depth=1 https://bitbucket.org/CrazyCat/linux_media.git -b latest media_tree
fi fi
#get log #get log
cd media_tree/ cd media_tree/
git pull git pull
GIT_LOG_MEDIA_TREE=`git log --pretty=oneline -n1` GIT_LOG_MEDIA_TREE=$(git log --pretty=oneline -n1)
GIT_REV=`git log -n1 --pretty=format:"%ad" --date=short` GIT_REV=$(git log -n1 --pretty=format:"%ad" --date=short)
cd $DVB_MKPKG_FOLDER/ cd $DVB_MKPKG_FOLDER/
@ -64,7 +64,7 @@ rm -rf media_tree/
rm -rf media_build/.git/ rm -rf media_build/.git/
# log used versions into LE_versions # log used versions into LE_versions
echo "package include: \n\nmedia_build:\n$GIT_LOG_MEDIA_BUILD \n\nmedia_tree:\n$GIT_LOG_MEDIA_TREE \n" > media_build/LE_versions echo "package include: \n\nmedia_build:\n$GIT_LOG_MEDIA_BUILD \n\nmedia_tree:\n$GIT_LOG_MEDIA_TREE \n" >media_build/LE_versions
# rename buildfolder # rename buildfolder
mv media_build/ media_build-$GIT_REV/ mv media_build/ media_build-$GIT_REV/

View File

@ -50,30 +50,30 @@ fi
#get log #get log
cd media_build/ cd media_build/
git pull git pull
git checkout $MEDIA_BUILD_HASH git checkout $MEDIA_BUILD_HASH
GIT_LOG_MEDIA_BUILD=`git log --pretty=oneline -n1` GIT_LOG_MEDIA_BUILD=$(git log --pretty=oneline -n1)
cd $DVB_MKPKG_FOLDER/ cd $DVB_MKPKG_FOLDER/
# media_tree dl # media_tree dl
echo "getting sources ..." echo "getting sources ..."
if [ ! -d linux_media.git ]; then if [ ! -d linux_media.git ]; then
git clone --depth=1 $MEDIA_TREE_URL -b $MEDIA_TREE_BRANCH media_tree git clone --depth=1 $MEDIA_TREE_URL -b $MEDIA_TREE_BRANCH media_tree
fi fi
#get log #get log
cd media_tree/ cd media_tree/
git pull git pull
GIT_LOG_MEDIA_TREE=`git log --pretty=oneline -n1` GIT_LOG_MEDIA_TREE=$(git log --pretty=oneline -n1)
GIT_REV=`git log -n1 --pretty=format:"%ad" --date=short` GIT_REV=$(git log -n1 --pretty=format:"%ad" --date=short)
# hack/workaround for borked upstream kernel/media_build # hack/workaround for borked upstream kernel/media_build
# without removing atomisp there a lot additional includes that # without removing atomisp there a lot additional includes that
# slowdown build process after modpost from 3min to 6min # slowdown build process after modpost from 3min to 6min
# even if atomisp is disabled via kernel.conf # even if atomisp is disabled via kernel.conf
rm -rf drivers/staging/media/atomisp rm -rf drivers/staging/media/atomisp
sed -i 's|^.*drivers/staging/media/atomisp.*$||' $DVB_MKPKG_FOLDER/media_tree/drivers/staging/media/Kconfig sed -i 's|^.*drivers/staging/media/atomisp.*$||' $DVB_MKPKG_FOLDER/media_tree/drivers/staging/media/Kconfig
cd $DVB_MKPKG_FOLDER/ cd $DVB_MKPKG_FOLDER/
@ -101,7 +101,7 @@ media_build url: $MEDIA_BUILD_URL
media_tree commit: $GIT_LOG_MEDIA_TREE media_tree commit: $GIT_LOG_MEDIA_TREE
media_tree url: $MEDIA_TREE_URL media_tree url: $MEDIA_TREE_URL
\n \n
package date: $(date +%F_%H:%M:%S)" > $MEDIA_BUILD_NAME-$GIT_REV/LE_versions package date: $(date +%F_%H:%M:%S)" >$MEDIA_BUILD_NAME-$GIT_REV/LE_versions
################################################################################ ################################################################################

View File

@ -5,24 +5,24 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
echo "getting sources..." echo "getting sources..."
if [ ! -d rtmpdump.git ]; then if [ ! -d rtmpdump.git ]; then
git clone git://git.ffmpeg.org/rtmpdump rtmpdump.git git clone git://git.ffmpeg.org/rtmpdump rtmpdump.git
fi fi
cd rtmpdump.git cd rtmpdump.git
git pull git pull
GIT_REV=`git log -n1 --format=%H` GIT_REV=$(git log -n1 --format=%H)
cd .. cd ..
echo "copying sources..." echo "copying sources..."
rm -rf rtmpdump-$GIT_REV rm -rf rtmpdump-$GIT_REV
cp -R rtmpdump.git rtmpdump-$GIT_REV cp -R rtmpdump.git rtmpdump-$GIT_REV
echo "cleaning sources..." echo "cleaning sources..."
rm -rf rtmpdump-$GIT_REV/.git rm -rf rtmpdump-$GIT_REV/.git
echo "packing sources..." echo "packing sources..."
tar cvJf rtmpdump-$GIT_REV.tar.xz rtmpdump-$GIT_REV tar cvJf rtmpdump-$GIT_REV.tar.xz rtmpdump-$GIT_REV
echo "remove temporary sourcedir..." echo "remove temporary sourcedir..."
rm -rf rtmpdump-$GIT_REV rm -rf rtmpdump-$GIT_REV

View File

@ -15,24 +15,24 @@ fi
VBOX_VERSION="$1" VBOX_VERSION="$1"
echo "getting sources..." echo "getting sources..."
mkdir vbox && cd vbox/ mkdir vbox && cd vbox/
wget http://download.virtualbox.org/virtualbox/${VBOX_VERSION}/VBoxGuestAdditions_${VBOX_VERSION}.iso wget http://download.virtualbox.org/virtualbox/${VBOX_VERSION}/VBoxGuestAdditions_${VBOX_VERSION}.iso
echo "extracting iso..." echo "extracting iso..."
7z e VBoxGuestAdditions_${VBOX_VERSION}.iso VBoxLinuxAdditions.run -r 7z e VBoxGuestAdditions_${VBOX_VERSION}.iso VBoxLinuxAdditions.run -r
chmod 0755 VBoxLinuxAdditions.run chmod 0755 VBoxLinuxAdditions.run
echo "extract VBoxLinuxAdditions.run..." echo "extract VBoxLinuxAdditions.run..."
./VBoxLinuxAdditions.run --tar xf ./VBoxLinuxAdditions.run --tar xf
echo "extract VBoxGuestAdditions-amd64..." echo "extract VBoxGuestAdditions-amd64..."
mkdir xf86-video-virtualbox-${VBOX_VERSION} mkdir xf86-video-virtualbox-${VBOX_VERSION}
tar -jxvf VBoxGuestAdditions-amd64.tar.bz2 -C xf86-video-virtualbox-${VBOX_VERSION}/ tar -jxvf VBoxGuestAdditions-amd64.tar.bz2 -C xf86-video-virtualbox-${VBOX_VERSION}/
echo "packing sources..." echo "packing sources..."
tar cvJf xf86-video-virtualbox-${VBOX_VERSION}.tar.xz xf86-video-virtualbox-${VBOX_VERSION} tar cvJf xf86-video-virtualbox-${VBOX_VERSION}.tar.xz xf86-video-virtualbox-${VBOX_VERSION}
mv xf86-video-virtualbox-${VBOX_VERSION}.tar.xz ../xf86-video-virtualbox-${VBOX_VERSION}.tar.xz mv xf86-video-virtualbox-${VBOX_VERSION}.tar.xz ../xf86-video-virtualbox-${VBOX_VERSION}.tar.xz
echo "remove temporary sourcedir..." echo "remove temporary sourcedir..."
cd .. cd ..
rm -rf vbox/ rm -rf vbox/

View File

@ -39,7 +39,7 @@ for PKG in $ADAFRUIT_PACKAGES; do
fi fi
# get new hash from master branch # get new hash from master branch
URL=$(sed "s|\(www\.\)*github.com/|api.github.com/repos/|;s|/archive/.*|/commits/master|" <<< $PKG_URL) URL=$(sed "s|\(www\.\)*github.com/|api.github.com/repos/|;s|/archive/.*|/commits/master|" <<<$PKG_URL)
GIT_HASH=$(curl --silent --header "Accept: application/vnd.github.v3.sha" $CURL_LOGIN $URL) GIT_HASH=$(curl --silent --header "Accept: application/vnd.github.v3.sha" $CURL_LOGIN $URL)
# check rate limit # check rate limit
@ -78,15 +78,15 @@ done
. config/options adafruit-libraries . config/options adafruit-libraries
if [ ! -z "$CHANGED" ]; then if [ ! -z "$CHANGED" ]; then
# revision # revision
REV=$(( $PKG_REV + 1 )) REV=$(($PKG_REV + 1))
echo "increase revision $PKG_REV -> $REV" echo "increase revision $PKG_REV -> $REV"
sed "s|^PKG_REV=.*$|PKG_REV=\"${REV}\"|" -i ${PKG_DIR}/package.mk sed "s|^PKG_REV=.*$|PKG_REV=\"${REV}\"|" -i ${PKG_DIR}/package.mk
# changelog # changelog
echo -en "${REV}\n updated libraries:" > ${PKG_DIR}/changelog.txt.new echo -en "${REV}\n updated libraries:" >${PKG_DIR}/changelog.txt.new
sed "s|#|\n - |g" <<< ${CHANGED} >> ${PKG_DIR}/changelog.txt.new sed "s|#|\n - |g" <<<${CHANGED} >>${PKG_DIR}/changelog.txt.new
echo "" >> ${PKG_DIR}/changelog.txt.new echo "" >>${PKG_DIR}/changelog.txt.new
cat ${PKG_DIR}/changelog.txt >> ${PKG_DIR}/changelog.txt.new cat ${PKG_DIR}/changelog.txt >>${PKG_DIR}/changelog.txt.new
mv ${PKG_DIR}/changelog.txt.new ${PKG_DIR}/changelog.txt mv ${PKG_DIR}/changelog.txt.new ${PKG_DIR}/changelog.txt
fi fi

View File

@ -17,15 +17,15 @@ usage() {
while [ $# -ne 0 ]; do while [ $# -ne 0 ]; do
case "$1" in case "$1" in
-b|--bump-pkg-rev) -b | --bump-pkg-rev)
BUMP_PKG_REV="yes" BUMP_PKG_REV="yes"
shift shift
;; ;;
-d|--delete-git-dirs) -d | --delete-git-dirs)
KEEP_GIT_DIRS="" KEEP_GIT_DIRS=""
shift shift
;; ;;
-h|--help) -h | --help)
usage usage
exit 1 exit 1
;; ;;
@ -87,21 +87,21 @@ else
ADDONS_REPO_LOCATION=${TMP_REPO_DIR} ADDONS_REPO_LOCATION=${TMP_REPO_DIR}
fi fi
if ! ls ${ADDONS_REPO_LOCATION}/*-addons.txt &> /dev/null; then if ! ls ${ADDONS_REPO_LOCATION}/*-addons.txt &>/dev/null; then
echo "No binary addon repo description found, nothing to do!" echo "No binary addon repo description found, nothing to do!"
echo "Path searched: ${ADDONS_REPO_LOCATION}" echo "Path searched: ${ADDONS_REPO_LOCATION}"
exit 0 exit 0
fi fi
# addons # addons
for addontxt in ${ADDONS_REPO_LOCATION}/*-addons.txt ; do for addontxt in ${ADDONS_REPO_LOCATION}/*-addons.txt; do
ADDONS=$(cat $addontxt | awk '{print $1}') ADDONS=$(cat $addontxt | awk '{print $1}')
ADDONS_GIT_DIR="${ADDONS}.git" ADDONS_GIT_DIR="${ADDONS}.git"
ADDONS_GIT_REPO=$(cat $addontxt | awk '{print $2}') ADDONS_GIT_REPO=$(cat $addontxt | awk '{print $2}')
ADDONS_GIT_BRANCH=$(cat $addontxt | awk '{print $3}') ADDONS_GIT_BRANCH=$(cat $addontxt | awk '{print $3}')
git_clone $ADDONS_GIT_REPO $ADDONS_GIT_DIR ${ADDONS_GIT_BRANCH} git_clone $ADDONS_GIT_REPO $ADDONS_GIT_DIR ${ADDONS_GIT_BRANCH}
for addon in $ADDONS_GIT_DIR/*.*/ ; do for addon in $ADDONS_GIT_DIR/*.*/; do
ADDON=$(basename $addon) ADDON=$(basename $addon)
[[ ${ADDON} =~ ^game.* ]] && continue # ignore game.* addons - handled by update_retroplayer-addons [[ ${ADDON} =~ ^game.* ]] && continue # ignore game.* addons - handled by update_retroplayer-addons
@ -117,7 +117,7 @@ for addontxt in ${ADDONS_REPO_LOCATION}/*-addons.txt ; do
fi fi
ADDON_PATH="${ROOT}/packages/mediacenter/kodi-binary-addons/${ADDON}/" ADDON_PATH="${ROOT}/packages/mediacenter/kodi-binary-addons/${ADDON}/"
if [ -f "${ADDON_PATH}/package.mk" ] ; then if [ -f "${ADDON_PATH}/package.mk" ]; then
# Verify the Kodi repo matches our package repo # Verify the Kodi repo matches our package repo
# If different, ignore the addon and process it later as an "unofficial" addon # If different, ignore the addon and process it later as an "unofficial" addon
validate_pkg_url "${ADDON}" "${GIT_REPO}" || continue validate_pkg_url "${ADDON}" "${GIT_REPO}" || continue

View File

@ -18,19 +18,19 @@ usage() {
while [ $# -ne 0 ]; do while [ $# -ne 0 ]; do
case "$1" in case "$1" in
-b|--bump-pkg-rev) -b | --bump-pkg-rev)
BUMP_PKG_REV="yes" BUMP_PKG_REV="yes"
shift shift
;; ;;
-d|--delete-git-dirs) -d | --delete-git-dirs)
KEEP_GIT_DIRS="" KEEP_GIT_DIRS=""
shift shift
;; ;;
-f|--force-libretro-bump) -f | --force-libretro-bump)
FORCE_LIBRETRO_BUMP="yes" FORCE_LIBRETRO_BUMP="yes"
shift shift
;; ;;
-h|--help) -h | --help)
usage usage
exit 1 exit 1
;; ;;
@ -45,7 +45,6 @@ while [ $# -ne 0 ]; do
esac esac
done done
if [ $# -eq 0 -o $# -gt 2 ]; then if [ $# -eq 0 -o $# -gt 2 ]; then
usage usage
exit 1 exit 1
@ -88,7 +87,7 @@ ADDONS_DIR="${ADDONS}.git"
ADDONS_REPO="https://github.com/kodi-game/repo-binary-addons.git" ADDONS_REPO="https://github.com/kodi-game/repo-binary-addons.git"
git_clone ${ADDONS_REPO} ${ADDONS_DIR} ${KODI_BRANCH} git_clone ${ADDONS_REPO} ${ADDONS_DIR} ${KODI_BRANCH}
for addon in ${ADDONS_DIR}/*.*/ ; do for addon in ${ADDONS_DIR}/*.*/; do
GAME_ADDON=$(basename ${addon}) GAME_ADDON=$(basename ${addon})
[[ "${GAME_ADDON}" =~ ^game. ]] || continue [[ "${GAME_ADDON}" =~ ^game. ]] || continue
@ -104,7 +103,7 @@ for addon in ${ADDONS_DIR}/*.*/ ; do
GAME_GIT_BRANCH=$(cat $addon/${GAME_ADDON}.txt | awk '{print $3}') GAME_GIT_BRANCH=$(cat $addon/${GAME_ADDON}.txt | awk '{print $3}')
GAME_PATH="${ROOT}/packages/mediacenter/kodi-binary-addons/${GAME_ADDON}" GAME_PATH="${ROOT}/packages/mediacenter/kodi-binary-addons/${GAME_ADDON}"
if [ ! -d "$GAME_PATH" ] ; then if [ ! -d "$GAME_PATH" ]; then
msg_warn "SKIPPING ${GAME_ADDON}, not present in LE" msg_warn "SKIPPING ${GAME_ADDON}, not present in LE"
continue continue
fi fi
@ -185,7 +184,7 @@ for addon in ${ADDONS_DIR}/*.*/ ; do
fi fi
VERSION_INFO=$(grep "^${RETRO_NAME}" "${RETRO_VERSION_FILE}" | head -1) VERSION_INFO=$(grep "^${RETRO_NAME}" "${RETRO_VERSION_FILE}" | head -1)
if [[ "$VERSION_INFO" =~ github\.com/[^/]+/[^/]+/archive/[^/]+\.tar\..*$ ]] ; then if [[ "$VERSION_INFO" =~ github\.com/[^/]+/[^/]+/archive/[^/]+\.tar\..*$ ]]; then
# version referenced by githash # version referenced by githash
RETRO_NEW_VERSION=$(echo "${VERSION_INFO}" | sed -E -e 's|^(.+/archive/)([^/]+)(\.tar.*)$|\2|') RETRO_NEW_VERSION=$(echo "${VERSION_INFO}" | sed -E -e 's|^(.+/archive/)([^/]+)(\.tar.*)$|\2|')
RETRO_NEW_REPO=$(echo "${VERSION_INFO}" | sed -E -e 's|^(.+github\.com/)([^/]+/[^/]+)(/archive/.*)$|\2|') RETRO_NEW_REPO=$(echo "${VERSION_INFO}" | sed -E -e 's|^(.+github\.com/)([^/]+/[^/]+)(/archive/.*)$|\2|')
@ -223,12 +222,11 @@ for addon in ${ADDONS_DIR}/*.*/ ; do
done done
msg_info "Checking for orphaned addon packages in LE" msg_info "Checking for orphaned addon packages in LE"
for addon in ${ROOT}/packages/mediacenter/kodi-binary-addons/game.libretro.* ; do for addon in ${ROOT}/packages/mediacenter/kodi-binary-addons/game.libretro.*; do
GAME_ADDON=$(basename ${addon}) GAME_ADDON=$(basename ${addon})
if [ ! -d "${ADDONS_DIR}/${GAME_ADDON}" ] ; then if [ ! -d "${ADDONS_DIR}/${GAME_ADDON}" ]; then
msg_warn "ORHPANED ${GAME_ADDON}, not present in kodi game repo" msg_warn "ORHPANED ${GAME_ADDON}, not present in kodi game repo"
fi fi
done done
rm -rf "${TMPDIR}" rm -rf "${TMPDIR}"

View File

@ -52,8 +52,7 @@ process_line() {
TARGET_CONFIGURE_OPTS CMAKE_GENERATOR_NINJA TARGET_CMAKE_OPTS TARGET_MESON_OPTS \ TARGET_CONFIGURE_OPTS CMAKE_GENERATOR_NINJA TARGET_CMAKE_OPTS TARGET_MESON_OPTS \
HOST_CONFIGURE_OPTS HOST_CMAKE_OPTS HOST_MESON_OPTS \ HOST_CONFIGURE_OPTS HOST_CMAKE_OPTS HOST_MESON_OPTS \
INIT_CONFIGURE_OPTS INIT_CMAKE_OPTS INIT_MESON_OPTS \ INIT_CONFIGURE_OPTS INIT_CMAKE_OPTS INIT_MESON_OPTS \
BOOTSTRAP_CONFIGURE_OPTS BOOTSTRAP_CMAKE_OPTS BOOTSTRAP_MESON_OPTS \ BOOTSTRAP_CONFIGURE_OPTS BOOTSTRAP_CMAKE_OPTS BOOTSTRAP_MESON_OPTS; do
; do
# After PKG_DIR, treat assigns to var as invalid # After PKG_DIR, treat assigns to var as invalid
[ "${var}" = "PKG_DIR" ] && assignallowed=N [ "${var}" = "PKG_DIR" ] && assignallowed=N
@ -83,8 +82,7 @@ init_target_funcs() {
for f in pre_build \ for f in pre_build \
pre_configure configure post_configure \ pre_configure configure post_configure \
pre_make make post_make \ pre_make make post_make \
pre_makeinstall makeinstall post_makeinstall \ pre_makeinstall makeinstall post_makeinstall; do
; do
funcs+=" ${f}_${t}" funcs+=" ${f}_${t}"
done done
done done
@ -101,8 +99,7 @@ check_func_name() {
pre_configure \ pre_configure \
${TARGET_FUNCS} \ ${TARGET_FUNCS} \
pre_install post_install \ pre_install post_install \
addon post_install_addon \ addon post_install_addon; do
; do
[[ ${line} =~ ^${f} ]] && return 0 [[ ${line} =~ ^${f} ]] && return 0
done done
@ -124,7 +121,7 @@ process_pkg() {
if [[ "${line}" =~ \(\)[[:space:]]*\{ ]]; then if [[ "${line}" =~ \(\)[[:space:]]*\{ ]]; then
funcname="${line//(*/}" funcname="${line//(*/}"
fc=$((fc+1)) fc=$((fc + 1))
check_func_name "${filename}" "${lc}" "${line}" check_func_name "${filename}" "${lc}" "${line}"
fi fi
@ -139,12 +136,12 @@ process_pkg() {
[[ "${line}" =~ (\"$|\"[[:space:]]*$|\"[[:space:]]*#.*$) ]] && isassign=N [[ "${line}" =~ (\"$|\"[[:space:]]*$|\"[[:space:]]*#.*$) ]] && isassign=N
[[ "${line}" =~ (^}|^[[:space:]]*}) ]] && funcname= [[ "${line}" =~ (^}|^[[:space:]]*}) ]] && funcname=
done < "${filename}" done <"${filename}"
# Duplicate function check # Duplicate function check
while read -r count line; do while read -r count line; do
[ -n "${line}" ] && log "${filename}" 0 "FAIL" "duplicate function def" "${line}" [ -n "${line}" ] && log "${filename}" 0 "FAIL" "duplicate function def" "${line}"
done <<< "$(grep -E ".*() {" "${filename}" | sed 's/[[:space:]]*{.*//' | sort | uniq -c | grep -v ^[[:space:]]*1[[:space:]])" done <<<"$(grep -E ".*() {" "${filename}" | sed 's/[[:space:]]*{.*//' | sort | uniq -c | grep -v ^[[:space:]]*1[[:space:]])"
} }
TARGET_FUNCS="$(init_target_funcs)" TARGET_FUNCS="$(init_target_funcs)"

View File

@ -105,7 +105,7 @@ for i in ${PKG_DIR}/patches/*.patch \
PATCH="${i#${ROOT}/}" PATCH="${i#${ROOT}/}"
mkdir -p "$(dirname ${PKG_BUILD}/patches/${PATCH})" mkdir -p "$(dirname ${PKG_BUILD}/patches/${PATCH})"
ln -s "${i}" "${PKG_BUILD}/patches/${PATCH}" ln -s "${i}" "${PKG_BUILD}/patches/${PATCH}"
echo "${PATCH}" >> "${PKG_BUILD}/patches/series" echo "${PATCH}" >>"${PKG_BUILD}/patches/series"
fi fi
done done

View File

@ -8,18 +8,18 @@
update_addons_xml() { update_addons_xml() {
echo "[*] cleanup addons ..." echo "[*] cleanup addons ..."
olddir="" olddir=""
find target/addons/$ADDON_VERSION -iname 'changelog*.txt' | sort -rV | while read line ; do find target/addons/$ADDON_VERSION -iname 'changelog*.txt' | sort -rV | while read line; do
dir=$(dirname $line) dir=$(dirname $line)
if [ "$olddir" = "$dir" ] ; then if [ "$olddir" = "$dir" ]; then
rm -f $line rm -f $line
fi fi
olddir=$dir olddir=$dir
done done
olddir="" olddir=""
find target/addons/$ADDON_VERSION -iname '*.zip' | sort -rV | while read line ; do find target/addons/$ADDON_VERSION -iname '*.zip' | sort -rV | while read line; do
dir=$(dirname $line) dir=$(dirname $line)
if [ "$olddir" = "$dir" ] ; then if [ "$olddir" = "$dir" ]; then
rm -f $line rm -f $line
fi fi
olddir=$dir olddir=$dir
@ -27,26 +27,26 @@ update_addons_xml() {
echo "[*] updating addons.xml* ..." echo "[*] updating addons.xml* ..."
rm -rf .addons rm -rf .addons
pwd=`pwd` pwd=$(pwd)
find target/addons/$ADDON_VERSION -iname addons.xml | while read line ; do find target/addons/$ADDON_VERSION -iname addons.xml | while read line; do
localdir=`echo $line | sed s/addons.xml//g` localdir=$(echo $line | sed s/addons.xml//g)
echo " [*] updating $line..." echo " [*] updating $line..."
echo '<?xml version="1.0" encoding="UTF-8"?> echo '<?xml version="1.0" encoding="UTF-8"?>
<addons> <addons>
' > $line.tmp ' >$line.tmp
for zip in $localdir/*/*.zip ; do for zip in $localdir/*/*.zip; do
mkdir -p ".addons/$localdir" mkdir -p ".addons/$localdir"
unzip $zip "*/addon.xml" -d ".addons/$localdir" &>/dev/null unzip $zip "*/addon.xml" -d ".addons/$localdir" &>/dev/null
done done
find .addons/$localdir -iname addon.xml | grep -v resources/ | while read xml ; do find .addons/$localdir -iname addon.xml | grep -v resources/ | while read xml; do
cat $xml | grep -v "<?" >> $line.tmp cat $xml | grep -v "<?" >>$line.tmp
done done
echo ' echo '
</addons>' >> $line.tmp </addons>' >>$line.tmp
mv $line.tmp $line mv $line.tmp $line
cd $localdir cd $localdir
md5sum addons.xml > addons.xml.md5 md5sum addons.xml >addons.xml.md5
cd $pwd cd $pwd
done done
rm -rf .addons rm -rf .addons
@ -57,7 +57,7 @@ touch_addons_xml() {
if [ -d "projects/$PROJECT/devices" ]; then if [ -d "projects/$PROJECT/devices" ]; then
for DEVICE in $(ls -1 projects/$PROJECT/devices); do for DEVICE in $(ls -1 projects/$PROJECT/devices); do
for archfile in projects/$PROJECT/devices/$DEVICE/linux/linux.*.conf; do for archfile in projects/$PROJECT/devices/$DEVICE/linux/linux.*.conf; do
ARCH=`echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p'` ARCH=$(echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p')
if [ ! -d target/addons/$ADDON_VERSION/$DEVICE/$ARCH ]; then if [ ! -d target/addons/$ADDON_VERSION/$DEVICE/$ARCH ]; then
break break
fi fi
@ -68,7 +68,7 @@ touch_addons_xml() {
done done
else else
for archfile in projects/$PROJECT/linux/linux.*.conf; do for archfile in projects/$PROJECT/linux/linux.*.conf; do
ARCH=`echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p'` ARCH=$(echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p')
if [ ! -d target/addons/$ADDON_VERSION/$PROJECT/$ARCH ]; then if [ ! -d target/addons/$ADDON_VERSION/$PROJECT/$ARCH ]; then
break break
fi fi
@ -81,10 +81,10 @@ touch_addons_xml() {
} }
upload() { upload() {
if [ -f .work/repoconfig ] ; then if [ -f .work/repoconfig ]; then
. .work/repoconfig . .work/repoconfig
fi fi
if [ -z "$RSYNC_REPO" ] ; then if [ -z "$RSYNC_REPO" ]; then
echo "*** ERROR: \$RSYNC_REPO not set. see .work/repoconfig ***" echo "*** ERROR: \$RSYNC_REPO not set. see .work/repoconfig ***"
exit 0 exit 0
fi fi
@ -99,18 +99,18 @@ build() {
for PROJECT in $2; do for PROJECT in $2; do
if [ -n "$DEVICE" ]; then if [ -n "$DEVICE" ]; then
for archfile in projects/$PROJECT/devices/$DEVICE/linux/linux.*.conf; do for archfile in projects/$PROJECT/devices/$DEVICE/linux/linux.*.conf; do
ARCH=`echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p'` ARCH=$(echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p')
done done
else else
for archfile in projects/$PROJECT/linux/linux.*.conf; do for archfile in projects/$PROJECT/linux/linux.*.conf; do
ARCH=`echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p'` ARCH=$(echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p')
done done
fi fi
for package in $(find $1 -iname package.mk) ; do for package in $(find $1 -iname package.mk); do
( (
. $package . $package
if [ "$PKG_IS_ADDON" = "yes" ] ; then if [ "$PKG_IS_ADDON" = "yes" ]; then
ADDON=$PKG_NAME ADDON=$PKG_NAME
PROJECT=$PROJECT DEVICE=$DEVICE ARCH=$ARCH ./scripts/create_addon $ADDON PROJECT=$PROJECT DEVICE=$DEVICE ARCH=$ARCH ./scripts/create_addon $ADDON
fi fi
@ -120,22 +120,22 @@ build() {
} }
update_revision() { update_revision() {
for package in $(find $1 -iname package.mk) ; do for package in $(find $1 -iname package.mk); do
[[ "$2" == "Y" && $package =~ .*/game.libretro.* ]] && continue [[ "$2" == "Y" && $package =~ .*/game.libretro.* ]] && continue
( (
. $package . $package
if [ "$PKG_IS_ADDON" = "yes" ] ; then if [ "$PKG_IS_ADDON" = "yes" ]; then
sed -i -e "s|PKG_REV=.*|PKG_REV=\"$((PKG_REV+1))\"|" $package sed -i -e "s|PKG_REV=.*|PKG_REV=\"$((PKG_REV + 1))\"|" $package
fi fi
) )
done done
} }
update_repo_version() { update_repo_version() {
for package in $(find packages/addons -iname package.mk) ; do for package in $(find packages/addons -iname package.mk); do
( (
. $package . $package
if [ "$PKG_IS_ADDON" = "yes" ] ; then if [ "$PKG_IS_ADDON" = "yes" ]; then
sed -i -e "s|PKG_ADDON_REPOVERSION=.*|PKG_ADDON_REPOVERSION=\"$ADDON_VERSION\"|" $package sed -i -e "s|PKG_ADDON_REPOVERSION=.*|PKG_ADDON_REPOVERSION=\"$ADDON_VERSION\"|" $package
sed -i -e "s|PKG_REV=.*|PKG_REV=\"100\"|" $package sed -i -e "s|PKG_REV=.*|PKG_REV=\"100\"|" $package
changelog="$(echo $package | sed 's/package.mk/changelog.txt/')" changelog="$(echo $package | sed 's/package.mk/changelog.txt/')"
@ -216,4 +216,3 @@ case $1 in
exit 0 exit 0
;; ;;
esac esac

View File

@ -19,7 +19,7 @@ github_api_token=""
github_api="no" github_api="no"
test_github_api() { test_github_api() {
# check for github user and token present at ~/.libreelec/options to activate github api checks # check for github user and token present at ~/.libreelec/options to activate github api checks
if [[ -n "${github_token}" || -n "${github_user}" ]]; then if [[ -n "${github_token}" || -n "${github_user}" ]]; then
github_api_token="-u ${github_user}:${github_token}" github_api_token="-u ${github_user}:${github_token}"
# check if token works # check if token works
@ -125,15 +125,16 @@ check_for_update() {
# print version output line # print version output line
if [ ! -z "${API}" ]; then if [ ! -z "${API}" ]; then
printf "%s %s %s" "${PKG_NAME}" "${PKG_VERSION}" "${upstream_version}"; printf '\n' printf "%s %s %s" "${PKG_NAME}" "${PKG_VERSION}" "${upstream_version}"
printf '\n'
elif [ "${PKG_VERSION}" != "${upstream_version}" ]; then elif [ "${PKG_VERSION}" != "${upstream_version}" ]; then
printf "%-35s | %-40s | %-20s" "${PKG_NAME}" "${PKG_VERSION}" "${upstream_version}"; printf '\n' printf "%-35s | %-40s | %-20s" "${PKG_NAME}" "${PKG_VERSION}" "${upstream_version}"
printf '\n'
else else
PACKAGES_CURRENT+="${PKG_NAME} " PACKAGES_CURRENT+="${PKG_NAME} "
fi fi
} }
# create list of packages # create list of packages
if [ -n "${1}" ]; then if [ -n "${1}" ]; then
PACKAGE_LIST="$(find packages/ -type d -name ${1})/package.mk" PACKAGE_LIST="$(find packages/ -type d -name ${1})/package.mk"
@ -141,12 +142,13 @@ if [ -n "${1}" ]; then
die "Package not found: ${1}" die "Package not found: ${1}"
fi fi
else else
PACKAGE_LIST="$(find packages/ -type f -name package.mk \ PACKAGE_LIST="$(
find packages/ -type f -name package.mk \
! -path "packages/addons/addon-depends/adafruit-libraries-depends/*" \ ! -path "packages/addons/addon-depends/adafruit-libraries-depends/*" \
! -path "packages/emulation/*" \ ! -path "packages/emulation/*" \
! -path "packages/linux/*" \ ! -path "packages/linux/*" \
! -path "packages/mediacenter/*" \ ! -path "packages/mediacenter/*" |
| awk '{FS="/" ; $0=$0 ; print $(NF-1)"|"$0}' | sort | cut -d"|" -f2 \ awk '{FS="/" ; $0=$0 ; print $(NF-1)"|"$0}' | sort | cut -d"|" -f2
)" )"
fi fi
@ -156,7 +158,8 @@ if [ -z "${API}" ]; then
# output # output
echo -e "\nUpdates found:\n" echo -e "\nUpdates found:\n"
printf "%-35s | %-40s | %-20s" "Package" "LE git master" "upstream location"; printf '\n' printf "%-35s | %-40s | %-20s" "Package" "LE git master" "upstream location"
printf '\n'
echo -e ''$_{1..140}'\b-' echo -e ''$_{1..140}'\b-'
for check_version in ${PACKAGE_LIST}; do for check_version in ${PACKAGE_LIST}; do

View File

@ -7,5 +7,5 @@ unset _CACHE_PACKAGE_LOCAL _CACHE_PACKAGE_GLOBAL _DEBUG_DEPENDS_LIST _DEBUG_PACK
. config/options "" . config/options ""
${SCRIPTS}/pkgjson | ${SCRIPTS}/genbuildplan.py --show-wants --build ${@:-image} --warn-invalid ${GENFLAGS} || \ ${SCRIPTS}/pkgjson | ${SCRIPTS}/genbuildplan.py --show-wants --build ${@:-image} --warn-invalid ${GENFLAGS} ||
die "FAILURE: Unable to generate plan" die "FAILURE: Unable to generate plan"