Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 386dbd5aea22
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1d51514ab242
Choose a head ref
  • 3 commits
  • 1 file changed
  • 1 contributor

Commits on Jan 13, 2020

  1. linux-libre.updateScript: fix COMMIT option

    Because bash was being run with -u, if COMMIT wasn't set in the
    environment the script would just crash here, rather than exiting
    successfully.
    alyssais committed Jan 13, 2020
    Copy the full SHA
    be4d80d View commit details
  2. linux-libre.updateScript: don't update if unchanged

    The revision applies to the whole SVN tree, not just the scripts
    directory, so the revision will increment sometimes with no change in
    content.
    alyssais committed Jan 13, 2020
    Copy the full SHA
    345f671 View commit details
  3. linux-libre.updateScript: fix git commit

    With nothing staged and no paths given, previously this wouldn't
    actually do anything.
    alyssais committed Jan 13, 2020
    Copy the full SHA
    1d51514 View commit details
Showing with 9 additions and 2 deletions.
  1. +9 −2 pkgs/os-specific/linux/kernel/update-libre.sh
11 changes: 9 additions & 2 deletions pkgs/os-specific/linux/kernel/update-libre.sh
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ nixpkgs="$(git rev-parse --show-toplevel)"
path="$nixpkgs/pkgs/os-specific/linux/kernel/linux-libre.nix"

old_rev="$(grep -o 'rev = ".*"' "$path" | awk -F'"' '{print $2}')"
old_sha256="$(grep -o 'sha256 = ".*"' "$path" | awk -F'"' '{print $2}')"

svn_url=https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/branches/
rev="$(curl -s "$svn_url" | grep -Em 1 -o 'Revision [0-9]+' | awk '{print $2}')"
@@ -17,10 +18,16 @@ fi

sha256="$(QUIET=1 nix-prefetch-svn "$svn_url" "$rev" | tail -1)"

if [ "$old_sha256" = "$sha256" ]; then
echo "No updates for linux-libre"
exit 0
fi

sed -i -e "s/rev = \".*\"/rev = \"$rev\"/" \
-e "s/sha256 = \".*\"/sha256 = \"$sha256\"/" "$path"

if [ -n "$COMMIT" ]; then
git commit -qm "linux_latest-libre: $old_rev -> $rev" "$path"
if [ -n "${COMMIT-}" ]; then
git commit -qm "linux_latest-libre: $old_rev -> $rev" "$path" \
$nixpkgs/pkgs/os-specific/linux/kernel/linux-libre.nix
echo "Updated linux_latest-libre $old_rev -> $rev"
fi