Files
packages/anda/devs/backport/setup.sh
T
Raboneko 937323652d add: nodejs-backport (#5754) (#5757)
* add: nodejs-backport

* feat(update.rhai): Use NPM function



* fix: I have brain damage



---------


(cherry picked from commit 9644bf0316)

Signed-off-by: Gilver <rockgrub@disroot.org>
Co-authored-by: Gilver <rockgrub@disroot.org>
2025-07-03 16:29:02 +08:00

29 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/bash
## Some sources need to be fetched BEFORE the build process
# Also I'm just better at scripting in Bash and calling the Rhai sh function hundreds of times times sounded like hell
# Have I mentioned I hate runtime languages?
node=backport
# Enable logs for debugging
set -x
# I guess just $PWD doesn't work for this
builddir=$(pwd)/anda/devs/$node
# We only need the tests folder so sourcing the whole repo is overkill, Git can make a tarball of specific directories
pushd $builddir
ver=$(cat ./*.spec | grep -P -m1 'Version:' | sed -e 's/Version://g' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
url=$(sed -n 's/^URL:\s\(.*\)$/\1/p' ./*.spec | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e "s/%{module}/$node/")
dir=$node
git clone --recurse-submodules -j$(nproc) $url.git
pushd $dir
# I'm not sure why .tar.bz2 is the tar format of choice for this but it's also what Fedora does so it's what I'm doing
git archive --format=tar --prefix=tests/ v${ver}:src/test/ | bzip2 > ../tests-${ver}.tar.bz2
popd
rm -rf $dir
exit 0