File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed
src/main/java/org/sqlite/util Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ linux64: $(SQLITE_UNPACKED) jni-header
129129 docker run $(DOCKER_RUN_OPTS ) -ti -v $$ PWD:/work xerial/centos5-linux-x86_64 bash -c ' make clean-native native OS_NAME=Linux OS_ARCH=x86_64'
130130
131131alpine-linux64 : $(SQLITE_UNPACKED ) jni-header
132- docker run $(DOCKER_RUN_OPTS ) -ti -v $$ PWD:/work xerial/alpine-linux-x86_64 bash -c ' make clean-native native OS_NAME=Linux OS_ARCH=x86_64'
132+ docker run $(DOCKER_RUN_OPTS ) -ti -v $$ PWD:/work xerial/alpine-linux-x86_64 bash -c ' make clean-native native OS_NAME=Linux-Alpine OS_ARCH=x86_64'
133133
134134linux-arm : $(SQLITE_UNPACKED ) jni-header
135135 ./docker/dockcross-armv5 -a $(DOCKER_RUN_OPTS ) bash -c ' make clean-native native CROSS_PREFIX=/usr/xcc/armv5-unknown-linux-gnueabi/bin/armv5-unknown-linux-gnueabi- OS_NAME=Linux OS_ARCH=arm'
Original file line number Diff line number Diff line change 1- FROM alpine
1+ FROM alpine:3.11
22MAINTAINER Taro L. Saito <leo@xerial.org>
33
44RUN apk --update add bash gcc make perl libc-dev
Original file line number Diff line number Diff line change @@ -113,6 +113,33 @@ public static boolean isAndroid() {
113113 return System .getProperty ("java.runtime.name" , "" ).toLowerCase ().contains ("android" );
114114 }
115115
116+ public static boolean isAlpine () {
117+ try {
118+ Process p = Runtime .getRuntime ().exec ("cat /etc/os-release | grep ^ID" );
119+ p .waitFor ();
120+
121+ InputStream in = p .getInputStream ();
122+ try {
123+ int readLen = 0 ;
124+ ByteArrayOutputStream b = new ByteArrayOutputStream ();
125+ byte [] buf = new byte [32 ];
126+ while ((readLen = in .read (buf , 0 , buf .length )) >= 0 ) {
127+ b .write (buf , 0 , readLen );
128+ }
129+ return b .toString ().toLowerCase ().contains ("alpine" );
130+ }
131+ finally {
132+ if (in != null ) {
133+ in .close ();
134+ }
135+ }
136+
137+ } catch (Throwable e ) {
138+ return false ;
139+ }
140+
141+ }
142+
116143 static String getHardwareName () {
117144 try {
118145 Process p = Runtime .getRuntime ().exec ("uname -m" );
@@ -222,6 +249,9 @@ static String translateOSNameToFolderName(String osName) {
222249 else if (osName .contains ("Mac" ) || osName .contains ("Darwin" )) {
223250 return "Mac" ;
224251 }
252+ else if (isAlpine ()) {
253+ return "Linux-Alpine" ;
254+ }
225255 else if (osName .contains ("Linux" )) {
226256 return "Linux" ;
227257 }
You can’t perform that action at this time.
0 commit comments