jrmarino / synth

Next D/Ports build tool for live systems (Alternative for Portmaster and Portupgrade tools)
ISC License
251 stars 15 forks source link

Request: Allow comments in top-level ports files #214

Closed chenein closed 7 months ago

chenein commented 1 year ago

I am creating a top-level list of ports I want to have installed on my system. There is quite a list, and I'd like to be able to break them into groups with a descriptive comment for each group to make the file easier to manage. It would be great if I could do something like the following:

# Compilers and Languages
lang/foo
lang/bar
lang/perl5 # best scripting language ever
lang/python # who thought delimiting blocks with whitespace is a good idea?
# 
# Games
games/baz
games/quux
jrmarino commented 1 year ago

It would be pretty trivial for you to write a bash or python script that read such a file and produced a "clean" version to standard out or to another file. It's basically running this this through "sed" or "awk" command I would think that effort is in your scope.

or even "grep -v"

image

jrmarino commented 1 year ago

if you stick to comments at the start of the time, you can do it with just the grep command. I had to do a second pss to handle the post-line comments.

You would think that sed could do it by itself, but you end up with blanks (although synth might not care about thouse)

image

chenein commented 1 year ago

I can accept this, but if we applied this to every configuration file on the system it would quickly become unwieldy. Imagine pre-processing any file in /etc/ every time a change needs to be made. That said, this is a would-be-nice for me.

jrmarino commented 1 year ago

I understand. Synth is basically in bug-fix maintenance mode though. (or more probable is ports framework changes something that synth has to chase, a la the flavors change)

chenein commented 1 year ago

Fair enough, thanks.