Procházet zdrojové kódy

Grab header name from spec file (fixes #31) (#32)

rolinux před 6 roky
rodič
revize
6138276de1
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. 3 2
      platform-upgrade

+ 3 - 2
platform-upgrade

@@ -111,8 +111,9 @@ fi
 if [[ ! -n $platform_url ]]; then
     host=https://us-east.manta.joyent.com
     latest_path="${host}$(_curl "$host/Joyent_Dev/public/SmartOS/latest")"
-    version="$(expr "$latest_path" : '.*\([0-9]\{8\}T[0-9]\{6\}Z\).*')"
-    header="$(expr "$version" : '\([0-9]\{8\}\)T.*')"
+    version="$(expr "$latest_path" : '.*\([0-9]\{8\}T[0-9]\{6\}Z\).*')
+    latest_spec_path="$(_curl "$host/Joyent_Dev/public/SmartOS/$version")"
+    header="$(expr "$latest_spec_path" : '.*platform-release-\([0-9]\{8\}\)-.*')"
     platform_url="$latest_path/platform-release-$header-$version.tgz"
     if [[ ! -n $md5sums_url ]]; then
         md5sums_url="$latest_path/md5sums.txt"