Commit Graph

7 Commits

Author SHA1 Message Date
Victor Engmark
893e0f3733
rebuild-amount: Fix 'SC2155 (warning): Declare and assign separately to avoid masking return values.' 2024-06-20 14:37:25 +12:00
Erik Arvstedt
3f54dfa475
treewide: fix bash exit handlers
Transform exit handlers of the form
trap cleanup EXIT [INT] [TERM] [QUIT] [HUP] [ERR]
  (where cleanup is idempotent)
to
trap cleanup EXIT

This fixes a common bash antipattern.

Each of the above signals causes the script to exit. For each signal,
bash first handles the signal by running `cleanup` and then runs
`cleanup` again when handling EXIT.
(Exception:  `vscode/*` prevents the second run of `cleanup` by removing
the trap in cleanup`).

Simplify the cleanup logic by just trapping exit, which is always run
when the script exits due to any of the above signals.

Note: In case of borgbackup, the exit handler is not idempotent, but just
trapping EXIT guarantees that it's only run once.
2022-07-02 16:13:12 +02:00
Sergei Trofimovich
39e8ec2db6
maintainers/scripts/rebuild-amount.sh: report parallelism, add example, cleanup (#137695)
* maintainers/scripts/rebuild-amount.sh: report parallelism setting

This slightly helps discovering parallelism support.

* maintainers/scripts/rebuild-amount.sh: add basic example

It's not clear if script should be used against HEAD or HEAD^.
Let's have a copyable example.

* maintainers/scripts/rebuild-amount.sh: convert tabs to four spaces

One notable change is here-document conversion.
Before:

  <TAB>cat <<-FOO
  <TAB>...
  <TAB>FOO

After:

  <sp><sp><sp><sp>cat <<FOO
  <sp><sp><sp><sp>...
  FOO

Note seemingly misaligned 'FOO': '-FOO' understands leading tabs,
but not spaces.
2021-09-24 01:06:57 -07:00
zowoq
eca0b09849 maintainers/*: editorconfig fixes 2020-07-31 15:07:53 +10:00
Vladimír Čunát
4de01b6723
rebuild-amount.sh: add --print option (PR #33693)
to allow additionally listing all the rebuilt packages.
2018-01-14 21:12:29 +01:00
Vladimír Čunát
8004e79415
Merge branch 'master' into staging 2017-05-24 03:24:06 +02:00
Nicolas Pierron
342de508d4 Add a script to check the number of packages to rebuild after a modification.
svn path=/nixpkgs/trunk/; revision=17731
2009-10-08 19:00:48 +00:00