CommonsBase_Std.Apparatus@0.1.0
We'll make a nano-sized tarball for testing the tarball extraction rules.
... The tarball contains a single file "somefile" with the content "hello world".
... The tarball was created with macOS `bsdtar 3.5.3 - libarchive 3.7.4 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8`
... with the command `tar -cf nano.tar somefile`.
% unified.asset { name="Nano", file="nano.tar" }
'asset'
'2048'
'sha256:791b8d0be20f8dfa6b7c08f6d16909c693a5f3aadbb0db4d846b32193184bbd9'
nano.tbz is nano.tar compressed with Python 3.14 `bz2` (bzip2), exercising
... the short `.tbz` tarball suffix added in Extract@0.2.1.
% unified.asset { name="NanoTbz", file="nano.tbz" }
'asset'
'140'
'sha256:16a9a8808c71311df9eb5c5fc092561b3701d469310a7b1b48d5f2c5301d54e3'
nano.tar.zst is nano.tar compressed with Python 3.14 `compression.zstd`
... (Zstandard), exercising the `.tar.zst` support added in Extract@0.3.0.
% unified.asset { name="NanoZst", file="nano.tar.zst" }
'asset'
'116'
'sha256:56966bc7b38d3fa21de2db5c227c225db7499420bff4498937d2ff6c39910b6f'
This is a function rule that untars a tar, tar.gz, tar.xz or tar.bz2 file.
### Configurations
One of the following sets of options must be provided:
- tarmodver= tarassetpath= modver= paths[]=
### Options
- tarmodver=CommonsBase_Std.Apparatus.Nano@0.1.0
The bundle containing the tar, tar.gz, tar.xz or tar.bz2 file.
- tarassetpath=nano.tar
The asset path within the bundle of the tar, tar.gz, tar.xz or tar.bz2
file to extract.
- modver=OurTest_Std.Extract@0.1.0
The MODULE@VERSION of the form object that will contain the extracted files.
The slot for the form object will be `Release.Agnostic`.
- paths[]=README.md
All of the extracted paths.
A future version may extract only the specified paths,
but for now we extract all files and expect you to declare them all.
### FAQ
#### Q1: Platforms?
On macOS the /usr/bin/tar system binary is used.
On Linux the toybox tar command is fetched from an asset and used.
On Windows the 7z.exe from S7z command is fetched from an asset and used.
Also, for F_TarToZip: (macOS) /usr/bin/zip. (Others) the S7z object.
#### Q2: There is no way to filter which files I want.
*FUTURE* This rule will be renamed to CommonsBase_Std.Extract0, and the new CommonsBase_Std.Extract
will run CommonsBase_Std.Fd on the extracted files to filter them. The split is because
CommonsBase_Std.Fd requires CommonsBase_Std.Extract0.
### Examples
$ post-object CommonsBase_Std.Extract.F_Untar@0.1.0 -f ${RUNTIME}/Extract.F_Untar.untar.zip
> modver=OurTest_Std.CommonsBase.Std.Extract.F_Untar@0.1.0
> tarmodver=CommonsBase_Std.Apparatus.Nano@0.1.0 tarassetpath=nano.tar
> 'paths[]=somefile'
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "ogwakcx2lgsdsq6xh4bctezlzphi5pc754dda2vmqwhyrydyopcva")\;
This is a function rule that untars a tar, tar.gz, tar.xz or tar.bz2 file,
extracting only the specified `paths[]`.
### Configurations
One of the following sets of options must be provided:
- tarmodver= tarassetpath= modver= paths[]=
### Options
- tarmodver=CommonsBase_Std.Apparatus.Nano@0.1.0
The bundle containing the tar, tar.gz, tar.xz or tar.bz2 file.
- tarassetpath=nano.tar
The asset path within the bundle of the tar, tar.gz, tar.xz or tar.bz2
file to extract.
- modver=OurTest_Std.Extract@0.2.0
The MODULE@VERSION of the form object that will contain the extracted files.
The slot for the form object will be `Release.Agnostic`.
- paths[]=somefile
The paths to extract from the tarball.
Only the specified paths are extracted (unlike @0.1.0 which extracts all files).
### FAQ
#### Q1: Platforms?
On macOS the /usr/bin/tar system binary is used.
On Linux the toybox tar command is fetched from an asset and used.
On Windows the 7z.exe from S7z command is fetched from an asset and used.
### Examples
$ post-object CommonsBase_Std.Extract.F_Untar@0.2.0 -f ${RUNTIME}/Extract.0_2_0.F_Untar.untar.zip
> modver=OurTest_Std.CommonsBase.Std.Extract.F_Untar@0.2.0
> tarmodver=CommonsBase_Std.Apparatus.Nano@0.1.0 tarassetpath=nano.tar
> 'paths[]=somefile'
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "ow6dl7i4ulnnbqhzappornsoxaackj5nxspkc2u5a25yrz4mb655q")\;
-- (Function rule) Same as @0.2.0 plus the short tarball suffixes `.tgz`,
-- `.txz` and `.tbz` that GitHub release tarballs commonly use.
$ post-object CommonsBase_Std.Extract.F_Untar@0.2.1 -f ${RUNTIME}/Extract.0_2_1.F_Untar.untar.zip
> modver=OurTest_Std.CommonsBase.Std.Extract.F_Untar@0.2.1
> tarmodver=CommonsBase_Std.Apparatus.NanoTbz@0.1.0 tarassetpath=nano.tbz
> 'paths[]=somefile'
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "oguwyhh6mr4nq3x7j5nweu7remp4z5thqmbwfiay5mm2i4crtsjaa")\;
-- (Function rule) Same as @0.2.1 plus Zstandard `.tar.zst` tarballs (e.g.
-- msys2 `.pkg.tar.zst` packages). zst archives are decompressed with 7-Zip
-- (S7z 25.01) on every platform, then the plain tar is extracted.
$ post-object CommonsBase_Std.Extract.F_Untar@0.3.0 -f ${RUNTIME}/Extract.0_3_0.F_Untar.untar.zip
> modver=OurTest_Std.CommonsBase.Std.Extract.F_Untar@0.3.0
> tarmodver=CommonsBase_Std.Apparatus.NanoZst@0.1.0 tarassetpath=nano.tar.zst
> 'paths[]=somefile'
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "obk7ys2uvsincpnssai56y2mwrqtym65sxbuuyazdlyhzzk3ultca")\;
-- (Function rule) Extracts a tar, tar.gz, tar.xz or tar.bz2 file and then re-compresses it
-- to a .zip file which has first-class support in the dk build system.
### Configurations
One of the following sets of options must be provided:
- tarmodver= tarassetpath= modver=
### Options
- tarmodver=CommonsBase_Std.Apparatus.Nano@0.1.0
The bundle containing the tar, tar.gz, tar.xz or tar.bz2 file.
- tarassetpath=nano.tar
The asset path within the bundle of the tar, tar.gz, tar.xz or tar.bz2
file to extract.
- modver=OurTest_Std.Extract@0.1.0
The MODULE@VERSION of the form object that will contain the "output.zip" file.
The slot for the form object will be `Release.Agnostic`.
### FAQ
#### Q1: Platforms?
On macOS the /usr/bin/tar system binary is used.
On Linux the toybox tar command is fetched from an asset and used.
On Windows the 7z.exe from S7z command is fetched from an asset and used.
On macOS: /usr/bin/zip
Others: the S7z object
### Examples
$ post-object CommonsBase_Std.Extract.F_TarToZip@0.1.0 -f ${RUNTIME}/Extract.F_TarToZip.tartozip.zip
> tarmodver=CommonsBase_Std.Apparatus.Nano@0.1.0 tarassetpath=nano.tar
> modver=OurTest_Std.CommonsBase.Std.Extract.F_TarToZip@0.1.0
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "oebuetlubxcwtghloymdkcloxvcpwzwp766hs3zupgeysmkcbz46q")\;
-- (Function rule) Same as @0.1.0 but distributed under a new version so consumers can
-- reference the source-files fix (`7z a output.zip *`) unambiguously.
$ post-object CommonsBase_Std.Extract.F_TarToZip@0.1.1 -f ${RUNTIME}/Extract.0_1_1.F_TarToZip.tartozip.zip
> tarmodver=CommonsBase_Std.Apparatus.Nano@0.1.0 tarassetpath=nano.tar
> modver=OurTest_Std.CommonsBase.Std.Extract.F_TarToZip@0.1.1
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "onkbnqbrkm47axaavuopr6kcvwyrcfgrrqxozrs2oae36j7jqkh5a")\;
-- (Function rule) Extracts a tar, tar.gz, tar.xz or tar.bz2 file and then re-compresses it
-- to a .zip file which has first-class support in the dk build system.
### Configurations
One of the following sets of options must be provided:
- tarmodver= tarassetpath= modver=
### Options
- tarmodver=CommonsBase_Std.Apparatus.Nano@0.1.0
The bundle containing the tar, tar.gz, tar.xz or tar.bz2 file.
- tarassetpath=nano.tar
The asset path within the bundle of the tar, tar.gz, tar.xz or tar.bz2
file to extract.
- modver=OurTest_Std.Extract@0.2.0
The MODULE@VERSION of the form object that will contain the "output.zip" file.
The slot for the form object will be `Release.Agnostic`.
### FAQ
#### Q1: Platforms?
On macOS the /usr/bin/tar system binary is used.
On Linux the toybox tar command is fetched from an asset and used.
On Windows the 7z.exe from S7z command is fetched from an asset and used.
On macOS: /usr/bin/zip
Others: the S7z object
### Examples
$ post-object CommonsBase_Std.Extract.F_TarToZip@0.2.0 -f ${RUNTIME}/Extract.0_2_0.F_TarToZip.tartozip.zip
> tarmodver=CommonsBase_Std.Apparatus.Nano@0.1.0 tarassetpath=nano.tar
> modver=OurTest_Std.CommonsBase.Std.Extract.F_TarToZip@0.2.0
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "ov4qyssaeosawwgodewco7vwdpp7uobuk3bywebxmqdhqbwt5t4ta")\;
-- (Function rule) Same as @0.2.0 plus the short tarball suffixes `.tgz`,
-- `.txz` and `.tbz` that GitHub release tarballs commonly use.
$ post-object CommonsBase_Std.Extract.F_TarToZip@0.2.1 -f ${RUNTIME}/Extract.0_2_1.F_TarToZip.tartozip.zip
> tarmodver=CommonsBase_Std.Apparatus.NanoTbz@0.1.0 tarassetpath=nano.tbz
> modver=OurTest_Std.CommonsBase.Std.Extract.F_TarToZip@0.2.1
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "o5yhnhye47kerbb2zpky4qocfmjesmn52as2jpwshliojmokobmxq")\;
-- (Function rule) Same as @0.2.1 plus Zstandard `.tar.zst` tarballs (e.g.
-- msys2 `.pkg.tar.zst` packages). zst archives are decompressed with 7-Zip
-- (S7z 25.01) on every platform, then the plain tar is extracted.
$ post-object CommonsBase_Std.Extract.F_TarToZip@0.3.0 -f ${RUNTIME}/Extract.0_3_0.F_TarToZip.tartozip.zip
> tarmodver=CommonsBase_Std.Apparatus.NanoZst@0.1.0 tarassetpath=nano.tar.zst
> modver=OurTest_Std.CommonsBase.Std.Extract.F_TarToZip@0.3.0
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "ovqfrus6tvaoviea3cb7tqninlu77dytu4pksaqbe6etzybnq4vma")\;
CommonsBase_Std.S7z.S7zr@25.1.0
get-object CommonsBase_Std.S7z.S7zr@25.1.0 -s Release.Windows_x86_64 -f ${RUNTIME}/Windows_x86_64-S7z.S7zr-25.1.0.zip
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "omrbpfrtafh6zxpg5bqedlllfv4lksqbuz7owdvb7zbpngf4rtqxq")\;
CommonsBase_Std.S7z.Windows7zExe@25.1.0
get-object CommonsBase_Std.S7z.Windows7zExe@25.1.0 -s Release.Windows_x86_64 -f ${RUNTIME}/Windows_x86_64-S7z.Windows7zExe-25.1.0.zip
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "oidy4tvmgsg6r66abhighni7o3rfhgas6vm7hdorff3ff6lpaxafa")\;
CommonsBase_Std.Coreutils@0.6.0
get-object CommonsBase_Std.Coreutils@0.6.0 -s Release.Windows_x86 -f ${RUNTIME}/Windows_x86-Coreutils-0.6.0.zip
\test(pass)
\dk.object(abi: "Release.Windows_x86", value-id: "o4x2eiiorcutlwudpzskhkuv4squaowx7k3jizpa3fqzym5kccnpa")\;
$ get-object CommonsBase_Std.Coreutils@0.6.0 -s Release.Windows_x86_64 -f ${RUNTIME}/Windows_x86_64-Coreutils-0.6.0.zip
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "oeeb4glfxzwocwyfoafmtwersr7ps7rzp46swuzycrfphvgo42pgq")\;
$ get-object CommonsBase_Std.Coreutils@0.6.0 -s Release.Windows_arm64 -f ${RUNTIME}/Windows_arm64-Coreutils-0.6.0.zip
\test(pass)
\dk.object(abi: "Release.Windows_arm64", value-id: "oq6pd45ld7blvz6abbbbewujmpijortgi5v2cscw5qexoqzndraiq")\;
$ get-object CommonsBase_Std.Coreutils@0.6.0 -s Release.Darwin_arm64 -f ${RUNTIME}/Darwin_arm64-Coreutils-0.6.0.zip
\test(pass)
\dk.object(abi: "Release.Darwin_arm64", value-id: "ozp45xqbnovbf2uh2yc2i6gxsmtabklsuveo2pkwhhamow5hlmqga")\;
$ get-object CommonsBase_Std.Coreutils@0.6.0 -s Release.Darwin_x86_64 -f ${RUNTIME}/Darwin_x86_64-Coreutils-0.6.0.zip
\test(pass)
\dk.object(abi: "Release.Darwin_x86_64", value-id: "opcyz7wvadzhkgeniwpbcqlcl2llceyavjvqa3whnte5xcqhv5boa")\;
$ get-object CommonsBase_Std.Coreutils@0.6.0 -s Release.Linux_x86 -f ${RUNTIME}/Linux_x86-Coreutils-0.6.0.zip
\test(pass)
\dk.object(abi: "Release.Linux_x86", value-id: "oqc2isixpzircvrpvgxejoy7ch3mfagiqm4tojhqbkiepw7lw7egq")\;
$ get-object CommonsBase_Std.Coreutils@0.6.0 -s Release.Linux_x86_64 -f ${RUNTIME}/Linux_x86_64-Coreutils-0.6.0.zip
\test(pass)
\dk.object(abi: "Release.Linux_x86_64", value-id: "ocdca5ujbqtgb27pkild4cbp5w735f53xcjbbovyiqsn3zfhczevq")\;
CommonsBase_Std.Coreutils@0.8.0
get-object CommonsBase_Std.Coreutils@0.8.0 -s Release.Windows_x86 -f ${RUNTIME}/Windows_x86-Coreutils-0.8.0.zip
\test(pass)
\dk.object(abi: "Release.Windows_x86", value-id: "otqheq5u2b4k26xgd5zxdbzuzy72rn3qzwh5nv7a2vgsnks3pinuq")\;
$ get-object CommonsBase_Std.Coreutils@0.8.0 -s Release.Windows_x86_64 -f ${RUNTIME}/Windows_x86_64-Coreutils-0.8.0.zip
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "oqiaoje7bprazhsiazgb6q4aseb2dsokknyel5nxk42js7ko5ymfa")\;
$ get-object CommonsBase_Std.Coreutils@0.8.0 -s Release.Windows_arm64 -f ${RUNTIME}/Windows_arm64-Coreutils-0.8.0.zip
\test(pass)
\dk.object(abi: "Release.Windows_arm64", value-id: "ojg6enprk6nvhdaf7eu5mzptilipl6vvw7jsm2ulwd65uxb7yuc3a")\;
$ get-object CommonsBase_Std.Coreutils@0.8.0 -s Release.Darwin_arm64 -f ${RUNTIME}/Darwin_arm64-Coreutils-0.8.0.zip
\test(pass)
\dk.object(abi: "Release.Darwin_arm64", value-id: "owwqejdtjm6dxqvx42feorne63biqjgl2vkte26ke2yseezpooata")\;
$ get-object CommonsBase_Std.Coreutils@0.8.0 -s Release.Darwin_x86_64 -f ${RUNTIME}/Darwin_x86_64-Coreutils-0.8.0.zip
\test(pass)
\dk.object(abi: "Release.Darwin_x86_64", value-id: "ozlttwplgod2t62owbesc7zbfktpekuujnvfsmsxsodbgphrbbdsa")\;
$ get-object CommonsBase_Std.Coreutils@0.8.0 -s Release.Linux_x86 -f ${RUNTIME}/Linux_x86-Coreutils-0.8.0.zip
\test(pass)
\dk.object(abi: "Release.Linux_x86", value-id: "ofdmwhm2eujwwtj6v4vlj4fw3dzh5up7mr4nmqmrue2p6raxisw4q")\;
$ get-object CommonsBase_Std.Coreutils@0.8.0 -s Release.Linux_x86_64 -f ${RUNTIME}/Linux_x86_64-Coreutils-0.8.0.zip
\test(pass)
\dk.object(abi: "Release.Linux_x86_64", value-id: "ouseggrbtwbjzamsezkli5zfqcrbn56vugb27afoygwxyrs5hpssq")\;
CommonsBase_Std.S7z@25.1.0
get-object CommonsBase_Std.S7z@25.1.0 -s Release.Windows_x86 -f ${RUNTIME}/Windows_x86-S7z-25.1.0.zip
\test(pass)
\dk.object(abi: "Release.Windows_x86", value-id: "oveit6hk3udlgfdyappjljamx5wzouth3io7vku33n7b2c5p55kaq")\;
$ get-object CommonsBase_Std.S7z@25.1.0 -s Release.Windows_x86_64 -f ${RUNTIME}/Windows_x86_64-S7z-25.1.0.zip
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "o5mb23c4fl2lfrp5wkx2vrfdwozboycnaujszxgvjzmrruaeckteq")\;
$ get-object CommonsBase_Std.S7z@25.1.0 -s Release.Darwin_arm64 -f ${RUNTIME}/Darwin_arm64-S7z-25.1.0.zip
\test(pass)
\dk.object(abi: "Release.Darwin_arm64", value-id: "o3rjaq2ttslavbw2sbmzu73ci5ykwkv3ucxr4lotw2zdrtrov3ooa")\;
$ get-object CommonsBase_Std.S7z@25.1.0 -s Release.Darwin_x86_64 -f ${RUNTIME}/Darwin_x86_64-S7z-25.1.0.zip
\test(pass)
\dk.object(abi: "Release.Darwin_x86_64", value-id: "ozd5dtc6qoq6tzsw64bq3m6u6mraeo2iwr4sansaean2a76ryqgma")\;
$ get-object CommonsBase_Std.S7z@25.1.0 -s Release.Linux_x86 -f ${RUNTIME}/Linux_x86-S7z-25.1.0.zip
\test(pass)
\dk.object(abi: "Release.Linux_x86", value-id: "oadiazkagar5ujlfar4rjzeuhoid6kzu2cu7xx4zidht6l3wbqd4a")\;
$ get-object CommonsBase_Std.S7z@25.1.0 -s Release.Linux_x86_64 -f ${RUNTIME}/Linux_x86_64-S7z-25.1.0.zip
\test(pass)
\dk.object(abi: "Release.Linux_x86_64", value-id: "onnl6wax56e3cdsika2z5frbgrc7va5otzux2k6nk3fy5fihcdtya")\;
CommonsBase_Std.Fd@10.3.0
get-object CommonsBase_Std.Fd@10.3.0 -s Release.Windows_x86 -f ${RUNTIME}/Windows_x86-Fd-10.3.0.zip
\test(pass)
\dk.object(abi: "Release.Windows_x86", value-id: "oh2ngfb7frxc6qlntk6jus3sx43n3f3y2lsssh56uzayqdbjedaxq")\;
$ get-object CommonsBase_Std.Fd@10.3.0 -s Release.Windows_x86_64 -f ${RUNTIME}/Windows_x86_64-Fd-10.3.0.zip
\test(pass)
\dk.object(abi: "Release.Windows_x86_64", value-id: "oitdqywet7t4udxs67phrr64ejqxbmwljyzg62ugoauchayrojsiq")\;
$ get-object CommonsBase_Std.Fd@10.3.0 -s Release.Darwin_arm64 -f ${RUNTIME}/Darwin_arm64-Fd-10.3.0.zip
\test(pass)
\dk.object(abi: "Release.Darwin_arm64", value-id: "onx5bdkqmwicqioecx6toseckon5dj4oidsjnrbo74xuj72idhehq")\;
$ get-object CommonsBase_Std.Fd@10.3.0 -s Release.Darwin_x86_64 -f ${RUNTIME}/Darwin_x86_64-Fd-10.3.0.zip
\test(pass)
\dk.object(abi: "Release.Darwin_x86_64", value-id: "or3vjzrw5tdvay7ucdtpw33hfxayimrcckcurikhz7pdveu2gapma")\;
$ get-object CommonsBase_Std.Fd@10.3.0 -s Release.Linux_x86 -f ${RUNTIME}/Linux_x86-Fd-10.3.0.zip
\test(pass)
\dk.object(abi: "Release.Linux_x86", value-id: "orv36s6qiv2wtqhhakdfxfz7kdihpupkel5fi3w2cqcf66qlrchpa")\;
$ get-object CommonsBase_Std.Fd@10.3.0 -s Release.Linux_x86_64 -f ${RUNTIME}/Linux_x86_64-Fd-10.3.0.zip
\test(pass)
\dk.object(abi: "Release.Linux_x86_64", value-id: "or6jw6c7cxudz6iyop57swgkc3eftrbpu3trkwsztojoxy4pc7kjq")\;
$ get-object CommonsBase_Std.Fd@10.3.0 -s Release.Linux_arm64 -f ${RUNTIME}/Linux_arm64-Fd-10.3.0.zip
\test(pass)
\dk.object(abi: "Release.Linux_arm64", value-id: "oykvy6jxxxytqol4spd4nmztmgroe2obqwhunaqojxam7tvso6vpa")\;
CommonsBase_Std.Toybox@0.8.9
get-object CommonsBase_Std.Toybox@0.8.9 -s Release.Linux_arm64 -f ${RUNTIME}/Linux_arm64-Toybox-0.8.9.zip
\test(pass)
\dk.object(abi: "Release.Linux_arm64", value-id: "ovjtioocfu6zsmlaxp2zgsuubc7u2uss7hofkh5s4a7itpyt5t4qa")\;
$ get-object CommonsBase_Std.Toybox@0.8.9 -s Release.Linux_x86_64 -f ${RUNTIME}/Linux_x86_64-Toybox-0.8.9.zip
\test(pass)
\dk.object(abi: "Release.Linux_x86_64", value-id: "ol57g3xbdem35k2lwezwphnvpflacuzpg4vlkprfimuwmkf46r5fq")\;
$ get-object CommonsBase_Std.Toybox@0.8.9 -s Release.Linux_x86 -f ${RUNTIME}/Linux_x86-Toybox-0.8.9.zip
\test(pass)
\dk.object(abi: "Release.Linux_x86", value-id: "ooytmndsq6evduyg4y2qhgxjpgubyunkyvd6npi3m3fxivyqkookq")\;