I don't think the complete program would be helpful; it's part of a largish internal build system.
There is no particular "buildnum"; we use an incrementing build number internally to identify particular builds. You can omit it. On Thu, Apr 16, 2015 at 11:43:44PM +0800, Po-Ching Lin wrote: > Dear Ben, > > Thank you very much for the information. > > The following piece of code seems to be part of a Python program. > Would you > mind providing us the complete program? Although we can "run" the program in > our > minds, the values of some variables are still missing, such as > ovs_spec,rpmbuilddir > and setarch. By the way, where can we find the buildnum for the stable > openvswitch-2.3.1 > tarball? Sorry for more questions. Any help will be greatly appreciated. > > Best regards, > Po-Ching > > Ben Pfaff On 2015/4/16 下午 11:09 wrote: > >Here's what we use for XenServer 6.5 and other 64-bit versions of > >XenServer: > > > > kernel_name = 'xen' > > cmd = "rpm -qa | grep kernel-devel" > > output = self.get_output_from_command(cmd) > > kernel_version = re.sub('.*-devel-', '', output) > > # Get the build symlink in /lib/modules from > > # kernel-devel file list for xen_version > > cmd = "rpm -ql kernel-devel | grep 'lib/modules' | head -1" > > output = self.get_output_from_command(cmd) > > xen_version = re.sub('/lib/modules/', '', > > re.sub('/build', '', output)) > > > > ovsver = "-D \"openvswitch_version %s.%s\"" % (version, > > buildnum) > > kname = "-D \"kernel_name %s\"" % kernel_name > > kver = "-D \"kernel_version %s\"" % kernel_version > > xver = "-D \"xen_version %s\"" % xen_version > > spec = "-bb %s/SPECS/%s" % (rpmbuilddir, ovs_spec) > > spec_opts = "%s %s %s %s %s" % (ovsver, kname, kver, > > xver, spec) > > > > cmd = "%s rpmbuild %s" % (setarch, spec_opts) > > self.run_command(cmd, halt_on_failure=True) > > > _______________________________________________ discuss mailing list discuss@openvswitch.org http://openvswitch.org/mailman/listinfo/discuss