* add files I forgot to add
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# python standard library
|
||||
from os.path import basename
|
||||
|
||||
from specfile import SpecFile
|
||||
from fetcher import Fetcher
|
||||
# import archive
|
||||
# import pisipackage
|
||||
# import pisiutils # patch, fileutils?
|
||||
import pisiconfig
|
||||
|
||||
class PisiBuildError(Exception):
|
||||
pass
|
||||
|
||||
class PisiBuild:
|
||||
"""PisiBuild class, provides the package build and creation rutines"""
|
||||
def __init__(self, pspecfile):
|
||||
self.pspecfile = pspecfile
|
||||
pspec = SpecFile()
|
||||
pspec.read(pspecfile)
|
||||
pspec.verify() # check pspec integrity
|
||||
|
||||
self.packageName = pspec.sourceName
|
||||
|
||||
self.archiveUri = pspec.archiveUri
|
||||
self.archiveName = basename(self.archiveUri)
|
||||
self.archiveType = pspec.archiveType
|
||||
self.archiveHash = pspec.archiveHash
|
||||
|
||||
self.pspec = pspec
|
||||
|
||||
def fetchArchive(self):
|
||||
fetch = Fetcher(self.archiveUri)
|
||||
fetch.fetch()
|
||||
|
||||
def usage(progname = "pisi-build"):
|
||||
print """
|
||||
Usage:
|
||||
%s [options] package-name.pspec
|
||||
""" %(progname)
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import string
|
||||
|
||||
def information(message):
|
||||
print message
|
||||
|
||||
# run a command non-interactively
|
||||
def run_batch(cmd):
|
||||
print 'running ', cmd
|
||||
a = os.popen(cmd)
|
||||
lines = a.readlines()
|
||||
ret = a.close()
|
||||
print 'return value ', ret
|
||||
successful = ret == None
|
||||
if not successful:
|
||||
print 'ERROR: executing command', cmd
|
||||
for x in lines:
|
||||
print x
|
||||
return (successful,lines)
|
||||
|
||||
# print a list
|
||||
def strlist(l):
|
||||
return string.join(map(lambda x: str(x) + ' ', l))
|
||||
Reference in New Issue
Block a user