tarball scripts: update + remove

remove obsolete script to create tarballs, as tarballs are already
created after cloning git repo during build.
update script to download tarball, no extracting is necessary, as this
is done during package unpack
This commit is contained in:
Tomáš Kelemen (vudiq) 2023-01-17 22:47:25 +01:00
parent 33e9e1eaaa
commit ce4011a830
No known key found for this signature in database
GPG key ID: 5CE55E600E0B3B22
2 changed files with 30 additions and 51 deletions

View file

@ -1,37 +0,0 @@
#!/bin/bash
# Creates .tar.xz archives of cloned libretro repositories for future re-use
# in case original repository goes awol or is force-pushed, so a build can
# be reproduced.
# Get list of libretro packages
for pkg in packages/lakka/retroarch_base/* packages/lakka/libretro_cores/*
do
pkg=$(basename ${pkg})
# Is there a folder for this package in sources?
if [ -d sources/${pkg} ]
then
# Is anything in that folder?
for dir in sources/${pkg}/${pkg}-*
do
# Is it a folder?
if [ -d ${dir} ]
then
# Skip in case a tarball was already created
if [ ! -f ${dir}.tar.xz ]
then
# Create a tarball in separate process, so the main loop does not change working directory
(
cd sources/${pkg}
name=$(basename ${dir})
echo $pkg - creating ${name}.tar.xz
tar -pcJf ${name}.tar.xz ${name}
)
fi
fi
done
fi
done

View file

@ -13,11 +13,12 @@ URL="https://nightly.builds.lakka.tv"
echo "Usage:"
echo "$0 <package>"
echo ""
echo "Downloads tarballs from ${URL} and extracts it in sources/<package> folder"
echo "Download tarball from ${URL} and store it in sources/<package> folder"
exit 1
}
PKG=${1}
PKG_PATH=""
# Check if there is such package
for FINDPATH in packages/lakka/retroarch_base/${PKG} packages/lakka/libretro_cores/${PKG} ; do
@ -41,14 +42,25 @@ done
# Import package properties
source ${PKG_PATH}/package.mk 2>&1 >/dev/null
# Check for package version
# Check for package version, URL and that URL is git repo
[ -z "${PKG_VERSION}" ] && {
echo "No PKG_VERSION set in ${PKG_PATH}/package.mk"
exit 4
}
[ -z "${PKG_URL}" ] && {
echo "No PKG_URL set in ${PKG_PATH}/package.mk"
exit 4
}
[ "${PKG_URL: -4}" = ".git" -o "${PKG_URL:0:6}" = "git://" ] || {
echo "PKG_URL (${PKG_URL}) is not a git repository"
exit 4
}
LINK=${URL}/sources/${PKG}/${PKG}-${PKG_VERSION}.tar.xz
FILENAME=sources/${PKG}/${PKG}-${PKG_VERSION}.tar.xz
STAMPFILE=${FILENAME}.gitstamp
# 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)
@ -57,6 +69,11 @@ FILENAME=sources/${PKG}/${PKG}-${PKG_VERSION}.tar.xz
exit 5
}
[ -f ${STAMPFILE} ] && {
echo "There is already ${STAMPFILE} - remove it and try again"
exit 5
}
# Create folder in case it does not exist already
if [ ! -d sources/${PKG} ]
then
@ -69,14 +86,11 @@ then
fi
fi
# Check if we have wget and tar
for PRG in wget tar
do
[ -z "$(which ${PRG} 2>/dev/null)" ] && {
echo "Please install ${PRG}"
exit 7
}
done
# Check if we have wget
[ -z "$(which ${PRG} 2>/dev/null)" ] && {
echo "Please install ${PRG}"
exit 7
}
# Download the tarball
echo "Downloading to ${FILENAME} ..."
@ -87,11 +101,13 @@ wget --quiet -O ${FILENAME} ${LINK}
exit 8
}
# Extract the tarball
echo "Extracting..."
tar xf ${FILENAME} -C sources/${PKG}
echo "Creating ${STAMPFILE} ..."
echo "${PKG_URL}|${PKG_VERSION}" > ${STAMPFILE}
[ ${?} -gt 0 ] && exit $?
[ ${?} -gt 0 ] && {
echo "Error creating ${STAMPFILE}"
exit 8
}
# And we are done
echo "Done"