| digest = md.hexdigest() |
digest = md.hexdigest() |
| return digest |
return digest |
| |
|
| #def krn_ftpput(filename): |
|
| # """uploads the file fileobj to the distribution site""" |
|
| #ftp = FTP(mftphost) |
|
| #er = ftp.login(mftpuser,mftppass) |
|
| #er = ftp.storbinary("STOR "+os.path.basename(filename),open(filename)) |
|
| #er = ftp.quit() |
|
| |
|
| def krn_querymgr(command,kinfo): |
def krn_querymgr(command,kinfo): |
| """queries the build host manager with a variety of commands, such as checkout, checkin, etc.""" |
"""queries the build host manager with a variety of commands, such as checkout, checkin, etc.""" |
| version=krn_localversion(kinfo) |
version=krn_localversion(kinfo) |
| gkb_runmake("modules_install", kinfo, premake, "INSTALL_MOD_PATH=%s %s" % (mybindir, makeopts)) |
gkb_runmake("modules_install", kinfo, premake, "INSTALL_MOD_PATH=%s %s" % (mybindir, makeopts)) |
| |
|
| chdir(bindir,kinfo) |
chdir(bindir,kinfo) |
| log("compressing binary archive %s-%s" % (kinfo["name"],myversion),kinfo) |
archive_name = "linux-%s-%s.tar.bz2 %s" % (kinfo["name"], myversion, os.path.basename(mybindir)) |
| if os.system("tar cjf linux-%s-%s.tar.bz2 %s" % (kinfo["name"], myversion, os.path.basename(mybindir))): |
|
| |
log("compressing binary archive "+archive_name,kinfo) |
| |
|
| |
if os.system("tar cjf "+archive_name): |
| deathbyerror("%s : failed to `tar cjf` %s-%s" % (kinfo["name"], kinfo["name"], myversion)) |
deathbyerror("%s : failed to `tar cjf` %s-%s" % (kinfo["name"], kinfo["name"], myversion)) |
| |
|
| os.system("rm -rf %s" % mybindir) |
os.system("rm -rf %s" % mybindir) |
| |
|
| |
krn_upload(archive_name,myversion,kinfo) |
| |
|
| krn_querymgr("checkin",kinfo) |
krn_querymgr("checkin",kinfo) |
| |
|
| def krn_build26(kinfo): |
def krn_build26(kinfo): |
| log("running make %s" % command,kinfo) |
log("running make %s" % command,kinfo) |
| if os.system("%s make %s %s > %s/%s/make-%s.log 2>&1" % (premake, makeopts, command, logdir, kinfo["name"], command)): |
if os.system("%s make %s %s > %s/%s/make-%s.log 2>&1" % (premake, makeopts, command, logdir, kinfo["name"], command)): |
| deathbyerror("%s : unable to run make %s, aborting." % (kinfo["name"],command)) |
deathbyerror("%s : unable to run make %s, aborting." % (kinfo["name"],command)) |
| # Gerk comment: |
|
| # see other comment above about shunting 2>log |
|
| |
|
| def gkb_parsexml(name): |
def gkb_parsexml(name): |
| """parse the xml build file into mastertrees and builds""" |
"""parse the xml build file into mastertrees and builds""" |
| p.StartElementHandler = start_element |
p.StartElementHandler = start_element |
| p.ParseFile(open(name)) |
p.ParseFile(open(name)) |
| |
|
| |
def krn_upload(file, version, kinfo): |
| |
"""upload the indicated file to the distribution site (kernel archives)""" |
| |
forms = ParseResponse(urlopen(msite+"/fileupload.html")) |
| |
form = forms[0] |
| |
|
| |
form["host"] = host |
| |
form["pass"] = passwd |
| |
form["build"] = kinfo["name"] |
| |
form["version"] = version |
| |
|
| |
form.add_file(open(file), None, os.path.basename(file)) |
| |
|
| |
log("uploading kernel version "+version+" to "+msite,kinfo) |
| |
# form.click() returns a urllib2.Request object |
| |
# (see HTMLForm.click.__doc__ if you don't have urllib2) |
| |
response2 = urlopen(form.click("cmd")) |
| |
|
| |
#print response2.geturl() |
| |
#print response2.info() # headers |
| |
#print response2.read() # body |
| |
log("response: " + response2.read(),kinfo) |
| |
|
| |
response2.close() |
| |
|
| def main(): |
def main(): |
| """ main program gets executed here """ |
""" main program gets executed here """ |
| |
|
| |
|
| # and finally, call the mainloop to execute |
# and finally, call the mainloop to execute |
| main() |
main() |
| |
|