-
Notifications
You must be signed in to change notification settings - Fork 59
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
Cleaner and more verbose extract.sh; drop bash dependency #67
Conversation
Looks good to me, what do you think about using set -e? |
I prefer explicit error handling and almost never use In this particular case, while We could add a cleanup function, either to be invoked by the user manually ( While in theory cleanup could be triggered by using https://mywiki.wooledge.org/BashFAQ/105 Somewhat related thoughts, for your consideration:
|
- use POSIX options with cpio and tar for portability - drop dependency on working directory - add 'clean' subprogram
Made the script more portable, #62 is now partially fixed, but libarchive cpio aka bsdcpio failing to extract 123UNIX4.IMG is something that still needs looking into. |
Skip duplicate / junk data at beginning of 123UNIX4.IMG. Now it can be extracted with both GNU and BSD (libarchive) cpio.
Fully fixed #62. |
Begginings of
This is where in
It's hard to say how and when, but it almost seems like |
Thanks this looks good to me - I'm tempted to wait to merge until the keymap tool is done #65 (hopefully tomorrow), because right now it just uses xterm for everything. I think I can just pull all the right sequences from termcap and it will be a pretty good default. |
Never mind, I changed my mind, let's just commit it for now. |
I recommend a habit of avoiding all-caps variable names in shell scripts to reduce the chance of collisions with shell and environment variable names. http://mywiki.wooledge.org/BashGuide/InputAndOutput#The_Environment |
We should definitely be careful not to clobber any exported variables, lest they be exported to our child processes inadvertently modified. Regarding naming style, I try to stick to an old convention of using ALL_CAPS for constants (vars not modified after assignment) and exported vars. As a reference, Google shell scripting style guide also recommends this: https://google.github.io/styleguide/shellguide.html#s7.3-constants-and-environment-variable-names |
I'm hearing about issues with the new extract script - I'm tempted to revert it for now until I can test it more thoroughly. (I just heard it hangs under WSL2, I don't really know why) |
I figured out the problem, it wasn't hanging, disk i/o on wsl2 is just ridiculously slow - so the dd seeking with bs=1 was just taking forever. I'll re-merge this tomorrow. |
@taviso Try inverting the parameters ( The root cause of why In the meantime, you could also just upload the trimmed version of |
Yeah, It's really unfortunate - the original files I recovered were TD0 files, so I thought maybe the tool I used to recover the images were buggy - but I've tried three independent implementations and they all produce the same file. I guess it's possible this is some form of copy protection, I know that the 123 DOS and Agenda disk images had some unusual properties that made them difficult to copy. |
Tidying up this script a bit as well.