2023-04-26 11:40:56 +02:00
#!/bin/bash
2022-03-14 19:35:39 +01:00
set -ex
oldwd = " $( pwd ) "
2023-09-25 16:13:11 +02:00
# cleanup old stuff
find -maxdepth 1 -type d -name 'element-web-*' | xargs rm -r
2022-03-14 19:35:39 +01:00
version = $( grep "Version:" element-web.spec | awk '{print $2}' )
2023-09-25 16:13:11 +02:00
last_packaged_version = $( osc cat devel:languages:nodejs/element-web/element-web.spec | grep "^Version:" | awk '{print $NF}' )
2022-07-07 14:27:33 +02:00
osc rm --force element-web-*.tar.gz || :
2022-03-14 19:35:39 +01:00
wget -c https://github.com/vector-im/element-web/archive/v${ version } .tar.gz -O element-web-${ version } .tar.gz
wget https://meet.element.io/libs/external_api.min.js -O jitsi_external_api.min.js
osc add element-web-*.tar.gz
#zypper install yarn cargo gcc-c++ sqlcipher-devel libsecret-devel
rm -rf " element-web- ${ version } "
tar xzvf element-web-${ version } .tar.gz
cd element-web-${ version }
2023-11-07 19:21:44 +01:00
changes = $( grep " ^Changes in \[ $last_packaged_version \] " -B10000 CHANGELOG.md | head -n -2 | sed -e '/^==*$/d' -e 's/Changes in \[\([^\[]*\)\].*/- Version \1/' -e 's/Changes in \[\([^\[]*\)\].*/- Version \1/' -e 's/^\([^-].*\)$/ \1/' -e 's/\[.*\](\(.*\))/\1/g' )
2022-03-14 19:35:39 +01:00
echo 'yarn-offline-mirror "./npm-packages-offline-cache"' > .yarnrc
yarn cache clean
rm -rf node_modules/
2022-09-27 23:28:47 +02:00
yarn install --pure-lockfile --ignore-engines || : # this will download tha packages into the offline cache
2022-03-14 19:35:39 +01:00
# download some additional dependencie that slips through this earlier method
cd ./npm-packages-offline-cache/
2022-07-20 11:16:14 +02:00
# fill sentry-cli cache with mock binaries for all architecutres
2022-03-14 19:35:39 +01:00
cd sentry-cli
sentry_cli_version = $( ls ../@sentry-cli-*.tgz | sed -e 's/.*cli-//' -e 's/.tgz//' )
2022-11-02 17:51:14 +01:00
for arch in i686 x86_64 aarch64 armv7 riscv64 ppc64 ppc64le s390x; do
2022-03-14 19:35:39 +01:00
url = " https://downloads.sentry-cdn.com/sentry-cli/ ${ sentry_cli_version } /sentry-cli-Linux- ${ arch } "
2022-07-20 11:16:14 +02:00
filehash = $( echo -n " $url " | md5sum | cut -c1-6)
2022-03-14 19:35:39 +01:00
target = " ${ filehash } -sentry-cli-Linux- ${ arch /_/- } "
2022-07-20 11:16:14 +02:00
#wget -O "$target" "$url"
echo '#!/bin/bash' > " $target "
echo '' >> " $target "
echo " echo ${ sentry_cli_version } " >> " $target "
2022-03-14 19:35:39 +01:00
chmod +x " $target "
done
cd ..
cd ..
tar czf npm-packages-offline-cache.tar.gz ./npm-packages-offline-cache
cp npm-packages-offline-cache.tar.gz " $oldwd / "
cd " $oldwd "
echo -e "\n\nDONE creating npm dependency offline cache file 'npm-packages-offline-cache.tar.gz'"
2022-09-27 23:28:47 +02:00
read -p "Write changes?"
2023-11-02 11:46:04 +01:00
osc vc -m " ${ changes } " element-web.changes