Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stored commands #7

Open
jayvdb opened this issue May 13, 2019 · 2 comments
Open

Stored commands #7

jayvdb opened this issue May 13, 2019 · 2 comments

Comments

@jayvdb
Copy link

jayvdb commented May 13, 2019

In packaging .spec files, there are a few very common tasks which are normally done with sed/awk/etc.

Most could be expressed as a bsed command which would be nice.

e.g. equiv of dos2unix, removing hashbang, replacing hashbangs.

i.e. https://python-rpm-porting.readthedocs.io/en/latest/applications.html#fixing-shebangs really recommends people write those commands. Surely we can do better than that before 2020 lands ;-)

Packaging python has a few others like replace == with >= inside setup.py strings.

It would be useful if these could be stored commands somehow.

they could be scripts which use bsed as their interpreter, or named aliases like 'bsed run foo', with details in a config.

@andrewbihl
Copy link
Owner

Are you suggesting creating a way for a user to store their own personally-used commands?
Or adding these commands to the core syntax?

If you mean the first, can you explain why this would be preferable to modifying one's bash_profile (or the equivalent for their environment)?

@jayvdb
Copy link
Author

jayvdb commented May 30, 2019

Actually, neither of those.

I was hoping to have shared groups of commands.

e.g. /usr/share/bsed/aliases/rpmbuild.ini might contain

dos2unix = ...
fix_hashbang = ...
remove_hashbang = ...

Then that command list could be put into a package , which would be installed into the rpmbuild environment, or installed by packagers locally for debugging, and used something like bsed --run-stored fix_hashbag foo.py

The reason for having multiple alias files is to allow different rpms to 'own' different sets of alias files, to prevent conflicts in rpm packaging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants