luarocks-packages-update: init (#262156)
* luarocks-packages-updater: init Goal is to make it possible to maintain out-of-tree luarocks packages without needing to clone nixpkgs. maintainers/scripts/update-luarocks-packages gets renamed to pkgs/development/lua-modules/updater/updater.py Once merged you can run for instance nix run nixpkgs#luarocks-packages-updater -- -i contrib/luarocks-packages.csv -o contrib/generated-packages.nix I also set the parallelism (--proc) to 1 by default else luarocks fails because of https://github.com/luarocks/luarocks/issues/1540 * Update maintainers/scripts/pluginupdate.py Co-authored-by: Marc Jakobi <mrcjkb89@outlook.com> --------- Co-authored-by: Marc Jakobi <mrcjkb89@outlook.com>
This commit is contained in:
@@ -468,6 +468,7 @@ class Editor:
|
||||
"--input-names",
|
||||
"-i",
|
||||
dest="input_file",
|
||||
type=Path,
|
||||
default=self.default_in,
|
||||
help="A list of plugins in the form owner/repo",
|
||||
)
|
||||
@@ -476,6 +477,7 @@ class Editor:
|
||||
"-o",
|
||||
dest="outfile",
|
||||
default=self.default_out,
|
||||
type=Path,
|
||||
help="Filename to save generated nix code",
|
||||
)
|
||||
common.add_argument(
|
||||
@@ -787,10 +789,17 @@ def update_plugins(editor: Editor, args):
|
||||
|
||||
if autocommit:
|
||||
from datetime import date
|
||||
editor.nixpkgs_repo = git.Repo(editor.root, search_parent_directories=True)
|
||||
updated = date.today().strftime('%m-%d-%Y')
|
||||
|
||||
commit(editor.nixpkgs_repo, f"{editor.attr_path}: updated the {updated}", [args.outfile])
|
||||
try:
|
||||
repo = git.Repo(os.getcwd())
|
||||
updated = date.today().strftime('%m-%d-%Y')
|
||||
print(args.outfile)
|
||||
commit(repo,
|
||||
f"{editor.attr_path}: updated the {updated}", [args.outfile]
|
||||
)
|
||||
except git.InvalidGitRepositoryError as e:
|
||||
print(f"Not in a git repository: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if redirects:
|
||||
update()
|
||||
|
||||
Reference in New Issue
Block a user