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
usage()
{
usage() {
local me="$(basename $0)"
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
done
grep -E "^drop " $TODO > /tmp/dropped
grep -E "^drop " $TODO >/tmp/dropped
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)
case $OPTION in
"1")
"1")
update_addon_version
update_package
;;
"2")
"2")
BUMP_ADDON_VERSION=$(whiptail --inputbox "Enter ADDON-VERSION:" 10 25 ${DISTRO_ADDON_VERSION} 3>&1 1>&2 2>&3)
EXITSTATUS=$?
if [ $EXITSTATUS = 0 ]; then
@ -73,7 +73,7 @@ case $OPTION in
exit
fi
;;
"3")
"3")
exit
;;
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 '"')
fi
done < ${DISTRO_DIR}/${DISTRO}/kernel_options
done <${DISTRO_DIR}/${DISTRO}/kernel_options
else
echo "kernel options file doesn't exist: ${DISTRO_DIR}/${DISTRO}/kernel_options"
fi

View File

@ -37,12 +37,25 @@ USING_FILTER="no"
while getopts "f:cvSh" opt; do
case ${opt} in
f) FILTER="${OPTARG}"; USING_FILTER="yes";;
c) RMPROGRESS="yes";;
v) VERBOSE="yes";;
S) SHOW_SKIPPED="yes";;
h) usage;;
*) usage;;
f)
FILTER="${OPTARG}"
USING_FILTER="yes"
;;
c)
RMPROGRESS="yes"
;;
v)
VERBOSE="yes"
;;
S)
SHOW_SKIPPED="yes"
;;
h)
usage
;;
*)
usage
;;
esac
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
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
[ "${SHOW_SKIPPED}" = "yes" ] && printf "Checking: %-40s IGNORED\n" "${pkg_name}"
continue

View File

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

View File

@ -25,9 +25,8 @@ BUILD_SOURCES="false"
REPLACE_OLD="false"
NEW_SOURCES="${NEW_SOURCES_DIR:-${SOURCES}.new}"
# helper functions
help(){
help() {
echo "Usage: ${0} [-hdfbr]"
echo "Set PROJECT, DEVICE and ARCH as required."
echo " -h this help"
@ -37,7 +36,6 @@ help(){
echo " -r replace old SOURCES when rebuilding (default: no)"
}
# command line opts
while getopts hdfrb OPT; do
case "${OPT}" in
@ -65,8 +63,7 @@ while getopts hdfrb OPT; do
esac
done
shift $((${OPTIND}-1))
shift $((${OPTIND} - 1))
# sanity checking
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"
fi
# main
# process files in SOURCES
for SOURCE_PACKAGE in $(find "${SOURCES}/" -mindepth 1 -type d); do

View File

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

View File

@ -13,7 +13,10 @@ if [ $# -eq 0 ]; then
fi
FFMPEG_ROOT="$(pwd)"
LE_ROOT="$(cd $(dirname $0)/../.. ; pwd)"
LE_ROOT="$(
cd $(dirname $0)/../..
pwd
)"
create_patch() {
FEATURE_SET="$1"
@ -25,7 +28,7 @@ create_patch() {
PATCH_CREATE_DIFF="no"
case "${FEATURE_SET}" in
v4l2-drmprime|v4l2-request|vf-deinterlace-v4l2m2m)
v4l2-drmprime | v4l2-request | vf-deinterlace-v4l2m2m)
REPO="https://github.com/jernejsk/FFmpeg"
REFSPEC="${FEATURE_SET}-${FFMPEG_VERSION}"
;;
@ -67,14 +70,14 @@ create_patch() {
if [ "${PATCH_CREATE_DIFF}" = "yes" ]; then
# 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
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
MSG=$(mktemp)
cat << EOF > "${MSG}"
cat <<EOF >"${MSG}"
ffmpeg: ${ACTION} ${FEATURE_SET} patch
Patch created using revisions ${BASE_REV:0:7}..${REV:0:7}

View File

@ -7,27 +7,27 @@
GIT_DIR="raspberrypi-firmware.git"
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}"
fi
fi
cd "${GIT_DIR}"
git fetch
if [ $# -eq 1 ]; then
cd "${GIT_DIR}"
git fetch
if [ $# -eq 1 ]; then
git checkout "$1"
else
else
git checkout origin/master
fi
GIT_REV=$(git log -n1 --format=%H)
cd ..
fi
GIT_REV=$(git log -n1 --format=%H)
cd ..
BOOT_DIR="${GIT_DIR}/boot"
PKG_DIR="bcm2835-bootloader-${GIT_REV}"
echo "copying sources..."
rm -rf "${PKG_DIR}"
mkdir -p "${PKG_DIR}"
cp \
rm -rf "${PKG_DIR}"
mkdir -p "${PKG_DIR}"
cp \
"${BOOT_DIR}"/LICENCE* \
"${BOOT_DIR}"/bootcode.bin \
"${BOOT_DIR}"/fixup*.dat \
@ -35,7 +35,7 @@ echo "copying sources..."
"${PKG_DIR}"
echo "packing sources..."
tar cvJf "${PKG_DIR}.tar.xz" "${PKG_DIR}"
tar cvJf "${PKG_DIR}.tar.xz" "${PKG_DIR}"
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)
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..."
cd boblightd-latest
SVN_REV=`LANG=C svn info 2>/dev/null | grep Revision: | sed -e 's/.*\: //'`
echo $SVN_REV
cd ..
cd boblightd-latest
SVN_REV=$(LANG=C svn info 2>/dev/null | grep Revision: | sed -e 's/.*\: //')
echo $SVN_REV
cd ..
echo "copying sources..."
rm -rf boblightd-$SVN_REV
cp -R boblightd-latest boblightd-$SVN_REV
rm -rf boblightd-$SVN_REV
cp -R boblightd-latest boblightd-$SVN_REV
#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..."
tar cvJf boblightd-$SVN_REV.tar.xz boblightd-$SVN_REV
tar cvJf boblightd-$SVN_REV.tar.xz boblightd-$SVN_REV
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)
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
fi
fi
cd libcec.git
git pull
GIT_REV=`git log -n1 --format=%H`
cd ..
cd libcec.git
git pull
GIT_REV=$(git log -n1 --format=%H)
cd ..
echo "copying sources..."
rm -rf libcec-$GIT_REV
cp -R libcec.git libcec-$GIT_REV
rm -rf libcec-$GIT_REV
cp -R libcec.git libcec-$GIT_REV
echo "cleaning sources..."
rm -rf libcec-$GIT_REV/.git
rm -rf libcec-$GIT_REV/.git
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..."
rm -rf libcec-$GIT_REV
rm -rf libcec-$GIT_REV

View File

@ -30,23 +30,23 @@ fi
#get log
cd media_build/
git pull
git checkout $MEDIA_BUILD_HASH
GIT_LOG_MEDIA_BUILD=`git log --pretty=oneline -n1`
git pull
git checkout $MEDIA_BUILD_HASH
GIT_LOG_MEDIA_BUILD=$(git log --pretty=oneline -n1)
cd $DVB_MKPKG_FOLDER/
# media_tree dl
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
fi
fi
#get log
cd media_tree/
git pull
GIT_LOG_MEDIA_TREE=`git log --pretty=oneline -n1`
GIT_REV=`git log -n1 --pretty=format:"%ad" --date=short`
git pull
GIT_LOG_MEDIA_TREE=$(git log --pretty=oneline -n1)
GIT_REV=$(git log -n1 --pretty=format:"%ad" --date=short)
cd $DVB_MKPKG_FOLDER/
@ -64,7 +64,7 @@ rm -rf media_tree/
rm -rf media_build/.git/
# 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
mv media_build/ media_build-$GIT_REV/

View File

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

View File

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

View File

@ -39,7 +39,7 @@ for PKG in $ADAFRUIT_PACKAGES; do
fi
# 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)
# check rate limit
@ -78,15 +78,15 @@ done
. config/options adafruit-libraries
if [ ! -z "$CHANGED" ]; then
# revision
REV=$(( $PKG_REV + 1 ))
REV=$(($PKG_REV + 1))
echo "increase revision $PKG_REV -> $REV"
sed "s|^PKG_REV=.*$|PKG_REV=\"${REV}\"|" -i ${PKG_DIR}/package.mk
# changelog
echo -en "${REV}\n updated libraries:" > ${PKG_DIR}/changelog.txt.new
sed "s|#|\n - |g" <<< ${CHANGED} >> ${PKG_DIR}/changelog.txt.new
echo "" >> ${PKG_DIR}/changelog.txt.new
cat ${PKG_DIR}/changelog.txt >> ${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
echo "" >>${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
fi

View File

@ -17,15 +17,15 @@ usage() {
while [ $# -ne 0 ]; do
case "$1" in
-b|--bump-pkg-rev)
-b | --bump-pkg-rev)
BUMP_PKG_REV="yes"
shift
;;
-d|--delete-git-dirs)
-d | --delete-git-dirs)
KEEP_GIT_DIRS=""
shift
;;
-h|--help)
-h | --help)
usage
exit 1
;;
@ -87,21 +87,21 @@ else
ADDONS_REPO_LOCATION=${TMP_REPO_DIR}
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 "Path searched: ${ADDONS_REPO_LOCATION}"
exit 0
fi
# 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_GIT_DIR="${ADDONS}.git"
ADDONS_GIT_REPO=$(cat $addontxt | awk '{print $2}')
ADDONS_GIT_BRANCH=$(cat $addontxt | awk '{print $3}')
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} =~ ^game.* ]] && continue # ignore game.* addons - handled by update_retroplayer-addons
@ -117,7 +117,7 @@ for addontxt in ${ADDONS_REPO_LOCATION}/*-addons.txt ; do
fi
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
# If different, ignore the addon and process it later as an "unofficial" addon
validate_pkg_url "${ADDON}" "${GIT_REPO}" || continue

View File

@ -18,19 +18,19 @@ usage() {
while [ $# -ne 0 ]; do
case "$1" in
-b|--bump-pkg-rev)
-b | --bump-pkg-rev)
BUMP_PKG_REV="yes"
shift
;;
-d|--delete-git-dirs)
-d | --delete-git-dirs)
KEEP_GIT_DIRS=""
shift
;;
-f|--force-libretro-bump)
-f | --force-libretro-bump)
FORCE_LIBRETRO_BUMP="yes"
shift
;;
-h|--help)
-h | --help)
usage
exit 1
;;
@ -45,7 +45,6 @@ while [ $# -ne 0 ]; do
esac
done
if [ $# -eq 0 -o $# -gt 2 ]; then
usage
exit 1
@ -88,7 +87,7 @@ ADDONS_DIR="${ADDONS}.git"
ADDONS_REPO="https://github.com/kodi-game/repo-binary-addons.git"
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}" =~ ^game. ]] || continue
@ -104,7 +103,7 @@ for addon in ${ADDONS_DIR}/*.*/ ; do
GAME_GIT_BRANCH=$(cat $addon/${GAME_ADDON}.txt | awk '{print $3}')
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"
continue
fi
@ -185,7 +184,7 @@ for addon in ${ADDONS_DIR}/*.*/ ; do
fi
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
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|')
@ -223,12 +222,11 @@ for addon in ${ADDONS_DIR}/*.*/ ; do
done
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})
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"
fi
done
rm -rf "${TMPDIR}"

View File

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

View File

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

View File

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

View File

@ -19,7 +19,7 @@ github_api_token=""
github_api="no"
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
github_api_token="-u ${github_user}:${github_token}"
# check if token works
@ -125,15 +125,16 @@ check_for_update() {
# print version output line
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
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
PACKAGES_CURRENT+="${PKG_NAME} "
fi
}
# create list of packages
if [ -n "${1}" ]; then
PACKAGE_LIST="$(find packages/ -type d -name ${1})/package.mk"
@ -141,12 +142,13 @@ if [ -n "${1}" ]; then
die "Package not found: ${1}"
fi
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/emulation/*" \
! -path "packages/linux/*" \
! -path "packages/mediacenter/*" \
| awk '{FS="/" ; $0=$0 ; print $(NF-1)"|"$0}' | sort | cut -d"|" -f2 \
! -path "packages/mediacenter/*" |
awk '{FS="/" ; $0=$0 ; print $(NF-1)"|"$0}' | sort | cut -d"|" -f2
)"
fi
@ -156,7 +158,8 @@ if [ -z "${API}" ]; then
# output
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-'
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 ""
${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"