11 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
f566e04888 chore: enable more linters and fix all critical issues
Enabled additional linters from fakemachine configuration:
- errorlint: Error wrapping with %w
- misspell: Spelling checks
- revive: Code quality checks
- whitespace: Formatting checks

Fixed all issues including:
- Error handling: Added proper error checks for all function returns
- Error wrapping: Changed %v to %w for proper error wrapping
- Type assertions: Used errors.As instead of direct type assertions
- Unused parameters: Renamed to underscore where appropriate
- Variable naming: Fixed ALL_CAPS constants and underscored names
- Whitespace: Removed unnecessary leading/trailing newlines
- Code flow: Removed unnecessary else blocks

Renamed types (breaking internal API changes):
- DebosState → State
- DebosContext → Context
- DownloadHttpUrl → DownloadHTTPURL

Fixed struct field naming with proper YAML tags:
- Url → URL (with yaml:"url" tag)
- TlsClientCertPath → TLSClientCertPath (kept yaml:"tls-client-cert-path")
- TlsClientKeyPath → TLSClientKeyPath (kept yaml:"tls-client-key-path")
- validateUrl → validateURL method

Co-authored-by: sjoerdsimons <22603932+sjoerdsimons@users.noreply.github.com>
2025-10-01 21:21:22 +02:00
Loïc Minier
e63a1c5867 fix: Use a single append to concatenate two slices (S1011)
Reported by staticcheck

Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 09:24:07 +02:00
Loïc Minier
16ab444c53 fix: Omit comparison with boolean constant (S1002)
Reported by staticcheck

Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 09:24:07 +02:00
Loïc Minier
ae9d5574cc fix: Incorrectly formatted error string (ST1005)
Reported by staticcheck

Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 09:24:07 +02:00
Christopher Obbard
158ed7c09a chore: run go fmt
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
2025-08-11 14:33:38 +01:00
rektide de la faye
d7135c3787 add lzop/zlma/lzip/zstd unpack compress options.
Signed-off-by: rektide de la faye <rektide@voodoowarez.com>
Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com>
2025-08-06 10:02:02 +02:00
Julien Massot
e470bd1be4 actions: pack/unpack: Add support for zstd compression
Debian Bookworm includes a version of tar with native support
for Zstandard compression.
Add mapping to enable zstd in pack and unpack operations.

Signed-off-by: Julien Massot <julien.massot@collabora.com>
2025-04-28 15:59:03 +02:00
Vignesh Raman
6bcd2754cf actions: pack/unpack: use pigz for compression
pigz does gzip compression on multiple cores and multiple processors
and there is improvement in compression time on multi core machines.
Use pigz for gzip compression if installed on the host machine.

Fixes: #218

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
2023-07-11 09:54:48 +00:00
Emanuele Aina
f5be9606b4 pack,unpack: Save and restore xattrs and file capabilities in tarballs
Add options to `tar` to tell it to save and restore extended attributes:

* `--xattr`: enable extended attributes support
* `--xattrs-include=*.*`: tell `tar` to include every extended attribute
  since by default `tar` only stores attributes in the `user.*` namespace

This fixes the `pack` and `unpack` actions when dealing with tools like
`ping` which on modern distributions have been switched to use file
capabilities to do privileged operations without being setuid, as they are
based on extended attributes.

This relies on `tar` being GNU Tar >= 1.27, released in 2013 and shipped since
Debian Jessie.

Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
2019-09-06 11:06:43 +02:00
Denis Pynkin
061e0eb6ac Rework of archiver
Common approach for working with archives is introduced.
Unpacker and Archiver interfaces are added.

Example of file unpacking:
 archive, _ := debos.NewArchive("file.ext")
 archive.Unpack("destination")

Three archive types are supported:
- tar
- zip
- debian packages

Type of archive is guessed by extension or can be set explicitly during
archiver creation with option for NewArchive().

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
2017-10-05 19:13:31 +03:00
Denis Pynkin
5d73e460c3 Introduce packages 'debos' and 'actions'
This change allows to import and use core modules from "debos" package and
actions from "actions" package. Add prefix 'debos.' to all symbols imported
from core "debos" package to satisfy syntax check.

Package "actions" shouldn't keep any common function or structure:

- function 'DownloadHttpUrl()' is moved from 'DownloadAction' to "debos"
  package. New file 'net.go' has been added to keep a common network functions
  in core part of debos.

- move common functions for extracting files from 'UnpackAction' to 'debos'
  package. File 'archiver.go' has been added for common operations on archives.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
2017-09-05 15:24:38 +03:00