/[ascend]/trunk/tools/dtar/dtar
ViewVC logotype

Diff of /trunk/tools/dtar/dtar

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2126 by jpye, Thu Dec 17 01:05:08 2009 UTC revision 2127 by jpye, Thu Dec 17 05:23:36 2009 UTC
# Line 100  ffull = os.path.abspath(f) Line 100  ffull = os.path.abspath(f)
100  t = tarfile.open(ffull)  t = tarfile.open(ffull)
101  M = t.getmembers()  M = t.getmembers()
102  print M[0].name  print M[0].name
   
103  # split the top-level directory name from that path  # split the top-level directory name from that path
104    
105  for i in [0,1]:  for i in [0,1]:
# Line 190  dependencies = ['build-essential','faker Line 189  dependencies = ['build-essential','faker
189  if 'Build-Depends' in control:  if 'Build-Depends' in control:
190      #print "Build-Depends:",control['Build-Depends']      #print "Build-Depends:",control['Build-Depends']
191      c = apt.Cache()      c = apt.Cache()
192      dependencies += control['Build-Depends'].split(', ')      splitre = re.compile(r"\s*,\s+")
193        dependencies += splitre.split(control['Build-Depends'])
194    
195        print "DEPS = ",dependencies
196    
197    
198  print "Checking build dependencies..."  print "Checking build dependencies..."
199  depsmissing = []  depsmissing = []
200    depre = re.compile(r"^(\S+)(\s*\(\s*([<>=]+\s*\S+)\))?$") # \s*\(\s*({<<|<=|=|>=|>>})\s*([^\)]+)\)\s*\[([^\]])\]$
201    import apt_pkg
202  for d in dependencies:  for d in dependencies:
203      if d not in c or not c[d].isInstalled:      mm = apt_pkg.ParseDepends(d)[0]
204        ok = 0
205        for m in mm:
206            try:
207                i = c[m[0]]
208            except KeyError:
209                continue
210    
211            if not i.isInstalled:
212                continue
213            if m[1] and m[2]:
214                cmp = apt_pkg.VersionCompare(m[1], c[m[0]].installed.version)
215                if m[2]=="<<" and cmp<0:
216                    ok = 1
217                elif m[2]=="<=" and cmp<=0:
218                    ok = 1
219                elif m[2]=="=" and cmp==0:
220                    ok = 1
221                elif m[2]==">=" and cmp>=0:
222                    ok = 1
223                elif m[2]==">>" and cmp>0:
224                    ok = 1
225            ok = 1
226        if not ok:
227          depsmissing.append(d)          depsmissing.append(d)
228    
229  if depsmissing:  if depsmissing:

Legend:
Removed from v.2126  
changed lines
  Added in v.2127

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22