]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
mg-*: Add mgi-common with fetch and fail helpers
authorIan Campbell <ian.campbell@citrix.com>
Fri, 19 Jun 2015 10:51:54 +0000 (11:51 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 26 Jun 2015 15:37:34 +0000 (16:37 +0100)
Taken from both mg-cpu-microcode-update and mg-debian-installer-update

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v3: New patch

mg-cpu-microcode-update
mg-debian-installer-update
mgi-common [new file with mode: 0644]

index 759f67624cbb6d6abacfdb84b5ea4aa454197db4..c375a43a0a8e0c24567e78c875421293f582af74 100755 (executable)
@@ -3,6 +3,7 @@
 set -e
 
 . cri-getconfig
+. mgi-common
 
 # iucode_tool is in /usr/sbin, see #788459.
 export PATH="/usr/local/sbin:$PATH:/sbin:/usr/sbin"
@@ -41,7 +42,7 @@ INTEL_TGZ='http://downloadmirror.intel.com/24661/eng/microcode-20150121.tgz'
 mkdir intel-ucode
 
 echo >&2 "Fetching Intel ucode"
-curl -s $INTEL_TGZ > intel-ucode/microcode.tgz
+fetch $INTEL_TGZ > intel-ucode/microcode.tgz
 
 tar -C intel-ucode -xaf intel-ucode/microcode.tgz microcode.dat
 
index 77d806d6e2583b2aa158b4cbf2026a84a1f7b606..41e1c0dab0cf29d3367ac38e9bcfad005da0929b 100755 (executable)
 set -e
 
 . cri-getconfig
+. mgi-common
 
 suite=$1
 arch=$2
 packages="$3"
 
-fail () { echo >&2 "$0: $1"; exit 1; }
-
 site=http://ftp.debian.org/debian/
 sbase=$site/dists/$suite
 
-fetch () {
-       # no-cache due to intercepting proxies messing things up.
-       curl -s -H 'Pragma: no-cache' $1
-}
-
 case ${suite}_${arch} in
     lenny_armhf|squeeze_armhf|lenny_arm64|squeeze_arm64|wheezy_arm64)
         # No such thing.
diff --git a/mgi-common b/mgi-common
new file mode 100644 (file)
index 0000000..de86e8d
--- /dev/null
@@ -0,0 +1,26 @@
+# -*- bash -*-
+
+# Helpers for mg-*
+#
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2015 Citrix Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+fail () { echo >&2 "$0: $1"; exit 1; }
+
+fetch () {
+       # no-cache due to intercepting proxies messing things up.
+       curl -s -H 'Pragma: no-cache' $1
+}