-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
emacsPackages: squash elpa and nongnu update scripts
Now they can be called via `./update-package-sets <package sets>`.
- Loading branch information
1 parent
5293db1
commit 9cace28
Showing
5 changed files
with
49 additions
and
24 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
pkgs/applications/editors/emacs/elisp-packages/update-elpa-devel
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
pkgs/applications/editors/emacs/elisp-packages/update-nongnu-devel
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
pkgs/applications/editors/emacs/elisp-packages/update-package-sets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#! /usr/bin/env nix-shell | ||
#! nix-shell --show-trace ./emacs2nix.nix -i bash | ||
|
||
usage(){ | ||
local PROGNAME="$1" | ||
|
||
cat<<-EOF | ||
Usage: ${PROGNAME} args | ||
args can be at least one from: elpa-devel, elpa, nongnu-devel, nongnu. | ||
EOF | ||
} | ||
|
||
update_set(){ | ||
local PKGSET="$1" | ||
|
||
local output="${PKGSET}-generated.nix" | ||
local script="${PKGSET}-packages.sh" | ||
|
||
eval "${script} --names ${EMACS2NIX}/names.nix -o ${output}" | ||
nixfmt "${output}" | ||
} | ||
|
||
main(){ | ||
local SETS=( ) | ||
|
||
while (( $# )); do | ||
case $1 in | ||
"elpa-devel" | "elpa" | "nongnu-devel" | "nongnu") | ||
if [[ ! ${SETS[@]} =~ $1 ]]; then | ||
SETS+=( "$1" ) | ||
fi | ||
shift | ||
;; | ||
*) | ||
echo "Unknown package set: $1" | ||
usage "update-package-sets" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
for SET in "${SETS[@]}"; do | ||
echo "${SET}: updating..." | ||
update_set "${SET}" | ||
echo "${SET}: updated" | ||
done | ||
} | ||
|
||
main "$@" |