CDIST-TYPE__UNPACK(7)
π cdist-type__unpack β unpacking archives but make it cute β¨
okay bestie, welcome to cdist-type__unpack(7), part of the cdist manual set (section 7, the good section). this is the page where we learn how to unpack things. no cap. π«Ά
πΈ NAME πΈ
cdist-type__unpack β it unpacks archives. that's the whole job. and it eats. π
β¨ DESCRIPTION β¨
so like, this type unpacks all of these: .tar, .tgz, .tar.*, .7z, .bz2, .gz, .lzma, .xz, .rar and .zip archives. and how does it know which one you're throwing at it? by extension, bestie. it just reads the name and goes "oh okay i know what this is." π
and because we are β¨responsibleβ¨ and idempotent, a checksum file gets created in the target. the deets on that are in the --sum-file parameter, keep scrolling. π
π REQUIRED PARAMETERS π
destinationβ depends on the archive format, but basically: this is the file or the directory where the archive contents are gonna land. that's where the stuff goes. π
π¦ OPTIONAL PARAMETERS π¦
sum-fileβ override the archive's checksum file in the target. by default it'sXXX.cdist__unpack_sum, whereXXXis the source archive path. and listen: this file must be kept in the target's persistent storage. do not lose it, i'm begging. πtar-stripβ tarball specific, okay? go look atman tarfor--strip-components. that's the vibe. π§tar-extra-argsβ also tarball specific. this appends extra arguments onto thetarcommand. checkman tarfor what arguments you can actually use. β
π OPTIONAL BOOLEAN PARAMETERS π
backup-destinationβ by default the destination file just gets overwritten, no drama. and if the destination is a directory, files from the archive get added to it or overwritten inside it. but with this parameter? existing destination gets moved toXXX.cdist__unpack_backup_YYY, whereXXXis the destination andYYYis the current UNIX timestamp. cute little safety net. πpreserve-archiveβ don't delete the archive after unpacking. keep it. it's yours. πonchangeβ run this command after the unpack. that's it, that's the whole thing. π₯
π EXAMPLES π
okay now the fun part, watch and learn:
__directory /opt/cpma
require='__directory/opt/cpma' \
__download /opt/cpma/cnq3.zip \
--url https://cdn.playmorepromode.com/files/cnq3/cnq3-1.51.zip \
--sum md5:46da3021ca9eace277115ec9106c5b46
require='__download/opt/cpma/cnq3.zip' \
__unpack /opt/cpma/cnq3.zip \
--backup-destination \
--preserve-archive \
--destination /opt/cpma/server
# example usecase for --tar-* args
__unpack /root/strelaysrv.tar.gz \
--preserve-archive \
--destination /usr/local/bin \
--tar-strip 1 \
--tar-extra-args '--wildcards "*/strelaysrv"'
see how require chains them together? main character energy fr fr. π
π AUTHORS π
Ander Punnar <ander-at-kvlt-dot-ee> β thank you for your service, king. π«‘
π COPYING π
Copyright (C) 2020 Ander Punnar. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. periodt. π
π COPYRIGHT π
ungleich GmbH 2021 π¦
and that's the whole page bestie, go forth and unpack responsibly πΈ
this has been version 7.0.0 of the cdist manual, dated Jul 31, 2022, filed under CDIST-TYPE__UNPACK(7) β slay, bye!! β¨πβ¨
π¦ where this page comes from
- fedora 43: cdist 7.0.0-16.fc43 Β· GPL-3.0-only
- fedora 44: cdist 7.0.0-18.fc44 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms