Skip to content

Conversation

gasinvein
Copy link
Member

This requires dpkg-deb utility (part of dpkg) on host. While we could use ar p | tar x instead, using dpkg itself for this task is easier and surely more robust.
I have literally zero C programming skill, so possibly did some mistakes here.

@rh-atomic-bot
Copy link

Can one of the admins verify this patch?
I understand the following commands:

  • bot, add author to whitelist
  • bot, test pull request
  • bot, test pull request once

@barthalion
Copy link
Member

Are there any actual issues caused by using ar and tar? Extract utilties are used from the host and we expect packagers to include them as dependencies. I don't see it happening with dpkg, especially when it can be replaced easily.

@alexlarsson
Copy link
Member

I don't think its a great idea to pull in a dependency on dpkg, because either all distros will need to packaged deb, or app authors can't rely on the deb support in flatpak-builder.

Anyway, debs are just ar archives, so i think we could extract them manually.

@gasinvein
Copy link
Member Author

@barthalion Most nowadays .deb packages contain data.tar.xz, but xz is not the only option, so we would need list ar contents before extraction.

@alexlarsson dpkg is available on most non-deb-based distros. I believe it's beacause it's debootstrap's dependency, which is widely used for containers bootstrapping.

@refi64
Copy link
Contributor

refi64 commented Mar 19, 2020 via email

@alexlarsson
Copy link
Member

@gasinvein Its available on some distros yes, but it is rarely installed. Pulling in a hard dep on it is not an easy sell.

@gasinvein gasinvein force-pushed the source-archive-deb branch from 11a7f3e to b60b6b8 Compare March 19, 2020 15:44
@gasinvein
Copy link
Member Author

@alexlarsson Well, how to approach this, then? Assume there is always data.tar.xz? Listing ar contents and selecting correct compression type is beyond my C skill.

@barthalion
Copy link
Member

barthalion commented Mar 19, 2020 via email

@gasinvein
Copy link
Member Author

There is already RPM archive support (via rpm2cpio), I thought it would be nice to support deb as well, especially since there are already some apps on Flathub that unpack .deb packages.

@barthalion
Copy link
Member

Interesting, I don't think I've seen it used on Flathub. But that's fair enough.

@gasinvein gasinvein force-pushed the source-archive-deb branch from b60b6b8 to 7b7fe37 Compare April 4, 2021 11:18
@gasinvein
Copy link
Member Author

Given that flatpak-builder already depends on the uncommon rpm2cpio utility, should I still rewrite this to use ar | tar, or is dpkg-deb acceptable?

@bbhtt
Copy link
Contributor

bbhtt commented Sep 2, 2025

This should indeed use ar+tar or bsdtar. Both are in the runtime but nowadays bsdtar is more widely used.

it's just a bsdtar -Oxf foo.deb 'data.tar.*' | bsdtar -xf - usually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants