-
Notifications
You must be signed in to change notification settings - Fork 30
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
The current sed script delete everything #225
Conversation
This easy fix, while not super robust, seems a first good patch
strange, I'll take a look as well |
Oh my - it only deletes the first appearance. Unfortunately, the first time status is written, there is only one appearance. |
If you agree, I'll do an emergency release for conference reasons. |
share/pot/set-status.sh
Outdated
-e '/^pot\.status=/{n;bc' -e ':c' -e 'p;n;bc' -e '}' \ | ||
-e "p;n;ba" "$_status_file" | ||
if [ "$(grep -c "^pot\.status=" "$_status_file")" -gt 1 ]; then | ||
${SED} -i '' -e '1d' "$_status_file" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${SED} -i '' -e '1d' "$_status_file" | |
${SED} -i '' -n -e ":a" \ | |
-e '/^pot\.status=/{n;bc' -e ':c' -e 'p;n;bc' -e '}' \ | |
-e "p;n;ba" "$_status_file"' |
This (combined with your new check) should work fine. It always removes the first status line (but it doesn't figure out that there is only one, which is what your grep fixes now). >_<
I can test the proposed patch right away, should work just fine, but I can confirm in a few minutes. |
Just updated the patch to call sed only if there are multiple entries |
So the patch seems to work. But there are more problems. I'll elaborate in a second. |
Technically, we can rework it to overwrite the entire file with the last entry available (like get_status) |
So basically, problems during start keep the pot stuck in "starting", since it can't go from "starting" directly to "stopping". Updated |
No, the patch is fine and solves the issue at hand. We have an unrelated problem in the logic (see details above). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the problem described, but a separate issue persists.
I see your point |
So basically "start-cleanup" calls "pot stop" and if the pot hasn't started yet, it can't stop (stopping->stopped). |
I think the cleanest solution would be a new status like "doa" and allow to go from "doa" to stopping as well (just like from started). |
Patch incoming... |
This easy fix, while not super robust, seems a first good patch
fix #224