Hi all,

I have committed a silly script to modify .common (molecules) and
.particle files.
It's in molecules git repository because it could be most useful for the former.
It can be used to modify (even automatic) another files with similar format too.
For .common files it uses "packages_to_add:" section, and for .particle
"packages:", but any can be used using --section.

It adds items keeping alphabetical order.

When adding an item it aborts if encountered file fragment is not sorted
(can be overridden with --force).
It can sort entries in a "section" too (--sort).
It can delete an item instead of adding (--delete).
Unless --noask is specified, displays diff and asks for confirmation.

--help prints this:

usage examples:
        ./modify.pl kde.common dev-util/geany
        ./modify.pl --sort kde.common dev-util/geany
        ./modify.pl --sort kde.common
        ./modify.pl --delete kde.common x11-terms/xterm
--sort - sort entries
--force - don't abort if entries aren't sorted (default for --delete)
--noask - don't ask for confirmation
--delete - delete instead of adding
--section - provide own "section" to update, for example:
"packages_to_remove:" (note the colon)

I don't know if it'll be used. I've made it for fun. Feel free to (re)move
it to another directory, like scripts/ (I think it fits better here).

SN

Reply via email to