]> git.sven.stormbind.net Git - sven/java-package.git/blobdiff - lib/common.sh
Add Java 10 Server JRE support now that it's released.
[sven/java-package.git] / lib / common.sh
index 1e5c30b7d0328097c080a508f2bd121a35b42321..ab07236aa54b5c82933d2c350a1506a14bb383ef 100644 (file)
@@ -18,7 +18,7 @@ read_yn() {
 # diskusage <path>: prints size in MB
 diskusage() {
     local path="$1"
-    read size dummy < <( du -sm "$path" )
+    read size dummy < <( du -sm --apparent-size "$path" )
     echo "$size"
 }
 
@@ -128,6 +128,15 @@ EOF
     fi
 }
 
+extract_jce() {
+  local zip_file="$1"
+  local dest_dir="$2"
+
+  echo "Installing unlimited strength cryptography files using $zip_file"
+  for f in {US_export,local}_policy.jar; do
+    unzip -o -j -d "$dest_dir" "$zip_file" "*/$f"
+  done
+}
 
 read_maintainer_info() {
     if [ -z "$maintainer_name" ]; then
@@ -202,3 +211,10 @@ get_browser_plugin_dirs() {
     fi
 }
 
+get_distribution() {
+    if [ -n "$distribution" ]; then
+      target_distribution="$distribution"
+    else
+      target_distribution="unstable"
+    fi
+}