Commit Graph

10 Commits

Author SHA1 Message Date
Sławomir Nizio
e3f9bf916a [modify.pl] better placement of inserted items 2015-06-13 20:25:36 +02:00
Sławomir Nizio
07089755d8 [modify.pl] add simple heuristic that selects the best "block" 2015-06-13 17:10:24 +02:00
Sławomir Nizio
c36b8c3a3b [modify.pl] fix a bug, rename function 2015-06-09 00:09:15 +02:00
Sławomir Nizio
6e6ade8620 [modify.pl] add support for groups
Now lines without commas with be handled correctly.
Note that I cannot simply split on commas, because the "blocks"
are grouped differently, in a way that is useful for the user during
addition, removal or sorting operations.

There is a limitation on adding an entry: currently it is added to the
first "block" and user is given no choice. This can be fixed easily.
2015-06-08 07:35:03 +02:00
Sławomir Nizio
ba93101717 [modify.pl] remove temp. and lock files when "not doing anything" 2014-11-29 20:36:27 +01:00
Sławomir Nizio
0642bddf02 [modify.pl] switch away from smart match and given 2014-11-29 20:22:12 +01:00
Sławomir Nizio
267fd3be17 [modify.pl] fixes
mainly this one:
moving file failed: Invalid cross-device link
(happens when /tmp is mounted as tmpfs)
2014-04-24 12:54:39 +02:00
Sławomir Nizio
1c7473fd79 [molecules] modify.pl: fix commas in sorting with delete 2011-10-14 07:05:51 +02:00
Sławomir Nizio
5e8f2e926b [molecules] modify.pl: improvement&fix 2011-10-12 23:26:40 +02:00
Sławomir Nizio
22b3387cb6 [molecules] add a script to update molecule/particle files
This is a silly script to modify .common (molecules) and .particle
files.
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.
Commiting it to this git repository because it could be most useful
here.

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.

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

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).
2011-10-12 20:02:32 +02:00