-
Notifications
You must be signed in to change notification settings - Fork 505
METRON-720 modify generate-md.sh to re-throw errors from within 'find' #455
Conversation
…', and METRON-719 use of quadruple back-ticks in README.md file
|
Nice catch. When I get to my laptop I'll throw you a PR with some of my standard bash script features, since it's getting modified anyway. Just a couple of minor things. |
|
PR to your branch is open. Feel free to merge --squash without attribution, or not merge and go forward without it. +1 (non-binding) the current state by inspection. |
|
Tested branch locally, with and without 4 backticks. Looks good to me. +1 Side note, I noticed that the sensors link doesn't go anywhere. |
|
Hm, that's only when building with the bin scripts. re sensor links EDIT: nevermind - found the problem was something local. Looks good. |
|
@JonZeolla , sorry traveling yesterday. Will look at it this evening. |
d835043 to
6ca2a85
Compare
|
@JonZeolla , thanks for the suggestions. Incorporated the SIG traps and better exit codes, as well as improvements to the 'find -exec' error catching logic. Also added 'set -e' and trap on ERR, and fixed an exit code in the fix-md-dialect.py script. Changes related to $() vs ``, and explicit declaration of array variables that are being initialized on first use, are valid alternative syntax, but my usages are equivalent. I consider the variants I used to be less cluttered, so I kept them. While I was at it, I also fixed METRON-717, splitting site.xml into a tracked template file and an untracked auto-generated portion, in git. |
|
Sounds good to me. I typically use declare for all variables just to be explicit and obvious with my intent, and use $() as a standard for readability and easy nesting as opposed to ``. That said, as you mentioned, they are definitely equivalent to what you have across the board. I did a quick review on my phone, but there are enough changes it probably merits a run up and validation on a screen larger than 5". That said, I would consider adding something like: To the quit function to reinstate the prior site.xml (replacing |
|
I'm not going to have time to review this more than I already have. +1 (non-binding) via inspection, pending an addition of my last post's |
|
Hi @JonZeolla , thanks for taking a look amidst the other demands on your time. I disagree with 'mv $fullpath/site.xml.bak $fullpath/site.xml' for the following reasons:
Please accept my not incorporating this change :-) BTW, for Jon and all reviewers, I should mention that after this patch I did a full re-validation of the site-book, both by:
No unexpected differences were found. Thanks. |
|
Ok, yep, I'm +1 on this. Also, I agree with the reasoning around not having a bak file. Especially compelling is the first bullet point that |
|
I surprisingly found time to take another look. I'm a -1 (non-binding) on this for now, primarily because I think I able to fix the issue by changing that line to EDIT: Ran this up really quickly on my Mac. The above fix seems to work there too. Didn't take a very deep look though. Regarding the prior discussions |
|
Either as @JonZeolla says or you could also do |
|
re: "site.xml is now a fully auto-generated file" that would be why it is showing in git as unstaged but modified? |
|
@ottobackwards yeah, we probably need site.xml to be in the |
|
Hey @ottobackwards site.xml is now in .gitignore with @mattf-horton's latest changes. |
|
ok - i'm not building this branch, just what i've seen from other builds |
|
Hi @JonZeolla , @ottobackwards , @cestella , @mmiklavc ,
Since I have to make another commit to fix #1 and #2, I will also split #3 back into separate commits. Thanks. |
Also fixed a link in one content source file. And did METRON-717 Move site.xml to site.xml.template as the tracked file, so site.xml is purely auto-generated. Adding site.xml to .gitignore will be in the next commit, so it doesn't get untracked before being moved!
6ca2a85 to
904aede
Compare
|
I have pushed fixes for all of the above. To fix item 3 I had to change history, so you'll need to "pull -f" to update an existing image. I tested code fragments and confirmed that "basename -s" works fine on Centos7 but breaks as described by @JonZeolla on Centos6. The revised code fragments work on both and on Mac OS X. I'm now testing the whole site-book implementation on both Centos 6 and 7. Will report results. |
|
Spun it up on CentOS 6.8 and macOX 10.12.3, and did a quick code review. Spot tested the traps as well. +1 (non-binding). The only thing I noticed is I don't think this is necessary due to the |
|
I've tested it to completion on both Centos 6 and 7. It works and generates identical src and site file trees. I also tested the trap on SIGINT, which worked on all three platforms. I tested the trap on ERR but only on Mac. @JonZeolla , the 'rm -f outfile' before 'blah 2> outfile' may be unnecessary. I did so on the premise that the file might pre-exist and be readonly. In that case, I'm not sure whether the '>' operator deletes the file, or attempts to rewrite it; the former would succeed, the latter would fail. Whereas the 'rm -f' is guaranteed to succeed, because we earlier tested the parent directory for write privs. At any rate, as you observed, it is at worst unnecessary but harmless. Thanks for the +1. |
|
I just checked, and this PR branch rebases to master without conflict, which I think means it will merge without conflict. If anyone would consider committing it, let me know if you need me to rebase it first. Thanks. |
This patch also fixes, en passant:
METRON-719 use of quadruple back-ticks in README.md file
which is the problem that caused the need for METRON-720.