From 3283b2ca59b06198118d5313a4b19e6119468b86 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Sat, 27 May 2023 01:43:33 +0200 Subject: fix(commitpkg): only force existing files to be under version control Before porting commitpkg to Git, the code has checked the SVN status for none commited files. During the port this has changed by straight checking for any passed files if they were under version control or not. In general the whole logic is very brittle as variables are searched by regex and directly passed to eval while ignoring any function scoping. This leads to missing files when they reference the $pkgname inside a package function but also provide wrong ones when eval simply returns the first $pkgname while ignoring and function scopes. In the future this should completely be replaces by .SRCINFO processing. Fixes #145 Signed-off-by: Levente Polyak --- src/commitpkg.in | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/commitpkg.in') diff --git a/src/commitpkg.in b/src/commitpkg.in index c52e4fa..8a8087a 100644 --- a/src/commitpkg.in +++ b/src/commitpkg.in @@ -129,6 +129,10 @@ done # assert that they really are controlled by git if (( ${#needsversioning[*]} )); then for file in "${needsversioning[@]}"; do + # skip none existing files + if [[ ! -f "${file}" ]]; then + continue + fi if ! git ls-files --error-unmatch "$file"; then die "%s is not under version control" "$file" fi -- cgit v1.2.3-70-g09d2