mirror of
https://github.com/libretro/Lakka-LibreELEC.git
synced 2024-11-23 00:09:52 +00:00
Lakka: update scripts
backport from devel
This commit is contained in:
parent
b6bb996886
commit
91fe9990e4
@ -7,6 +7,13 @@
|
||||
|
||||
# Where are the tarballs hosted
|
||||
URL="https://nightly.builds.lakka.tv"
|
||||
PKGPATHS="\
|
||||
packages/lakka/retroarch_base \
|
||||
packages/lakka/libretro_cores \
|
||||
"
|
||||
PRG="\
|
||||
wget \
|
||||
"
|
||||
|
||||
# Check arguments and print usage
|
||||
[ $# -ne 1 ] && {
|
||||
@ -21,15 +28,18 @@ PKG=${1}
|
||||
PKG_PATH=""
|
||||
|
||||
# Check if there is such package
|
||||
for FINDPATH in packages/lakka/retroarch_base/${PKG} packages/lakka/libretro_cores/${PKG} ; do
|
||||
if [ -d ${FINDPATH} ] ; then
|
||||
PKG_PATH=${FINDPATH}
|
||||
for FINDPATH in ${PKGPATHS} ; do
|
||||
if [ -d ${FINDPATH}/${PKG} ] ; then
|
||||
PKG_PATH=${FINDPATH}/${PKG}
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
[ -z "${PKG_PATH}" ] && {
|
||||
echo "There is no package '${PKG}' in packages/lakka/retroarch_base and package/lakka/libretro_cores"
|
||||
echo "There is no package '${PKG}' in"
|
||||
for FINDPATH in ${PKGPATHS} ; do
|
||||
echo "- ${FINDPATH}"
|
||||
done
|
||||
exit 2
|
||||
}
|
||||
|
||||
@ -58,19 +68,22 @@ source ${PKG_PATH}/package.mk 2>&1 >/dev/null
|
||||
exit 4
|
||||
}
|
||||
|
||||
LINK=${URL}/sources/${PKG}/${PKG}-${PKG_VERSION}.tar.xz
|
||||
FILENAME=sources/${PKG}/${PKG}-${PKG_VERSION}.tar.xz
|
||||
FILENAME=${PKG}-${PKG_VERSION}.tar.xz
|
||||
FILEPATH=sources/${PKG}/${FILENAME}
|
||||
STAMPFILE=${FILENAME}.gitstamp
|
||||
STAMPPATH=sources/${PKG}/${STAMPFILE}
|
||||
LINKFILE=${URL}/sources/${PKG}/${FILENAME}
|
||||
LINKSTAMP=${URL}/sources/${PKG}/${STAMPFILE}
|
||||
|
||||
# Do not continue when a tarball is already present in the sources folder
|
||||
# (also safety catch in case this script is started on the server, where the tarballs are hosted)
|
||||
[ -f ${FILENAME} ] && {
|
||||
echo "There is already ${FILENAME} - remove it and try again"
|
||||
[ -f ${FILEPATH} ] && {
|
||||
echo "There is already ${FILEPATH} - remove it and try again"
|
||||
exit 5
|
||||
}
|
||||
|
||||
[ -f ${STAMPFILE} ] && {
|
||||
echo "There is already ${STAMPFILE} - remove it and try again"
|
||||
[ -f ${STAMPPATH} ] && {
|
||||
echo "There is already ${STAMPPATH} - remove it and try again"
|
||||
exit 5
|
||||
}
|
||||
|
||||
@ -81,31 +94,32 @@ then
|
||||
then
|
||||
mkdir -p sources/${PKG}
|
||||
else
|
||||
echo "Cannot create folder sources/$PKG - file exists"
|
||||
echo "Cannot create folder sources/${PKG} - file exists"
|
||||
exit 6
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if we have wget
|
||||
# Check if we have programs
|
||||
[ -z "$(which ${PRG} 2>/dev/null)" ] && {
|
||||
echo "Please install ${PRG}"
|
||||
exit 7
|
||||
}
|
||||
|
||||
# Download the tarball
|
||||
echo "Downloading to ${FILENAME} ..."
|
||||
wget --quiet -O ${FILENAME} ${LINK}
|
||||
echo -e "Downloading archive\n\tfrom\n${LINKFILE}\n\tto\n${FILEPATH}"
|
||||
wget --quiet -O ${FILEPATH} ${LINKFILE}
|
||||
|
||||
[ ${?} -gt 0 ] && {
|
||||
echo "Error downloading ${LINK}"
|
||||
echo "Error downloading ${LINKFILE}"
|
||||
exit 8
|
||||
}
|
||||
|
||||
echo "Creating ${STAMPFILE} ..."
|
||||
echo "${PKG_URL}|${PKG_VERSION}" > ${STAMPFILE}
|
||||
# Download the stamp file
|
||||
echo -e "\nDownload stamp file\n\tfrom\n${LINKSTAMP}\n\tto\n${STAMPPATH}"
|
||||
wget --quiet -O ${STAMPPATH} ${LINKSTAMP}
|
||||
|
||||
[ ${?} -gt 0 ] && {
|
||||
echo "Error creating ${STAMPFILE}"
|
||||
echo "Error downloading ${LINKSTAMP}"
|
||||
exit 8
|
||||
}
|
||||
|
||||
|
@ -50,11 +50,11 @@ case $1 in
|
||||
esac
|
||||
fi
|
||||
# Get list of all libretro and retroarch packages
|
||||
for p in $(cd $LR_PKG_PATH && ls) ; do
|
||||
PACKAGES_ALL+=" $p "
|
||||
for p in $(cd $LR_PKG_PATH && ls -d */) ; do
|
||||
PACKAGES_ALL+=" ${p//\//} "
|
||||
done
|
||||
for p in $(cd $RA_PKG_PATH && ls) ; do
|
||||
PACKAGES_ALL+=" $p "
|
||||
for p in $(cd $RA_PKG_PATH && ls -d */) ; do
|
||||
PACKAGES_ALL+=" ${p//\//} "
|
||||
done
|
||||
;;
|
||||
-u | --used )
|
||||
@ -196,8 +196,9 @@ for f in $ALL_FILES ; do
|
||||
PKG_VERSION=`cat $f | sed -En "s/^PKG_VERSION=\"(.*)\"/\1/p"`
|
||||
PKG_SITE=`cat $f | sed -En "s/^PKG_SITE=\"(.*)\"/\1/p"`
|
||||
PKG_NAME=`cat $f | sed -En "s/^PKG_NAME=\"(.*)\"/\1/p"`
|
||||
PKG_GIT_BRANCH=`cat $f | sed -En "s/^PKG_GIT_CLONE_BRANCH=\"(.*)\"/\1/p"`
|
||||
PKG_GIT_CLONE_BRANCH=`cat $f | sed -En "s/^PKG_GIT_CLONE_BRANCH=\"(.*)\"/\1/p"`
|
||||
PKG_LR_UPDATE_TAG=`cat $f | sed -En "s/^PKG_LR_UPDATE_TAG=\"(.*)\"/\1/p"`
|
||||
PKG_LR_UPDATE_TAG_MASK=`cat $f | sed -En "s/^PKG_LR_UPDATE_TAG_MASK=\"(.*)\"/\1/p"`
|
||||
if [ -z "$PKG_VERSION" ] || [ -z "$PKG_SITE" ] ; then
|
||||
echo "$f: does not have PKG_VERSION or PKG_SITE"
|
||||
echo "PKG_VERSION: $PKG_VERSION"
|
||||
@ -205,20 +206,28 @@ for f in $ALL_FILES ; do
|
||||
echo "Skipping update."
|
||||
continue
|
||||
fi
|
||||
if [ -n "$PKG_GIT_CLONE_BRANCH" -a "$PKG_LR_UPDATE_TAG" = "yes" ]; then
|
||||
echo "$f: WARNING: both PKG_GIT_CLONE_BRANCH and PKG_LR_UPDATE_TAG are set! Skipping update."
|
||||
continue
|
||||
fi
|
||||
UPDATE_INFO=""
|
||||
if [ -n "$PKG_GIT_BRANCH" ]; then
|
||||
GIT_HEAD="heads/$PKG_GIT_BRANCH"
|
||||
UPDATE_INFO="(branch $PKG_GIT_BRANCH"
|
||||
if [ -n "$PKG_GIT_CLONE_BRANCH" ]; then
|
||||
GIT_HEAD="heads/$PKG_GIT_CLONE_BRANCH"
|
||||
UPDATE_INFO="(branch $PKG_GIT_CLONE_BRANCH)"
|
||||
else
|
||||
GIT_HEAD="HEAD"
|
||||
fi
|
||||
if [ "$PKG_LR_UPDATE_TAG" = "yes" ]; then
|
||||
UPS_VERSION=`git ls-remote --sort='v:refname' --tags $PKG_SITE '*.*.*' 2>/dev/null | tail -n 1 | awk '{ print $1; }'`
|
||||
[ -z "$UPDATE_INFO" ] && UPDATE_INFO="(latest x.x.x tag" || UPDATE_INFO+=" + latest x.x.x tag"
|
||||
if [ -n "${PKG_LR_UPDATE_TAG_MASK}" ]; then
|
||||
TAG=`git ls-remote --tags $PKG_SITE "${PKG_LR_UPDATE_TAG_MASK}" 2>/dev/null | cut --delimiter='/' --fields=3 | cut --delimiter='^' --fields=1 | sort --version-sort | tail --lines=1`
|
||||
else
|
||||
TAG=`git ls-remote --tags $PKG_SITE 2>/dev/null | cut --delimiter='/' --fields=3 | cut --delimiter='^' --fields=1 | sort --version-sort | tail --lines=1`
|
||||
fi
|
||||
UPS_VERSION=`git ls-remote --tags $PKG_SITE 2>/dev/null | grep refs/tags/$TAG | tail --lines=1 | awk '{ print $1; }'`
|
||||
UPDATE_INFO="(latest tag - $TAG)"
|
||||
else
|
||||
UPS_VERSION=`git ls-remote $PKG_SITE 2>/dev/null | grep ${GIT_HEAD}$ | awk '{ print $1; }'`
|
||||
fi
|
||||
[ -n "$UPDATE_INFO" ] && UPDATE_INFO+=")"
|
||||
if [ "$UPS_VERSION" = "$PKG_VERSION" ]; then
|
||||
echo "$PKG_NAME is up to date ($UPS_VERSION) $UPDATE_INFO"
|
||||
elif [ "$UPS_VERSION" = "" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user