• Question on installing packages via the Python APT library

    From Hunter Wittenborn@21:1/5 to All on Mon Nov 8 00:30:01 2021
    Hi! I'm currently working on a project that's going to be using the Python APT library to handle some package installation, but I've got a question on how exactly a certain thing is working:



    I've gotten everything up to the actual installation of packages done (up to the point of calling 'DepCache.commit()', but once I get to the 'commit()' stage I can't figure out how to control the output of the 'commit()' call in a way I'm wanting.



    Going with the two classes that are specified for the 'commit()' function, I currently have the following implemented (I haven't exactly figured out what to put in each one yet, as I'm still trying to figure out all how this step works):



    acquire_progress: https://gist.github.com/hwittenborn/56fa689b86396a904155e4b1b5be817a

    install_progress: https://gist.github.com/hwittenborn/0eb762abdfeb96e2c1cbf4f5b6a975f3



    The 'tap.message' library being used inside both of those classes is just a message system for my program, they don't do anything particularly important that would affect anything at all.



    The acquire_progress stage *appears* to be working fine, though the packages I downloaded were quite small so I didn't really get a chance to see if it just did some weird stuff like with install progress;



    The problem with install_progress is that it's exiting my program, and then proceeding with installing packages, as if it starts installing packages in the background. How exactly should I go about waiting for it to finish though?



    On a side note, I'm seeing this text whenever it (presumably) gets to the install part:



    """



    custom fork found

    got pid: 31873

    got pid: 0

    got fd: 4

    """



    Is there any way I can hide that? I'm thinking it's from the 'fork()' call in the install_progress class, but the Python APT documentation is recommending not changing that [1], so I wasn't really sure.



    [1]: https://apt-team.pages.debian.net/python-apt/library/apt.progress.base.html#apt.progress.base.InstallProgress.fork



    Thanks, anything helps!



    ---

    Hunter Wittenborn

    mailto:hunter@hunterwittenborn.com

    https://github.com/hwittenborn
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div><div style="
    font-family : Verdana, Arial, Helvetica, sans-serif; font-size : 10pt;"><div>Hi! I'm currently working on a project that's going to be using the Python APT library to handle some package installation, but I've got a question on how exactly a certain
    thing is working:<br></div><div><br></div><div>I've gotten everything up to the actual installation of packages done (up to the point of calling 'DepCache.commit()', but once I get to the 'commit()' stage I can't figure out how to control the output of
    the 'commit()' call in a way I'm wanting.<br></div><div><br></div><div>Going with the two classes that are specified for the 'commit()' function, I currently
  • From Sandro Tosi@21:1/5 to hunter@hunterwittenborn.com on Mon Nov 8 02:20:02 2021
    python-apt is not written nor maintained by this team, but rather
    (from https://tracker.debian.org/pkg/python-apt) by the APT Dev team
    and in particular by Julian Andres Klode (both in CC): please continue
    the discussion with them

    On Sun, Nov 7, 2021 at 6:21 PM Hunter Wittenborn
    <hunter@hunterwittenborn.com> wrote:

    Hi! I'm currently working on a project that's going to be using the Python APT library to handle some package installation, but I've got a question on how exactly a certain thing is working:

    I've gotten everything up to the actual installation of packages done (up to the point of calling 'DepCache.commit()', but once I get to the 'commit()' stage I can't figure out how to control the output of the 'commit()' call in a way I'm wanting.

    Going with the two classes that are specified for the 'commit()' function, I currently have the following implemented (I haven't exactly figured out what to put in each one yet, as I'm still trying to figure out all how this step works):

    acquire_progress: https://gist.github.com/hwittenborn/56fa689b86396a904155e4b1b5be817a
    install_progress: https://gist.github.com/hwittenborn/0eb762abdfeb96e2c1cbf4f5b6a975f3

    The 'tap.message' library being used inside both of those classes is just a message system for my program, they don't do anything particularly important that would affect anything at all.

    The acquire_progress stage *appears* to be working fine, though the packages I downloaded were quite small so I didn't really get a chance to see if it just did some weird stuff like with install progress;

    The problem with install_progress is that it's exiting my program, and then proceeding with installing packages, as if it starts installing packages in the background. How exactly should I go about waiting for it to finish though?

    On a side note, I'm seeing this text whenever it (presumably) gets to the install part:

    """
    custom fork found
    got pid: 31873
    got pid: 0
    got fd: 4
    """

    Is there any way I can hide that? I'm thinking it's from the 'fork()' call in the install_progress class, but the Python APT documentation is recommending not changing that [1], so I wasn't really sure.

    [1]: https://apt-team.pages.debian.net/python-apt/library/apt.progress.base.html#apt.progress.base.InstallProgress.fork

    Thanks, anything helps!

    ---
    Hunter Wittenborn
    hunter@hunterwittenborn.com
    https://github.com/hwittenborn






    --
    Sandro "morph" Tosi
    My website: http://sandrotosi.me/
    Me at Debian: http://wiki.debian.org/SandroTosi
    Twitter: https://twitter.com/sandrotosi

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hunter Wittenborn@21:1/5 to All on Tue Nov 9 00:20:01 2021
    That's my bad, I couldn't ever find a mailing list for APT (presumably because of that weird name), so this one seemed like the only option.Should we continue the conversation here, or should I send a new message over there?---Hunter Wittenbornhunter@
    hunterwittenborn.comhttps://github.com/hwittenborn
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style='font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;'><div><div>That's my bad,
    I couldn't ever find a mailing list for APT (presumably because of that weird name), so this one seemed like the only option.<div><br></div><div><br></div><div>Should we continue the conversation here, or should I send a new message over there?<br><div><
    br id="x_714480661br3"><br id="x_714480661br3"><div id="x_714480661signature"><div>---<br></div><div>Hunter Wittenborn<br></div><div><a target="_blank" href="mailto:hunter@hunterwittenborn.com">hunter@hunterwittenborn.com</a></div><div><a target="_blank"
    href="https://github.com/hwittenborn">https://github.com/hwittenborn</a></div></div></div></div></div></div></div><br></body></html>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)