Open JC3 opened 8 months ago
Thinking about this, I can understand why it's difficult to solve, as the add
and cache
operations are separate, the error is difficult to recover from since invalid packages will stick around in /var/lib/freight even for future runs on different packages.
As a workaround, if anybody is struggling with this, I'm having good success using dpkg-deb
to validate the package first before doing a freight add
+ freight cache
, e.g.:
dpkg-deb -W package.deb && freight add package.deb apt/test && freight cache
When executing
freight cache
, if adpkg-deb
call fails,freight cache
still returns success.For example, when attempting to use freight to add a .deb file that uses zstd compression on a system that does not support zstd compression:
Fails and outputs:
Note that it still returns 0.
Expected behavior: If
freight cache
fails for some reason, it should return non-zero to the OS. Actual behavior:freight cache
exits with 0 even on failure.