From 6ca3b4a4ba95a41c61529353c9fbd05d4a53f071c2c5fa3cdde713080f785508 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Wed, 6 Nov 2024 16:00:02 +0000 Subject: [PATCH 1/2] - New upstream release 3.2.16 * Enable getNode to follow directory links (gh#electron/asar#248) OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/asar?expand=0&rev=29 --- .gitattributes | 23 ++++++++ .gitignore | 1 + asar.changes | 86 ++++++++++++++++++++++++++++++ asar.spec | 132 ++++++++++++++++++++++++++++++++++++++++++++++ prepare_vendor.sh | 77 +++++++++++++++++++++++++++ v3.2.10.tar.gz | 3 ++ v3.2.13.tar.gz | 3 ++ v3.2.16.tar.gz | 3 ++ vendor.tar.zst | 3 ++ 9 files changed, 331 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 asar.changes create mode 100644 asar.spec create mode 100644 prepare_vendor.sh create mode 100644 v3.2.10.tar.gz create mode 100644 v3.2.13.tar.gz create mode 100644 v3.2.16.tar.gz create mode 100644 vendor.tar.zst diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/asar.changes b/asar.changes new file mode 100644 index 0000000..a3aad6f --- /dev/null +++ b/asar.changes @@ -0,0 +1,86 @@ +------------------------------------------------------------------- +Wed Nov 6 15:52:11 UTC 2024 - Bruno Pitrus + +- New upstream release 3.2.16 + * Enable getNode to follow directory links (gh#electron/asar#248) + +------------------------------------------------------------------- +Wed Sep 11 08:00:37 UTC 2024 - Bruno Pitrus + +- New upstream release 3.2.13 + * Export a `default` property (gh#electron/asar#325) + +------------------------------------------------------------------- +Tue Sep 10 20:20:43 UTC 2024 - Bruno Pitrus + +- New upstream release 3.2.11 + * complete rewrite of the program in Typescript + * ensure symlinks do not write unexpectedly (gh#electron/asar#322) +- Run test suite in %check + +------------------------------------------------------------------- +Sun May 5 15:36:24 UTC 2024 - Bruno Pitrus + +- New upstream release 3.2.10 + * Fix relative link error (gh#electron/asar#308) + +------------------------------------------------------------------- +Wed Mar 6 20:58:00 UTC 2024 - Bruno Pitrus + +- New upstream version 3.2.9 + * fix symlink pointing error in filesystem.insertLink + +------------------------------------------------------------------- +Wed Nov 8 06:12:12 UTC 2023 - Bruno Pitrus + +- New upstream version 3.2.8 + * better error message when extracting a file that doesn't exist in the archive + +------------------------------------------------------------------- +Wed Sep 27 04:34:29 UTC 2023 - Bruno Pitrus + +- New upstream version 3.2.7 + * ensure that files/folders whose names are properties of Object.prototype are packaged/extracted correctly + +------------------------------------------------------------------- +Tue Sep 26 09:13:12 UTC 2023 - Bruno Pitrus + +- New upstream version 3.2.6 + * Don't overwrite existing folders + +------------------------------------------------------------------- +Tue Sep 19 17:12:27 UTC 2023 - Bruno Pitrus + +- New upstream version 3.2.5 + * properly handle rejections on `createPackageWithOptions` + +------------------------------------------------------------------- +Tue Jan 17 21:50:31 UTC 2023 - Bruno Pitrus +- New upstream version 3.2.3 + * fix bad output on unknown CLI command + * update vendored dependencies + +------------------------------------------------------------------- +Fri Nov 4 18:10:42 UTC 2022 - Bruno Pitrus +- New upstream version 3.2.2 + * Fix allowing nested empty directories. +- New upstream version 3.2.1 + * Rename package to @electron/asar +- Correct bogus “0.0.0-development” version reported by the program. + +------------------------------------------------------------------- +Tue Aug 16 15:09:07 UTC 2022 - Bruno Pitrus +- New upstream version 3.2.0 + * give better hints when failing due to bad links +- Use github tarball and use yarn to download vendored dependencies per yarn.lock + +------------------------------------------------------------------- +Thu Mar 03 00:00:00 UTC 2022 - Bruno Pitrus +- Resurrect package and update to 3.1.0 +- Use local-npm-registry to install dependencies + +------------------------------------------------------------------- +Sun Feb 14 15:11:12 UTC 2016 - i@marguerite.su + +- initial version 0.9.1 + diff --git a/asar.spec b/asar.spec new file mode 100644 index 0000000..115bd95 --- /dev/null +++ b/asar.spec @@ -0,0 +1,132 @@ +# +# spec file for package asar +# +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +Name: asar +Version: 3.2.16 +Release: 0 +Summary: Creating atom-shell (electron) app packages +License: MIT and ISC +Group: Development/Languages/NodeJS +Url: https://github.com/electron/asar +Source0: https://github.com/electron/asar/archive/refs/tags/v%{version}.tar.gz +# Created by prepare-vendor.sh +Source1: vendor.tar.zst +Source2: prepare_vendor.sh + +BuildArch: noarch + +BuildRequires: fdupes +BuildRequires: jq +BuildRequires: nodejs-packaging +%if 0%{?fedora} >= 37 +BuildRequires: nodejs-npm +%else +BuildRequires: npm +%endif +BuildRequires: typescript +BuildRequires: zstd + +%global __requires_exclude ^npm(.*)$ +Provides: nodejs-asar = %{version} +%description +Asar is a simple extensive archive format, it works like tar +that concatenates all files together without compression, while +having random access support. + + +%prep +%autosetup -p1 -a 1 +# Use system typescript for building +rm -rf node_modules/typescript +rm -v node_modules/.bin/ts{c,server} + +%build +export ELECTRON_SKIP_BINARY_DOWNLOAD=1 +npm rebuild --verbose --foreground-scripts +# tsc may return a non-zero exit code due to type warnings despite actually succesfully compiling the code. +# If it fails to compile, it will be catched anyway in #check. +tsc --removeComments --sourceMap false || true + +%install +mkdir -pv %{buildroot}%{nodejs_sitelib}/@electron +mkdir -pv %{buildroot}%{_bindir} +cp -lr . %{buildroot}%{nodejs_sitelib}/@electron/asar +ln -srv %{buildroot}%{nodejs_sitelib}/@electron/asar/bin/asar.js %{buildroot}%{_bindir}/asar +# symlink old package name +ln -srv %{buildroot}%{nodejs_sitelib}/{@electron/,}asar +#fix shebang +sed -i '1s/env //' %{buildroot}%{nodejs_sitelib}/@electron/asar/bin/asar.js +cd %{buildroot}%{nodejs_sitelib}/asar + +# Correct bogus version in package.json +jq -cj '.version="%{version}"' package.json > new + +#remove devdependencies +jq -cj 'del(.devDependencies)' package.json > tmp +mv -v tmp package.json +npm prune --omit=dev --verbose --ignore-scripts + +mv -v new package.json + + +#Remove development garbage +find -name example -print0 |xargs -r0 -- rm -rvf +find -name test -print0 |xargs -r0 -- rm -rvf +find -name typings -print0 |xargs -r0 -- rm -rvf +find -name @types -print0 |xargs -r0 -- rm -rvf +find -name .github -print0 |xargs -r0 -- rm -rvf +find -name .circleci -print0 |xargs -r0 -- rm -rvf +find -name '*.md' -type f -print -delete +find -name '*.markdown' -type f -print -delete +find -name '*.ts' -type f -print -delete +find -name '.*.yml' -type f -print -delete +find -name '.*ignore' -type f -print -delete +find -name 'snapcraft*' -type f -print -delete +find -name '.git*' -type f -print -delete +find -name yarn.lock -type f -print -delete +find -name '.yarn*' -type f -print -delete +find -name '*package-lock.json' -type f -print -delete +find -name '.prettierrc*' -type f -print -delete +find -name '.releaserc*' -type f -print -delete +find -name tsconfig.json -type f -print -delete + +# Remove empty directories +find . -type d -empty -print -delete + +%fdupes %{buildroot} + +%check +pushd %{buildroot}%{nodejs_sitelib}/asar +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Node.js/#_build_testing_in_check +%{__nodejs} -e 'require("./")' + +#check that the executable starts +./bin/asar.js -h +popd + +#the actual test suite +npx mocha -- --reporter spec --timeout 10000 + +%files +%defattr(-,root,root) +%doc CHANGELOG.md README.md +%license LICENSE.md +%{_bindir}/asar +%{nodejs_sitelib} + +%changelog diff --git a/prepare_vendor.sh b/prepare_vendor.sh new file mode 100644 index 0000000..6bbe806 --- /dev/null +++ b/prepare_vendor.sh @@ -0,0 +1,77 @@ +#!/bin/bash -eux + +ASAR_PKGDIR="$(pwd)" +ASAR_PKGVERSION=$(<./*.spec grep ^Version | sed -e 's/Version:[ ]*//g') +ASAR_URL="https://github.com/electron/asar/archive/refs/tags/v${ASAR_PKGVERSION}.tar.gz" +ASAR_TARBALL=v${ASAR_PKGVERSION}.tar.gz +ASAR_TMPDIR=$(mktemp --tmpdir -d asar-XXXXXXXX) +ASAR_PATH="$ASAR_TMPDIR/asar-$ASAR_PKGVERSION" + + + +echo "VERSION: $ASAR_PKGVERSION" +echo "PATH: $ASAR_PATH" + +cleanup_tmpdir() +{ + popd 2> /dev/null || exit 1 + rm -rf "$ASAR_TMPDIR" +} +trap cleanup_tmpdir SIGINT + +cleanup_and_exit() +{ + cleanup_tmpdir + if test "$1" = 0 -o -z "$1"; then + exit 0 + else + exit "$1" + fi +} + +if [ ! -w "$ASAR_TARBALL" ]; then + wget "$ASAR_URL" +fi + +tar -xf "$ASAR_TARBALL" -C "$ASAR_TMPDIR" + +pushd "$ASAR_PATH" || cleanup_and_exit 1 + + + +echo ">>>>>> Install npm modules" +yarn install --frozen-lockfile --ignore-engines --ignore-platform --ignore-scripts --link-duplicates +ret=$? +if [ $ret -ne 0 ]; then + echo "ERROR: yarn install failed" + cleanup_and_exit 1 +fi + +echo ">>>>>> Cleanup object files" +find node_modules/ -name "*.node" -print -delete +find node_modules/ -name "*.wasm" -print -delete +find node_modules/ -name "*.jar" -print -delete +find node_modules/ -name "*.dll" -print -delete +find node_modules/ -name "*.exe" -print -delete +find node_modules/ -name "*.dylib" -print -delete +find node_modules/ -name "*.so" -print -delete +find node_modules/ -name "*.o" -print -delete +find node_modules/ -name "*.a" -print -delete + + + +echo '>>>>>> Remove vendored binaries' +#We use sponge to avoid a race condition between find and rm +find . -type f| sponge |\ + xargs -P"$(nproc)" -- sh -c 'file "$@" | grep -v '\'': .*script'\'' | grep '\'': .*executable'\'' | tee /dev/stderr | sed '\''s/: .*//'\'' | xargs rm -fv' + +echo ">>>>>> Remove empty directories" +find . -type d -empty -print -delete + +echo ">>>>>> Package vendor files" +rm -f "${ASAR_PKGDIR}/vendor.tar.zst" +ZSTD_CLEVEL=19 ZSTD_NBTHREADS=$(nproc) tar --zstd --sort=name -vvScf "${ASAR_PKGDIR}/vendor.tar.zst" node_modules +if [ $? -ne 0 ]; then + cleanup_and_exit 1 +fi +echo "vendor $(du -sh "${ASAR_PKGDIR}/vendor.tar.zst")" diff --git a/v3.2.10.tar.gz b/v3.2.10.tar.gz new file mode 100644 index 0000000..43a73e6 --- /dev/null +++ b/v3.2.10.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1756c31e8cd42257081b81726b1489a3923709e4cbf86f7d377fab3870b1e26 +size 83884 diff --git a/v3.2.13.tar.gz b/v3.2.13.tar.gz new file mode 100644 index 0000000..9991705 --- /dev/null +++ b/v3.2.13.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ae3926ecbce6560d9f48948f18aee8ade7651f1ee319eb3e1538a1ffaa68ac8 +size 50236 diff --git a/v3.2.16.tar.gz b/v3.2.16.tar.gz new file mode 100644 index 0000000..134a17a --- /dev/null +++ b/v3.2.16.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:447386f1a35bb73afc8f0a26ac11bfe6e9e7a1740b4edced304d4a444814a4d7 +size 51818 diff --git a/vendor.tar.zst b/vendor.tar.zst new file mode 100644 index 0000000..251a2cf --- /dev/null +++ b/vendor.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5aa4dd64d712ac149ad88285ff95f55ba9c1331009a821f7be4c5459ddeab7b +size 5363148 From 7f5d4104cf657e766bddc0144c0480b5d4a76ae7d023f9234d2c22a7e641e5a4 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 7 Nov 2024 11:13:23 +0000 Subject: [PATCH 2/2] - New upstream release 3.2.17 * isUnpackedDir matches non-child directories that have same folder name prefix (gh#electron/asar#333) * checking if symlink with same prefix points outside the directory (gh#electron/asar#335) OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/asar?expand=0&rev=30 --- asar.changes | 7 +++++++ asar.spec | 2 +- v3.2.16.tar.gz | 3 --- v3.2.17.tar.gz | 3 +++ 4 files changed, 11 insertions(+), 4 deletions(-) delete mode 100644 v3.2.16.tar.gz create mode 100644 v3.2.17.tar.gz diff --git a/asar.changes b/asar.changes index a3aad6f..8c11922 100644 --- a/asar.changes +++ b/asar.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Nov 7 10:57:33 UTC 2024 - Bruno Pitrus + +- New upstream release 3.2.17 + * isUnpackedDir matches non-child directories that have same folder name prefix (gh#electron/asar#333) + * checking if symlink with same prefix points outside the directory (gh#electron/asar#335) + ------------------------------------------------------------------- Wed Nov 6 15:52:11 UTC 2024 - Bruno Pitrus diff --git a/asar.spec b/asar.spec index 115bd95..9e70c93 100644 --- a/asar.spec +++ b/asar.spec @@ -17,7 +17,7 @@ Name: asar -Version: 3.2.16 +Version: 3.2.17 Release: 0 Summary: Creating atom-shell (electron) app packages License: MIT and ISC diff --git a/v3.2.16.tar.gz b/v3.2.16.tar.gz deleted file mode 100644 index 134a17a..0000000 --- a/v3.2.16.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:447386f1a35bb73afc8f0a26ac11bfe6e9e7a1740b4edced304d4a444814a4d7 -size 51818 diff --git a/v3.2.17.tar.gz b/v3.2.17.tar.gz new file mode 100644 index 0000000..ba92e72 --- /dev/null +++ b/v3.2.17.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:260d57811d5bb8b7e19cd30af448dad832d25379080cbc8cbbcfcd64a1cd8140 +size 52182