Bug 387705 - Highlight PKGBUILD files as bash files
Summary: Highlight PKGBUILD files as bash files
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-08 08:44 UTC by Andrew Shark
Modified: 2017-12-17 00:35 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Shark 2017-12-08 08:44:52 UTC
When open PKGBUILD (building bash script for Arch Linux) file in kate, it has no highliting. I can manually select bash highliting for it, but it is just until closing such file.
PKGBUILD files do not have "#!/bin/bash" at the beginning, but actually they have bash syntax.
Actually, I often have some test PKGBUILDS located side-by-side and they are named like "PKGBILD-foo" "PKGBILD-bar".

I wish kate automatically highlight files which name begins with "PKGBUILD" as bash syntax.
Comment 1 Dominik Haumann 2017-12-08 10:41:42 UTC
Highlighting for PKGBUILD was added on 2017-11-26, see https://phabricator.kde.org/D9002

Is naming PKGBUILD-something a standard convention or just something you are doing?
Comment 2 Andrew Shark 2017-12-08 10:55:02 UTC
I am amazed how quickly this wish was handled. Thank you!
Actually, naming like PKGBUILD-something is not a standard convention but just something that I am doing. Standard name is just "PKGBUILD".
But it is very convinient to place such "PKGBUILD-something" files side-by-side  instead of placing "PKGBUILD" files in different directories. Especially when it is needed to build different binaries from same sources.

So I do not know if we should implement such "unstandard" detection, but it would be convinient.
Comment 3 Nate Graham 2017-12-08 13:28:37 UTC
We could conceivably change PKGBUILD to PKGBUILD*, but that might have unforeseen negative ramifications.
Comment 4 Andrew Shark 2017-12-08 16:09:35 UTC
I understand that. The problems could be if somebody calls their file like "PKGBUILD instructions.txt".
Maybe better instead of "PKGBUILD*" rule make "PKGBUILD-*". It should reduce unwanted behavior cases.
By the way, I have found that archlinux maintainers applied patch for pkgbuild highliting https://git.archlinux.org/svntogit/packages.git/tree/trunk/pkgbuild-syntax-highlight.patch?h=packages/syntax-highlighting.
Comment 5 Dominik Haumann 2017-12-08 18:52:54 UTC
I am in favor of PKGBUILD*. Will change this this weekend. I believe this is still ok and the risk of false positives is pretty low.
Comment 6 Nate Graham 2017-12-08 18:55:24 UTC
Excellent news!
Comment 7 Dominik Haumann 2017-12-16 18:41:59 UTC
@Nate: I was just about to change this. But meanwhile, I think it would be better to not change this.

Instead, please configure your Kate and change PKGBUILD for Bash to PKGBUILD* yourself in the settings dialog, "Open/Save" -> "Modes & Filetypes".

See: https://i.imgur.com/4Mwr9nF.png

Therefore, I will change this as fixed, since the original request is already fixed.
Comment 8 Andrew Shark 2017-12-17 00:35:02 UTC
Dominik Haumann, great! Thanks for perfect suggestion.