crypt: make it possible to compile and test on macOS

Our current crypt implmentation requires glibc to be available on the
developer's system. But it is not strictly necessary, because I'd like
to run at least unit tests on mac. This PR makes it possible to compile
and run unit-tests on mac, but it will panic if someone tries to run
osbuild-composer on mac.
This commit is contained in:
Martin Sehnoutka 2020-01-18 13:41:41 +01:00 committed by msehnout
parent 7bdd51cd23
commit aab8a4d305
2 changed files with 10 additions and 0 deletions

View file

@ -1,3 +1,5 @@
// +build !macos
// Copied from https://github.com/amoghe/go-crypt/blob/b3e291286513a0c993f7c4dd7060d327d2d56143/crypt_r.go
// Original sources are under MIT license:
// The MIT License (MIT)

View file

@ -0,0 +1,8 @@
// +build macos
package crypt
func crypt(pass, salt string) (string, error) {
panic("You must not run osbuild-composer on macOS!")
return "", nil
}