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

md5sum not available by default on macOS #7

Closed
grigutis opened this issue Nov 17, 2017 · 9 comments · May be fixed by #8
Closed

md5sum not available by default on macOS #7

grigutis opened this issue Nov 17, 2017 · 9 comments · May be fixed by #8

Comments

@grigutis
Copy link

grigutis commented Nov 17, 2017

Hi,

md5sum isn't available on macOS so install.sh fails for me:

### Checking archive files for existence, readability and integrity.

automysqlbackup ... exists and is readable ... md5sum failed :(

but md5 -r would work and openssl md5 is another option. See this comment which might help.

I'd like to install this on macOS High Sierra (10.13).

@BigAndini
Copy link
Contributor

Hi, thanks for this enhancement. Can you please have a try if the install.sh of the actual master branch is working on MacOS?

Cheers
Andi

@grigutis
Copy link
Author

Thanks for the quick reply. It looks like the syntax is a bit off:

### Checking archive files for existence, readability and integrity.

automysqlbackup ... exists and is readable ... ./install.sh: line 433: =md5 -r: command not found
md5sum okay :)
automysqlbackup.conf ... exists and is readable ... ./install.sh: line 433: =md5 -r: command not found
md5sum okay :)
README ... exists and is readable ... ./install.sh: line 433: =md5 -r: command not found
md5sum okay :)
LICENSE ... exists and is readable ... ./install.sh: line 433: =md5 -r: command not found
md5sum okay :)

I don't know where the = is coming from. Here is the first few lines from bash -x install.sh:

+ echo '### Checking archive files for existence, readability and integrity.'
### Checking archive files for existence, readability and integrity.
+ echo

+ precheck_files=(automysqlbackup 31e3b0fe937af7ba3c4015543cd2a848 automysqlbackup.conf b70bc8a814400cf41b8e6228d7bbc963 README b17740fcd3a5f8579b907a42249a83cd LICENSE 39bba7d2cf0ba1036f2a6e2be52fe3f0)
+ n=4
+ i=0
+ '[' 0 -lt 4 ']'
+ printf 'automysqlbackup ... '
automysqlbackup ... + '[' -r automysqlbackup ']'
+ printf 'exists and is readable ... '
exists and is readable ... + [[ darwin17 == \l\i\n\u\x\-\g\n\u ]]
+ [[ darwin17 == \d\a\r\w\i\n* ]]
+ '=md5 -r'
install.sh: line 433: =md5 -r: command not found
+ echo '31e3b0fe937af7ba3c4015543cd2a848  automysqlbackup'
+ printf 'md5sum okay :)\n'
md5sum okay :)
…

@grigutis
Copy link
Author

I found the problem. These lines:

$MD5_CHECK="…"

should be

MD5_CHECK="…"

I also noticed md5sum is used in the automysqlbackup script, so they should be changed there as well. Maybe MD5_CHECK should be added as a variable in the conf file when the user runs install.sh. Then automysqlbackup can just run whatever MD5_CHECK is set to.

@BigAndini
Copy link
Contributor

Can you please check the master if it's working in the master? If so I'll release a new version.

@grigutis
Copy link
Author

Thanks again.

It got past the errors this time, but I just realized that md5 -r isn't equivalent to md5sum --check, only md5sum. There is no built-in checking option in md5. So if I modify the files, it will always return 0. :-(

Sorry, this is looking like a lot more work than I thought it would be. I can just manually modify the script for now.

@StephenAtty
Copy link

This is happening on Linux with the newly released 3.0.6 :

tmp/AutoMySQLBackup-3.0.6# ./install.sh

Checking archive files for existence, readability and integrity.

automysqlbackup ... exists and is readable ... md5sum failed :(

grep 'precheck_files=( automysqlbackup' install.sh
precheck_files=( automysqlbackup 880dca1b4cfe3ac0513561af0e254dd0

md5sum automysqlbackup
39af0eec980be69523e3f93cf9e282d0 automysqlbackup

@silverwind
Copy link

Yeah, md5's are currently not matching with what is on master. I'd suggest removing the md5 check, if the files come from a git checkout, one can be reasonably sure that they are alright.

@BigAndini
Copy link
Contributor

@silverwind You're right, I've removed the md5 check. Would you like to try the install.sh from the new master again?

@silverwind
Copy link

Looking good. I think you can resolve this issue.

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 a pull request may close this issue.

4 participants