[Gambas-user] UnCompress question

Bruce Steers bsteers4 at gmail.com
Tue Sep 13 12:14:45 CEST 2022


On Mon, 12 Sept 2022 at 10:55, Benoit Minisini <
benoit.minisini at gambas-basic.org> wrote:

> Le 12/09/2022 à 11:37, Bruce Steers a écrit :
> >
> >
> > On Sun, 11 Sept 2022 at 15:35, Bruce Steers <bsteers4 at gmail.com
> > <mailto:bsteers4 at gmail.com>> wrote:
> >
> >
> >
> >
> >     On Sat, 10 Sept 2022 at 15:12, Benoit Minisini
> >     <benoit.minisini at gambas-basic.org
> >     <mailto:benoit.minisini at gambas-basic.org>> wrote:
> >
> >         Le 10/09/2022 à 14:25, Bruce Steers a écrit :
> >          >     Yes. 'gb.compress' is for compressing, not archiving.
> >          >
> >          >     If you want to create compressed archives, use the
> >         command-line tools.
> >          >
> >          >     Regards,
> >          >
> >          >     --
> >          >     Benoît Minisini.
> >          >
> >          >
> >          > Ahh , very well
> >          > I see there's /main/gbc/gbc_archive.c but it looks
> >         internal/private is
> >          > there too much to do to update Uncompress to support listing
> and
> >          > extracting items or can gbc_archive be modified to extract
> >         items and
> >          > work publicly?
> >          >
> >          > I assume gambas itself (gbc) can unarchive because a gambas
> >         exe is an
> >          > archive (or am i wrong about that and it works differently?)
> >          >
> >          > Note: not interested in adding/making archives just
> extracting.
> >          >
> >          > Reason: I'm adding an update class to my progs that uses
> gitlab,
> >          > It checks version in .project file and downloads the archive
> >         if newer,
> >          > then extracts contents to update/compile source.
> >          >
> >          > Respects
> >          > BruceS
> >          >
> >
> >         I really don't see the problem with using SHELL or EXEC with
> 'zip',
> >         'tar', and so on.
> >
> >
> >     aah fair enough.  Shell or Exec it is then :)
> >     Respects
> >     BruceS
> >
> >
> >
> > Maybe we (i could have a go) could expand Shell in gb.util a bit to be
> > more than MkDir, RmDir, Move?
> > (btw. i am considering Shell.class to be where we would put some
> > functions that are just for Shell/Exec use)
> >
> > Things i think (have previously thought) would be useful Shell commands
> > for everyone to have in gambas...
> >
> > Shell.ArchiveList(ArchivePath) As String[] '  could auto-handle various
> > filetypes.
> > Shell.ArchiveExtract(ArchivePath, DestFolder, Optional FileList As
> String[])
> > Shell.ArchiveAdd(ArchivePath, FileList As String[])
> >
> > Shell.PackageInstall(PkgName) ' basic installer that will handle most
> > installers and be fine for simple package names, returning error code if
> > any.
> > Eg.  Shell.PackageInstall("git")
> >
> > Some multi-platform compatible functions like this
> >
> > just some food for thought :)
> > Respects
> > BruceS
> >
>
> Not in 'gb.util', which cannot depend on any external library, and
> should not depend on external tools. 'gb.util' is only for adding less
> common small functions and features to the language.
>
> A common interface to the underlying various archive tools should have
> its own component.
>
> Installing package is something entirely system et distribution
> specific, so it should have its own component too.
>
> Moreover, this feature seems to have already been standardized with
> 'PackageKit', so maybe one should look at it first.
>
> Regards,
>
> --
> Benoît Minisini.
>

Aah yes, my understanding of the purpose of gb.util was incorrect.
so components like gb.archiver and gb.packager

Looking at PackageKit the main page mentions it's lack of functionality in
a few areas , like dependencies for example.
Quote: https://www.freedesktop.org/software/PackageKit/pk-faq.html

How does PackageKit handle dependencies?
PackageKit does not do dependency resolution. This problem has already been
solved by the backend systems and we don't really want to re-invent the
wheel.
PackageKit does not have the fine-grained API to do everything. For
instance, synaptic should still use libapt as can do much more than can be
provided by PackageKit.
So possibly using the backends is the way to go?
backends and functionality are listed here..
https://www.freedesktop.org/software/PackageKit/pk-matrix.html
only aptcc alpm entropy poldek portage slapt dnf zypp
Maybe gambas environment is available to other pkg installers too?
I'll look into it and see if i can make something simple (non bloated)

As for archiving i think yes a simple Archiver class/component that's a
common interface to support various popular archive types automatically
could also be useful to many.

Cheers Ben
Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220913/814e2aa9/attachment.htm>


More information about the User mailing list