Commit Graph

11 Commits

Author SHA1 Message Date
Eman Resu
a944373fa1 build-support/fetchbitbucket: remove assertMsg usage 2026-05-26 14:14:40 -04:00
Jasi
8be08585b9 fetchFromBitbucket: modify tests for fetchgit backend 2025-10-05 10:18:43 -04:00
Jasi
5c2d20cf68 fetchFromBitbucket: implement fetchgit codepath
This allows `fetchFromBitbucket` to interface with `fetchgit` if
git-related arguments are given.
2025-10-05 10:15:29 -04:00
Philip Taron
2e2bf9915b fetchFromBitbucket: url escape rev (#386460) 2025-08-06 11:44:04 -07:00
Jan Malakhovski
7c8a4efb68 lib, treewide: introduce repoRevToName, use it in most fetch* functions
This patch adds `lib.repoRevToName` function that generalizes away most of the
code used for derivation name generation by `fetch*` functions (`fetchzip`,
`fetchFromGitHub`, etc, except those which are delayed until latter commits
for mass-rebuild reasons).

It's first argument controls how the resulting name will look (see below).

Since `lib` has no equivalent of Nixpkgs' `config`, this patch adds
`config.fetchedSourceNameDefault` option to Nixpkgs and then re-exposes
`lib.repoRevToName config.fetchedSourceNameDefault` expression as
`pkgs.repoRevToNameMaybe` which is then used in `fetch*` derivations.

The result is that different values of `config.fetchedSourceNameDefault` now
control how the `src` derivations produced by `fetch*` functions are to be
named, e.g.:

- `fetchedSourceNameDefault = "source"` (the default):

  ```
  $ nix-instantiate -A fuse.src
  /nix/store/<hash>-source.drv
  ```

- `fetchedSourceNameDefault = "versioned"`:

  ```
  $ nix-instantiate -A fuse.src
  /nix/store/<hash>-libfuse-2.9.9-source.drv
  ```

- `fetchedSourceNameDefault = "full"`:

  ```
  $ nix-instantiate -A fuse.src
  /nix/store/<hash>-libfuse-2.9.9-github-source.drv
  ```

See the documentation of `config.fetchedSourceNameDefault` for more info.
2025-05-31 10:01:21 +00:00
Anton Tetov
81e7978020 fetchFromBitbucket: url escape rev attr
To make sure revision with spaces in them (most likely from repos that
were used with mercurial) as well as revisions with names containing url
encoded characters ("branch%20with%20encoded%spaces").
2025-05-24 14:45:42 +02:00
Anton Tetov
1ea957198f fetchFromBitbucket: add test, repro need for url escape
Looking into #29733
2025-05-24 14:45:31 +02:00
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
piegames
a205795c8a treewide: Make some fetchers overridable 2023-04-22 22:29:23 +02:00
Alyssa Ross
d586d24f7a fetchFromBitbucket: remove hack for Mercurial
Bitbucket deleted all its Mercurial repositories, so presumably this
doesn't do anything any more.
2021-02-08 17:54:12 +00:00
Matthew Bauer
d16e0f8dc3 all-packages: move fetch* to pkgs/build-support/ 2019-01-26 22:47:54 -05:00