Date: Sat, 25 Jul 2020 17:15:53 -0400 From: Lonnie Cumberland <lonnie@outstep.com> To: Polytropon <freebsd@edvax.de> Cc: freebsd-questions@freebsd.org Subject: Re: tbz file from pkg Message-ID: <CAPmsJLAYACVmXF%2BpzeBosP8AT8n8ewY7%2BDGtHeSezB_8EP2zBg@mail.gmail.com> In-Reply-To: <CAPmsJLAdK-1aS8r6=oB253ooZyaL2Q6GMNG-sAJBdR_KEXoGRg@mail.gmail.com> References: <CAPmsJLC0yTtek8AKo6r_XL8yt_9dCNvGs1jyVyOTu6g9N7YziA@mail.gmail.com> <20200725203801.9a4965b8.freebsd@edvax.de> <CAPmsJLAdK-1aS8r6=oB253ooZyaL2Q6GMNG-sAJBdR_KEXoGRg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi All, I find that I do not need a fully blown shell script, so I cobbled together a single set of shell commands that will convert "*.txz" file to "*.tbz" files and it seems to work. # find *txz -iname '*txz' | while read txz; do echo "Found: $txz"; name=$(echo "$txz" | sed -e 's/\.[^.]*$//'); mkdir -p tmp/$name; tar -xjf $txz -C tmp/$name; cd tmp/$name; tar cvfj ../../$name.tbz .; cd ../..; rm -Rf tmp/$name; rm -Rf tmp; done maybe it will be of help to others as well. Cheers and have a great weekend, Lonnie On Sat, Jul 25, 2020 at 4:23 PM Lonnie Cumberland <lonnie@outstep.com> wrote: > Thanks All, > > Since the pkg command returns txz (tar+xz) compressed files during a > fetch, I am going to try to come up with a shell script that will loop > through all of the txz files in a folder and convert each one to a tbz > (tar+bzip2) compressed file. > > I think that might be helpful to others as well. > Cheers > > On Sat, Jul 25, 2020 at 2:38 PM Polytropon <freebsd@edvax.de> wrote: > >> On Sat, 25 Jul 2020 13:25:19 -0400, Lonnie Cumberland wrote: >> > In working with the "pkg fetch .." command, I notice that the coles come >> > back with the ".txz" extension. >> > >> > In my reading on FreeBSD, it seems that the common extension is a ".tbz" >> >> Those extensions mean different things. >> >> >> >> > So then, I am wondering how to either have "pkg fetch" return ".tbz" >> files >> > or perhaps there is a way to convert the ".txz" files. >> > >> > Any insight on this? >> >> The extensions usually identify what 't' that is is a tar >> archive, and "xz" indicates the kind of compression. There >> are many: >> >> ----- filename extensions ----- ------- compression -------- >> short long alternate meaning tar option >> ------------------------------------------------------------ >> .tar tar >> .tgz .tar.gz tar + GNU zip -z >> .tbz .tar.bz .tar.bz2 tar + bzip -j >> .txz .tar.xz tar + xz -J >> >> BSD tar supports them all, it can conveniently combine the >> uncompression and extraction operations. >> >> Also see "man 1 xz" and "man 1 bzip2" for details, as well >> as "man 1 tar", of course. :-) >> >> In order to convert a .txz to a .tbz archive, you can use >> the tools mentioned above to uncompress and recompress the >> content. Note that there are various options that can affect >> the compression level. >> >> >> -- >> Polytropon >> Magdeburg, Germany >> Happy FreeBSD user since 4.0 >> Andra moi ennepe, Mousa, ... >> >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPmsJLAYACVmXF%2BpzeBosP8AT8n8ewY7%2BDGtHeSezB_8EP2zBg>