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

Fix: Path to exceptions now relative to scripts #1

Merged
merged 1 commit into from Aug 7, 2018

Conversation

simson-sillage
Copy link
Contributor

So that the repository can be placed elsewhere than at ~

@bmwiedemann
Copy link
Owner

There are more exception files used in rebuild script... and maybe we could make it a directory, so that we use $somepath/exceptions/neardate to make the whole checkout less messy

@simson-sillage
Copy link
Contributor Author

I added a exceptions/ subdirectory and also adjusted the paths in rebuild. Do you like it?

@simson-sillage simson-sillage changed the title Fix: Path to exceptions now relative to rbk script Fix: Path to exceptions now relative to scripts Aug 6, 2018
@bmwiedemann
Copy link
Owner

looks nice. There is one edge case when calling via bash and $PATH

> bash -x rbk
+++ pwd
++ basename /home/bernhard/code/osc/t/openSUSE:Factory/python-sure
+ pkg=python-sure
+ years=15
++ dirname rbk
+ grep -q '^python-sure$' ./exceptions/neardate
grep: ./exceptions/neardate: No such file or directory

$BASH_SOURCE instead of $0 seems to work, but maybe there is another way.
Or we just ignore it and merge as is.

@jdsn
Copy link

jdsn commented Aug 7, 2018

@bmwiedemann
Please elaborate on the issue. This is not an issue for us an our shells :)

@simson-sillage
Copy link
Contributor Author

simson-sillage commented Aug 7, 2018

@bmwiedemann Nevermind I got it reproduced. But $BASH_SOURCE is not unix shell compatible, so it wont work on your Debian system with #!/bin/sh shebang. Edit: I see that you use #!/bin/bash anyway.

So that the repository can be placed elsewhere than at ~. For
better clarity, a new `exceptions` subdirectory is added.
@simson-sillage
Copy link
Contributor Author

@bmwiedemann I changed all occurrences to $BASH_SOURCE.

@bmwiedemann bmwiedemann merged commit 3ef7a20 into bmwiedemann:master Aug 7, 2018
@simson-sillage simson-sillage deleted the fix-path branch August 8, 2018 07:41
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

Successfully merging this pull request may close these issues.

None yet

3 participants