MathHubInfo / Legacy-localmh

DEPRECATED - A cross-repository administration tool for the local authoring in MathHub.info
1 stars 0 forks source link

lmh depcrawl chokes on meta-inf repos #289

Open kohlhase opened 8 years ago

kohlhase commented 8 years ago

title says it all, it would be great to have that fixed, since I can then update metadata

Checking dependencies for:    smglom/meta-inf

---

---
Traceback (most recent call last):
  File "/path/to/localmh/bin/lmh", line 13, in <module>
    main()
  File "/path/to/localmh/bin/lmh", line 10, in main
    lmh.run(sys.argv[1:])
  File "/mounted/lmh/lmh/__init__.py", line 85, in run
    if main(argv):
  File "/mounted/lmh/lmh/__init__.py", line 79, in main
    return submods[args.action].do(args, unknown)
  File "/mounted/lmh/lmh/commands/depcrawl/__init__.py", line 27, in do
    return run.do(arguments, unparsed)
  File "/mounted/lmh/lmh/commands/depcrawl/run.py", line 7, in do
    res = calc_deps(repos, apply=args.apply)
  File "/mounted/lmh/lmh/lib/repos/local/__init__.py", line 238, in calc_deps
    return [calc_deps_single(mr, apply = apply) for mr in mrepos]
  File "/mounted/lmh/lmh/lib/repos/local/__init__.py", line 238, in <listcomp>
    return [calc_deps_single(mr, apply = apply) for mr in mrepos]
  File "/mounted/lmh/lmh/lib/repos/local/__init__.py", line 320, in calc_deps_single
    write_deps(dirname, ret["should_be"])
  File "/mounted/lmh/lmh/lib/repos/local/__init__.py", line 226, in write_deps
    n = re.sub(r"dependencies: (.*)", "dependencies: "+",".join(deps), read_file(f))
  File "/mounted/lmh/lmh/lib/io.py", line 179, in read_file
    text_file = open(filename, "r", encoding="utf8")
FileNotFoundError: [Errno 2] No such file or directory: '/mounted/lmh/MathHub/smglom/meta-inf/META-INF/MANIFEST.MF'

lmh seems to have crashed with <class 'FileNotFoundError'>
a report will be generated in 
kohlhase commented 8 years ago

actually, I have to correct myself, it is only lmh depcrawl --apply that chokes.

kohlhase commented 8 years ago

Oh, and there is another problem, it seems that lmh depcrawl --apply does not always write things. e.g. in mathhub/smglom/constants I get

Michaels-MBP:smglom kohlhase$ cd constants/
Michaels-MBP:constants kohlhase$ lmh depcrawl --apply
Checking dependencies for:    smglom/constants
---
 Missing dependencies:        smglom/sets, smglom/numberfields, smglom/trigonometry, smglom/numbers, smglom/calculus, smglom/mv, smglom/numthy, smglom/primes, smglom/analysis, smglom/numthyfun
---
Dependencies should be:  smglom/sets, smglom/numberfields, smglom/trigonometry, smglom/numbers, smglom/calculus, smglom/mv, smglom/numthy, smglom/primes, smglom/analysis, smglom/numthyfun
Wrote new dependencies to /mounted/lmh/MathHub/smglom/constants/META-INF/MANIFEST.MF
Michaels-MBP:constants kohlhase$ lmh depcrawl
Checking dependencies for:    smglom/constants
---
 Missing dependencies:        smglom/analysis, smglom/trigonometry, smglom/sets, smglom/numthyfun, smglom/numbers, smglom/numberfields, smglom/mv, smglom/calculus, smglom/numthy, smglom/primes
---
Dependencies should be:  smglom/analysis, smglom/trigonometry, smglom/sets, smglom/numthyfun, smglom/numbers, smglom/numberfields, smglom/mv, smglom/calculus, smglom/numthy, smglom/primes
Michaels-MBP:constants kohlhase$ 

It seems that nothing was written.

kohlhase commented 8 years ago

Just as a note to self:

for i in */*; do cd $i; lmh depcrawl --apply; cd -; done;  

mostly works (up to the not-writing problem above).

kohlhase commented 8 years ago

Oh, the solution to the meta-inf problem is to just stay out of meta-inf repository. lmh depcrawl does not need to go there.