Change-Id: Idfa7b01d96f0df6f341043d7d4d50f0c64bdbb8a
Reviewed-on: http://photon-jenkins.eng.vmware.com/579
Tested-by: jenkins-photon <wangnan2015@hotmail.com>
Reviewed-by: suezzelur <anishs@vmware.com>
... | ... |
@@ -81,8 +81,40 @@ class ToolChainUtils(object): |
81 | 81 |
self.logger.info("Successfully prepared chroot:"+chrootID) |
82 | 82 |
|
83 | 83 |
def installToolChain(self,chrootID): |
84 |
- self.installToolChain2(chrootID,constants.listToolChainRPMPkgsToInstall) |
|
84 |
+ self.logger.info("Installing toolchain.....") |
|
85 |
+ self.prepareBuildRoot(chrootID) |
|
86 |
+ cmdUtils = CommandUtils() |
|
87 |
+ |
|
88 |
+ rpmFiles = "" |
|
89 |
+ packages = "" |
|
90 |
+ for package in constants.listToolChainRPMPkgsToInstall: |
|
91 |
+ pkgUtils=PackageUtils(self.logName,self.logPath) |
|
92 |
+ rpmFile=pkgUtils.findRPMFileForGivenPackage(package) |
|
93 |
+ if rpmFile is None: |
|
94 |
+ rpmFile=self.findRPMFileInGivenLocation(package, constants.prevPublishRPMRepo) |
|
95 |
+ if rpmFile is None: |
|
96 |
+ if package == "util-linux-devel": |
|
97 |
+ self.logger.info("No old verion of util-linux-devel exists, skip until the new version is built") |
|
98 |
+ continue |
|
99 |
+ if package == "flex-devel": |
|
100 |
+ self.logger.info("No old verion of flex-devel exists, skip until the new version is built") |
|
101 |
+ continue |
|
102 |
+ |
|
103 |
+ self.logger.error("Unable to find rpm "+ package +" in current and previous versions") |
|
104 |
+ raise Exception("Input Error") |
|
105 |
+ rpmFiles += " " + rpmFile |
|
106 |
+ packages += " " + package |
|
85 | 107 |
|
108 |
+ self.logger.debug("Installing toolchain rpms:" + packages) |
|
109 |
+ cmd=self.rpmCommand + " -i --nodeps --force --root "+chrootID+" --define \'_dbpath /var/lib/rpm\' "+ rpmFiles |
|
110 |
+ process = subprocess.Popen("%s" %cmd,shell=True,stdout=subprocess.PIPE) |
|
111 |
+ retval = process.wait() |
|
112 |
+ if retval != 0: |
|
113 |
+ self.logger.error("Installing toolchain rpms failed") |
|
114 |
+ raise Exception("RPM installation failed") |
|
115 |
+ |
|
116 |
+ self.logger.info("Installed toolchain successfully on chroot:"+chrootID) |
|
117 |
+ |
|
86 | 118 |
def installCoreToolChainPackages(self,chrootID): |
87 | 119 |
self.logger.info("Installing toolchain.....") |
88 | 120 |
cmdUtils = CommandUtils() |
... | ... |
@@ -165,61 +197,35 @@ class ToolChainUtils(object): |
165 | 165 |
raise e |
166 | 166 |
|
167 | 167 |
def installToolChainRPMS(self,chrootID): |
168 |
- self.installToolChain2(chrootID,constants.listToolChainRPMPkgsToBuild) |
|
169 |
- |
|
170 |
- def installToolChain2(self,chrootID,packagesInToolChain): |
|
171 |
- self.logger.info("Installing toolchain.....") |
|
172 |
- self.prepareBuildRoot(chrootID) |
|
173 | 168 |
cmdUtils = CommandUtils() |
174 |
- |
|
169 |
+ self.prepareBuildRoot(chrootID) |
|
170 |
+ self.logger.info("Installing Tool Chain RPMS.......") |
|
175 | 171 |
rpmFiles = "" |
176 | 172 |
packages = "" |
177 |
- for package in packagesInToolChain: |
|
173 |
+ for package in constants.listToolChainRPMPkgsToBuild: |
|
178 | 174 |
pkgUtils=PackageUtils(self.logName,self.logPath) |
179 |
- currentRpmFile=pkgUtils.findRPMFileForGivenPackage(package) |
|
180 |
- |
|
181 |
- prevPublishedRpmFile=None |
|
182 |
- if currentRpmFile is None or ("-devel" not in package and "-lib" not in package and "perl" not in package): |
|
183 |
- prevPublishedRpmFile=self.findRPMFileInGivenLocation(package, constants.prevPublishRPMRepo) |
|
184 |
- if prevPublishedRpmFile is None: |
|
175 |
+ rpmFile=pkgUtils.findRPMFileForGivenPackage(package) |
|
176 |
+ if rpmFile is None: |
|
177 |
+ rpmFile=self.findRPMFileInGivenLocation(package, constants.prevPublishRPMRepo) |
|
178 |
+ if rpmFile is None: |
|
185 | 179 |
if package == "util-linux-devel": |
186 | 180 |
self.logger.info("No old verion of util-linux-devel exists, skip until the new version is built") |
187 | 181 |
continue |
188 | 182 |
if package == "flex-devel": |
189 | 183 |
self.logger.info("No old verion of flex-devel exists, skip until the new version is built") |
190 | 184 |
continue |
191 |
- |
|
192 | 185 |
self.logger.error("Unable to find rpm "+ package +" in current and previous versions") |
193 | 186 |
raise Exception("Input Error") |
187 |
+ rpmFiles += " " + rpmFile |
|
188 |
+ packages += " " + package |
|
194 | 189 |
|
195 |
- if (currentRpmFile is not None) and (prevPublishedRpmFile is not None): |
|
196 |
- temp = currentRpmFile[len(package)+ 1:] |
|
197 |
- currentRpmVersion = temp[:temp.find('-')] |
|
198 |
- temp = prevPublishedRpmFile[len(package)+1:] |
|
199 |
- prevPublishedRpmVersion = temp[:temp.find('-')] |
|
200 |
- if(currentRpmVersion != prevPublishedRpmVersion): |
|
201 |
- rpmFiles += " " + prevPublishedRpmFile |
|
202 |
- packages += " " + package |
|
203 |
- rpmFiles += " " + currentRpmFile |
|
204 |
- packages += " " + package |
|
205 |
- |
|
206 |
- else: |
|
207 |
- if prevPublishedRpmFile is not None: |
|
208 |
- rpmFiles += " " + prevPublishedRpmFile |
|
209 |
- packages += " " + package |
|
210 |
- |
|
211 |
- if currentRpmFile is not None: |
|
212 |
- rpmFiles += " " + currentRpmFile |
|
213 |
- packages += " " + package |
|
214 |
- |
|
215 |
- |
|
216 |
- self.logger.debug("Installing toolchain rpms:" + packages) |
|
217 |
- self.logger.debug("Installing toolchain rpms:" + rpmFiles) |
|
190 |
+ self.logger.debug("Installing rpms:"+packages) |
|
218 | 191 |
cmd=self.rpmCommand + " -i --nodeps --force --root "+chrootID+" --define \'_dbpath /var/lib/rpm\' "+ rpmFiles |
219 | 192 |
process = subprocess.Popen("%s" %cmd,shell=True,stdout=subprocess.PIPE) |
220 | 193 |
retval = process.wait() |
221 | 194 |
if retval != 0: |
222 |
- self.logger.error("Installing toolchain rpms failed") |
|
195 |
+ self.logger.error("Installing tool chain failed") |
|
223 | 196 |
raise Exception("RPM installation failed") |
224 |
- |
|
225 |
- self.logger.info("Installed toolchain successfully on chroot:"+chrootID) |
|
197 |
+ |
|
198 |
+ self.logger.info("Successfully installed all Tool Chain RPMS in Chroot:"+chrootID) |
|
199 |
+ |
... | ... |
@@ -15,4 +15,4 @@ fi |
15 | 15 |
|
16 | 16 |
PUBLISHRPMSPATHDIR=$1 |
17 | 17 |
|
18 |
-cat rpmfilelist | awk '{print "https://bintray.com/artifact/download/vmware/photon_release_1.0_TP2_x86_64/"$1}' | xargs -n 1 -P 10 wget --user-agent Mozilla/4.0 -c -nv -nc -r -nH --cut-dirs=4 -P ${PUBLISHRPMSPATHDIR} |
|
18 |
+cat rpmfilelist | awk '{print "https://bintray.com/artifact/download/vmware/photon_publish_rpms/"$1}' | xargs -n 1 -P 10 wget --user-agent Mozilla/4.0 -c -nv -nc -r -nH --cut-dirs=4 -P ${PUBLISHRPMSPATHDIR} |
... | ... |
@@ -1,78 +1,80 @@ |
1 |
-x86_64/python2-devel-2.7.9-3.ph1tp2.x86_64.rpm |
|
2 |
-x86_64/nss-devel-3.19-2.ph1tp2.x86_64.rpm |
|
3 |
-x86_64/tar-1.27.1-1.ph1tp2.x86_64.rpm |
|
4 |
-x86_64/libpipeline-1.2.6-1.ph1tp2.x86_64.rpm |
|
5 |
-noarch/linux-api-headers-4.0.9-1.ph1tp2.noarch.rpm |
|
6 |
-x86_64/expat-2.1.0-1.ph1tp2.x86_64.rpm |
|
7 |
-x86_64/make-4.0-1.ph1tp2.x86_64.rpm |
|
8 |
-x86_64/libstdc%2B%2B-4.8.2-4.ph1tp2.x86_64.rpm |
|
9 |
-x86_64/sed-4.2.2-1.ph1tp2.x86_64.rpm |
|
10 |
-x86_64/libgcc-4.8.2-4.ph1tp2.x86_64.rpm |
|
11 |
-x86_64/findutils-4.4.2-1.ph1tp2.x86_64.rpm |
|
12 |
-x86_64/file-5.22-1.ph1tp2.x86_64.rpm |
|
13 |
-x86_64/popt-1.16-1.ph1tp2.x86_64.rpm |
|
14 |
-x86_64/gdbm-1.11-1.ph1tp2.x86_64.rpm |
|
15 |
-x86_64/patch-2.7.5-1.ph1tp2.x86_64.rpm |
|
16 |
-x86_64/texinfo-5.2-2.ph1tp2.x86_64.rpm |
|
17 |
-x86_64/glibc-devel-2.21-5.ph1tp2.x86_64.rpm |
|
18 |
-x86_64/gcc-4.8.2-4.ph1tp2.x86_64.rpm |
|
19 |
-x86_64/nss-3.19-2.ph1tp2.x86_64.rpm |
|
20 |
-x86_64/gmp-devel-5.1.3-1.ph1tp2.x86_64.rpm |
|
21 |
-x86_64/libgcc-devel-4.8.2-4.ph1tp2.x86_64.rpm |
|
22 |
-x86_64/groff-1.22.2-1.ph1tp2.x86_64.rpm |
|
23 |
-x86_64/libstdc%2B%2B-devel-4.8.2-4.ph1tp2.x86_64.rpm |
|
24 |
-x86_64/lua-5.2.3-1.ph1tp2.x86_64.rpm |
|
25 |
-x86_64/glibc-2.21-5.ph1tp2.x86_64.rpm |
|
26 |
-x86_64/elfutils-libelf-devel-0.158-3.ph1tp2.x86_64.rpm |
|
27 |
-x86_64/gettext-0.18.3.2-1.ph1tp2.x86_64.rpm |
|
28 |
-x86_64/perl-5.18.2-2.ph1tp2.x86_64.rpm |
|
29 |
-x86_64/coreutils-8.22-1.ph1tp2.x86_64.rpm |
|
30 |
-x86_64/rpm-4.11.2-6.ph1tp2.x86_64.rpm |
|
31 |
-x86_64/rpm-build-4.11.2-6.ph1tp2.x86_64.rpm |
|
32 |
-x86_64/rpm-devel-4.11.2-6.ph1tp2.x86_64.rpm |
|
33 |
-x86_64/man-db-2.6.6-1.ph1tp2.x86_64.rpm |
|
34 |
-x86_64/elfutils-libelf-0.158-3.ph1tp2.x86_64.rpm |
|
35 |
-x86_64/python2-libs-2.7.9-3.ph1tp2.x86_64.rpm |
|
36 |
-x86_64/m4-1.4.17-1.ph1tp2.x86_64.rpm |
|
37 |
-x86_64/gmp-5.1.3-1.ph1tp2.x86_64.rpm |
|
38 |
-x86_64/mpfr-devel-3.1.2-1.ph1tp2.x86_64.rpm |
|
39 |
-x86_64/xz-5.0.5-2.ph1tp2.x86_64.rpm |
|
40 |
-x86_64/procps-ng-3.3.9-2.ph1tp2.x86_64.rpm |
|
41 |
-x86_64/flex-2.5.38-2.ph1tp2.x86_64.rpm |
|
42 |
-x86_64/lua-devel-5.2.3-1.ph1tp2.x86_64.rpm |
|
43 |
-x86_64/popt-devel-1.16-1.ph1tp2.x86_64.rpm |
|
44 |
-x86_64/mpc-1.0.2-1.ph1tp2.x86_64.rpm |
|
45 |
-x86_64/ncurses-devel-5.9-2.ph1tp2.x86_64.rpm |
|
46 |
-x86_64/ncurses-5.9-2.ph1tp2.x86_64.rpm |
|
47 |
-x86_64/bzip2-1.0.6-3.ph1tp2.x86_64.rpm |
|
48 |
-x86_64/gawk-4.1.0-2.ph1tp2.x86_64.rpm |
|
49 |
-x86_64/cpio-2.11-2.ph1tp2.x86_64.rpm |
|
50 |
-x86_64/libtool-2.4.2-1.ph1tp2.x86_64.rpm |
|
51 |
-x86_64/sqlite-autoconf-3080301-1.ph1tp2.x86_64.rpm |
|
52 |
-x86_64/libffi-3.1-1.ph1tp2.x86_64.rpm |
|
53 |
-x86_64/openssl-devel-1.0.2d-2.ph1tp2.x86_64.rpm |
|
54 |
-x86_64/readline-6.3-3.ph1tp2.x86_64.rpm |
|
55 |
-x86_64/util-linux-2.24.1-2.ph1tp2.x86_64.rpm |
|
56 |
-x86_64/elfutils-devel-0.158-3.ph1tp2.x86_64.rpm |
|
57 |
-x86_64/bash-4.3-4.ph1tp2.x86_64.rpm |
|
58 |
-x86_64/python2-2.7.9-3.ph1tp2.x86_64.rpm |
|
59 |
-x86_64/zlib-devel-1.2.8-2.ph1tp2.x86_64.rpm |
|
60 |
-x86_64/binutils-devel-2.25-1.ph1tp2.x86_64.rpm |
|
61 |
-x86_64/autoconf-2.69-3.ph1tp2.x86_64.rpm |
|
62 |
-x86_64/grep-2.21-1.ph1tp2.x86_64.rpm |
|
63 |
-x86_64/readline-devel-6.3-3.ph1tp2.x86_64.rpm |
|
64 |
-x86_64/nspr-4.10.8-1.ph1tp2.x86_64.rpm |
|
65 |
-x86_64/diffutils-3.3-2.ph1tp2.x86_64.rpm |
|
66 |
-x86_64/zlib-1.2.8-2.ph1tp2.x86_64.rpm |
|
67 |
-x86_64/elfutils-0.158-3.ph1tp2.x86_64.rpm |
|
68 |
-x86_64/openssl-1.0.2d-2.ph1tp2.x86_64.rpm |
|
69 |
-x86_64/libgomp-4.8.2-4.ph1tp2.x86_64.rpm |
|
70 |
-x86_64/libgomp-devel-4.8.2-4.ph1tp2.x86_64.rpm |
|
71 |
-x86_64/bison-3.0.2-2.ph1tp2.x86_64.rpm |
|
72 |
-x86_64/bzip2-devel-1.0.6-3.ph1tp2.x86_64.rpm |
|
73 |
-x86_64/gzip-1.6-1.ph1tp2.x86_64.rpm |
|
74 |
-noarch/man-pages-3.59-1.ph1tp2.noarch.rpm |
|
75 |
-x86_64/mpfr-3.1.2-1.ph1tp2.x86_64.rpm |
|
76 |
-x86_64/automake-1.15-1.ph1tp2.x86_64.rpm |
|
77 |
-x86_64/binutils-2.25-1.ph1tp2.x86_64.rpm |
|
78 |
-x86_64/pkg-config-0.28-1.ph1tp2.x86_64.rpm |
|
1 |
+noarch/linux-api-headers-4.2.0-1.ph1.noarch.rpm |
|
2 |
+noarch/man-pages-3.59-1.ph1.noarch.rpm |
|
3 |
+x86_64/python2-devel-2.7.11-1.ph1.x86_64.rpm |
|
4 |
+x86_64/nspr-4.11-1.ph1.x86_64.rpm |
|
5 |
+x86_64/rpm-4.11.2-6.ph1.x86_64.rpm |
|
6 |
+x86_64/binutils-devel-2.25.1-1.ph1.x86_64.rpm |
|
7 |
+x86_64/nss-3.21-1.ph1.x86_64.rpm |
|
8 |
+x86_64/mpfr-devel-3.1.3-1.ph1.x86_64.rpm |
|
9 |
+x86_64/cpio-2.12-1.ph1.x86_64.rpm |
|
10 |
+x86_64/sed-4.2.2-1.ph1.x86_64.rpm |
|
11 |
+x86_64/libffi-3.2.1-1.ph1.x86_64.rpm |
|
12 |
+x86_64/gmp-6.0.0a-1.ph1.x86_64.rpm |
|
13 |
+x86_64/diffutils-3.3-2.ph1.x86_64.rpm |
|
14 |
+x86_64/gcc-5.3.0-1.ph1.x86_64.rpm |
|
15 |
+x86_64/gmp-devel-6.0.0a-1.ph1.x86_64.rpm |
|
16 |
+x86_64/automake-1.15-1.ph1.x86_64.rpm |
|
17 |
+x86_64/groff-1.22.2-1.ph1.x86_64.rpm |
|
18 |
+x86_64/readline-6.3-3.ph1.x86_64.rpm |
|
19 |
+x86_64/gettext-0.19.5.1-1.ph1.x86_64.rpm |
|
20 |
+x86_64/perl-5.22.1-2.ph1.x86_64.rpm |
|
21 |
+x86_64/man-db-2.7.5-1.ph1.x86_64.rpm |
|
22 |
+x86_64/elfutils-libelf-0.165-1.ph1.x86_64.rpm |
|
23 |
+x86_64/gdbm-1.11-1.ph1.x86_64.rpm |
|
24 |
+x86_64/autoconf-2.69-3.ph1.x86_64.rpm |
|
25 |
+x86_64/rpm-devel-4.11.2-6.ph1.x86_64.rpm |
|
26 |
+x86_64/file-5.24-1.ph1.x86_64.rpm |
|
27 |
+x86_64/mpfr-3.1.3-1.ph1.x86_64.rpm |
|
28 |
+x86_64/zlib-devel-1.2.8-2.ph1.x86_64.rpm |
|
29 |
+x86_64/libgcc-devel-5.3.0-1.ph1.x86_64.rpm |
|
30 |
+x86_64/bison-3.0.4-1.ph1.x86_64.rpm |
|
31 |
+x86_64/lua-5.3.2-1.ph1.x86_64.rpm |
|
32 |
+x86_64/util-linux-2.27.1-1.ph1.x86_64.rpm |
|
33 |
+x86_64/rpm-build-4.11.2-6.ph1.x86_64.rpm |
|
34 |
+x86_64/procps-ng-3.3.11-1.ph1.x86_64.rpm |
|
35 |
+x86_64/coreutils-8.24-1.ph1.x86_64.rpm |
|
36 |
+x86_64/util-linux-devel-2.27.1-1.ph1.x86_64.rpm |
|
37 |
+x86_64/m4-1.4.17-1.ph1.x86_64.rpm |
|
38 |
+x86_64/grep-2.21-1.ph1.x86_64.rpm |
|
39 |
+x86_64/tar-1.28-1.ph1.x86_64.rpm |
|
40 |
+x86_64/bash-4.3.30-1.ph1.x86_64.rpm |
|
41 |
+x86_64/ncurses-devel-6.0-1.ph1.x86_64.rpm |
|
42 |
+x86_64/gawk-4.1.3-1.ph1.x86_64.rpm |
|
43 |
+x86_64/libtool-2.4.6-1.ph1.x86_64.rpm |
|
44 |
+x86_64/zlib-1.2.8-2.ph1.x86_64.rpm |
|
45 |
+x86_64/python2-libs-2.7.11-1.ph1.x86_64.rpm |
|
46 |
+x86_64/libgomp-5.3.0-1.ph1.x86_64.rpm |
|
47 |
+x86_64/readline-devel-6.3-3.ph1.x86_64.rpm |
|
48 |
+x86_64/sqlite-autoconf-3.11.0-1.ph1.x86_64.rpm |
|
49 |
+x86_64/flex-2.5.39-1.ph1.x86_64.rpm |
|
50 |
+x86_64/libstdc%2B%2B-devel-5.3.0-1.ph1.x86_64.rpm |
|
51 |
+x86_64/openssl-1.0.2f-1.ph1.x86_64.rpm |
|
52 |
+x86_64/elfutils-0.165-1.ph1.x86_64.rpm |
|
53 |
+x86_64/expat-2.1.0-1.ph1.x86_64.rpm |
|
54 |
+x86_64/popt-1.16-1.ph1.x86_64.rpm |
|
55 |
+x86_64/mpc-1.0.3-1.ph1.x86_64.rpm |
|
56 |
+x86_64/bzip2-1.0.6-4.ph1.x86_64.rpm |
|
57 |
+x86_64/glibc-2.22-3.ph1.x86_64.rpm |
|
58 |
+x86_64/python2-2.7.11-1.ph1.x86_64.rpm |
|
59 |
+x86_64/elfutils-devel-0.165-1.ph1.x86_64.rpm |
|
60 |
+x86_64/patch-2.7.5-1.ph1.x86_64.rpm |
|
61 |
+x86_64/xz-5.2.2-1.ph1.x86_64.rpm |
|
62 |
+x86_64/binutils-2.25.1-1.ph1.x86_64.rpm |
|
63 |
+x86_64/libgomp-devel-5.3.0-1.ph1.x86_64.rpm |
|
64 |
+x86_64/bzip2-devel-1.0.6-4.ph1.x86_64.rpm |
|
65 |
+x86_64/libgcc-5.3.0-1.ph1.x86_64.rpm |
|
66 |
+x86_64/gzip-1.6-1.ph1.x86_64.rpm |
|
67 |
+x86_64/elfutils-libelf-devel-0.165-1.ph1.x86_64.rpm |
|
68 |
+x86_64/openssl-devel-1.0.2f-1.ph1.x86_64.rpm |
|
69 |
+x86_64/pkg-config-0.28-1.ph1.x86_64.rpm |
|
70 |
+x86_64/popt-devel-1.16-1.ph1.x86_64.rpm |
|
71 |
+x86_64/flex-devel-2.5.39-1.ph1.x86_64.rpm |
|
72 |
+x86_64/findutils-4.4.2-1.ph1.x86_64.rpm |
|
73 |
+x86_64/libstdc%2B%2B-5.3.0-1.ph1.x86_64.rpm |
|
74 |
+x86_64/libpipeline-1.4.1-1.ph1.x86_64.rpm |
|
75 |
+x86_64/make-4.1-1.ph1.x86_64.rpm |
|
76 |
+x86_64/glibc-devel-2.22-3.ph1.x86_64.rpm |
|
77 |
+x86_64/lua-devel-5.3.2-1.ph1.x86_64.rpm |
|
78 |
+x86_64/ncurses-6.0-1.ph1.x86_64.rpm |
|
79 |
+x86_64/texinfo-6.1-1.ph1.x86_64.rpm |
|
80 |
+x86_64/nss-devel-3.21-1.ph1.x86_64.rpm |