Commit graph

43 commits

Author SHA1 Message Date
Michal Sojka
c619c573f2 Use git cache by default 2025-04-18 13:48:14 +02:00
Max Beutelspacher
c309f53ac9 feat: add the option to store sha256 cache in a file
cache is also used for per package source checkouts and
<git-rev>-<package-prefix> is used as a key
2025-02-25 21:24:23 +01:00
Michal Sojka
c35b0dc7aa Fix merge_base_to_upstream()
The parameter was unused.
2025-02-10 08:39:35 +01:00
Michal Sojka
5053709228 Use "non-cone mode" for --use-per-package-src
In cone mode (before this commit), the fetched sources contained not
only the specified subdirectory, but also the files in all its parent
directories. Non-cone mode means, that only the specified subdirectory
is fetched.
2025-02-09 10:55:46 +01:00
Max Beutelspacher
3567e9e85a Improve argument name for per-package-src
Co-authored-by: Michal Sojka <michal.sojka@cvut.cz>
2025-02-09 10:55:46 +01:00
Michal Sojka
f2893e44b9 Don't generate extra empty lines in src expressions 2025-02-09 10:55:46 +01:00
Michal Sojka
e523ecb7f5 Fix formatting and typos 2025-02-09 10:55:46 +01:00
Max Beutelspacher
2b569c35f0 feat: use sparse checkout if --use-package-git-hash is provided 2025-02-05 18:47:04 +01:00
Max Beutelspacher
72a061c8c1 feat: option for package local hash 2025-02-03 22:16:08 +01:00
Michal Sojka
239cee8bcb Don't add git version to generated patches 2024-12-29 15:48:58 +01:00
Michal Sojka
9406815aba Fix generating patches of independent packages in a single repo 2024-12-28 16:38:02 +01:00
Michal Sojka
c06d6087d3 Generate overlay with final and prev parameters
Otherwise `nix flake check` complains with:

    error: overlay does not take an argument named 'final'

This also changes which callPackage is called. Previously, we used
"super" (now prev), but we changed it to "final", because this seems
to be more correct (i.e. used in nixpkgs).
2024-12-28 11:14:23 +01:00
Michal Sojka
773c31d355 Improve --patches documentation and regenerate README.md 2024-12-23 00:16:08 +01:00
Michal Sojka
dc3de1f289 Add experimental option --patches
This generates Nix expressions which include local patches (additional
commits in local git repositories).
2024-12-22 23:00:49 +01:00
Michal Sojka
a850550783 Don't fail with --compare when a .nix file is missing on disk
The switch --compare is typically used during CI, to check whether all
automatically generated files are up to date. When some files are
missing (e.g. a ROS package was added but its Nix expression was not
generated), ros2nix would fail with "FileNotFoundError" and would not
return exit code 2 as it should.

This commit fixes that. Missing files are reported with an error
message and execution continues. Exit code 2 is correctly reported.
2024-12-18 09:39:55 +01:00
Michal Sojka
8736e74512 Add FilesCompleter for package.xml parameter 2024-10-01 20:32:35 +02:00
Michal Sojka
0fd819b4a2 Add shell completion scripts 2024-10-01 13:01:16 +02:00
Michal Sojka
8528f3558f Fix errors when package.xml is in the current directory 2024-10-01 12:08:22 +02:00
Michal Sojka
2595123e12 Ignore --compare in the "Automatically generated" comment 2024-09-26 23:31:48 +02:00
Michal Sojka
33e6271b65 Make --compare print diffs 2024-09-26 23:31:14 +02:00
Michal Sojka
61f9d71bc8 Fix exception when printing an error message
pkg may not be always set.
2024-09-26 17:03:05 +02:00
Michal Sojka
8ca5a871ff Allow overriding nix-ros-overlay version 2024-09-22 10:58:27 +02:00
Michal Sojka
c6b1a2c507 Add --default and --no-default option 2024-09-22 09:39:30 +02:00
Michal Sojka
38d2f17d89 Add --no-overlay option 2024-09-22 09:38:49 +02:00
Michal Sojka
ecf83f90d9 Update --help 2024-09-18 10:07:34 +02:00
Michal Sojka
84bf4880ff Update --help 2024-09-18 10:03:00 +02:00
Michal Sojka
c4bc177658 Add --do-check 2024-09-16 08:19:34 +02:00
Michal Sojka
12b7379af5 Implement --compare 2024-09-15 21:52:21 +02:00
Michal Sojka
97e9459c65 Sort imports with isort 2024-09-15 21:16:50 +02:00
Michal Sojka
b36f2108fa Implement --extra-*-inputs 2024-09-15 17:47:35 +02:00
Michal Sojka
ac0a6f67bc Define ROS distro name at only one place in flake.nix 2024-09-15 14:38:06 +02:00
Michal Sojka
bff08f3718 Strip trailing / from GitHub repo name 2024-09-15 14:37:37 +02:00
Michal Sojka
6ba6c8a2c2 Start generated Nix expressions with a comment about automatic generation 2024-09-15 14:10:03 +02:00
Michal Sojka
ca4c0e6bfc Improve --help text and add it to the README 2024-09-15 14:09:25 +02:00
Michal Sojka
20504c30f9 Cleanup 2024-09-15 12:19:29 +02:00
Michal Sojka
05d12bc5d0 Implement --flake 2024-09-15 12:17:03 +02:00
Michal Sojka
caae29d852 Cleanup, flake8 2024-09-15 10:41:08 +02:00
Michal Sojka
83e07c9ea1 Prepare for --flake 2024-09-15 10:28:27 +02:00
Michal Sojka
a56e2bdf9c Generate correct paths when setting --output-dir 2024-09-15 01:02:10 +02:00
Michal Sojka
f1ab404292 Add support for getting sources
Either from local paths or by calling fetches.
2024-09-15 00:16:10 +02:00
Michal Sojka
3698df8fe6 Pin rosdistro version and package the script to be usable without nix develop
Now the script works without updating rosdep, i.e., fetching the
database from the Internet.
2024-08-25 23:25:05 +02:00
Michal Sojka
411bd08ac8 Extend package generator to work for me 2024-08-25 17:13:15 +02:00
Michal Sojka
94a71fa564 Initial commit 2024-08-25 17:13:12 +02:00