diff options
author | Ulrich Müller <ulm@gentoo.org> | 2024-06-26 21:36:44 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2024-06-28 17:07:31 +0200 |
commit | 32bde6512c7b24240782743aab75e4015f89eb3e (patch) | |
tree | 43f3069c63720073fbbbb27999793ad2ddc85f48 /ebuild-mode.el | |
parent | Deactivate some menu entries for eclasses (diff) | |
download | ebuild-mode-32bde6512c7b24240782743aab75e4015f89eb3e.tar.gz ebuild-mode-32bde6512c7b24240782743aab75e4015f89eb3e.tar.bz2 ebuild-mode-32bde6512c7b24240782743aab75e4015f89eb3e.zip |
Improve error reporting in ebuild-mode-find-workdir
* ebuild-mode.el (ebuild-mode-find-workdir): Display a separate
error message when the file is not an ebuild.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'ebuild-mode.el')
-rw-r--r-- | ebuild-mode.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ebuild-mode.el b/ebuild-mode.el index 68da594..4ad5275 100644 --- a/ebuild-mode.el +++ b/ebuild-mode.el @@ -568,14 +568,14 @@ With prefix argument OTHER-WINDOW, visit the directory in another window." (catdir (directory-file-name (file-name-directory pkgdir))) (category (file-name-nondirectory catdir)) (pn (file-name-nondirectory pkgdir)) - (pf (file-name-sans-extension - (file-name-nondirectory buffer-file-name)))) + (basename (file-name-nondirectory buffer-file-name)) + (pf (file-name-sans-extension basename))) ;; sanity check + (unless (string-match "\\.ebuild\\'" (file-name-sans-versions basename)) + (error "Filename \"%s\" does not end in \".ebuild\"" basename)) (unless (and (file-exists-p (expand-file-name "../profiles/repo_name" catdir)) - (string-match (concat "\\`" (regexp-quote pn) "-") pf) - (string-match "\\.ebuild\\'" - (file-name-sans-versions buffer-file-name))) + (string-match (concat "\\`" (regexp-quote pn) "-") pf)) (error "This doesn't look like an ebuild repository")) (let ((workdir (concat (file-name-as-directory ebuild-mode-portage-tmpdir) (file-name-as-directory category) |