English 中文(简体)
一揽子管理人员(态度、 y、港))如何建设依赖树木? [闭门]
原标题:How do package managers (aptitude, yum, portage) build their dependency trees? [closed]

我们不准许对书籍、工具、软件图书馆以及更多的图书馆征求建议的问题。 你可以ed问这个问题,以便用事实和引言回答。

Closed 2 years ago.

我理解基本概念,但是否有任何特别算法用于或可能为建设自己的系统而使用某些博客、论文或甚至书籍? 似乎没有多少资料说明实际实施类似制度的情况。

最佳回答

依赖树木本身是负荷的三边,你们都需要从钥匙(例如姓名)到物体进行一些测绘。

你没有具体说明任何语言,因此我选择了什么。 预期的投入是“[名称]:[空间分离的附属物]”形式的线文档。

def load_depends(file):
  depends = {}
  for line in file:
    line = line.strip()
    if not line or line.startswith("#"):  # allow blanks and comments
      continue
    name, _, deps = line.partition(":")
    deps = deps.strip()
    assert deps, "invalid input"  # most basic input error-checking
    depends[name] = set(deps.split())
  return depends

该法典假定任何未列出的项目都无依赖性,如果希望的话,你可以tra树添加空子。 至少,你应检查休养的依赖性。

例:

>>> input = """
... a: b c
... b: c
... c: d
... e: a
... """.split("
")
>>> from pprint import pprint
>>> pprint(load_depends(input))
{ a : set([ b ,  c ]),
  b : set([ c ]),
  c : set([ d ]),
  e : set([ a ])}

[说明:我作简短发言,因为我确实不要求有线索,而需要的是线索(档案符合),因此我通过一份线标清单。]

你们可以在这一基本结构之上建立各种职能,并把它和这些概念(如:建议或建议,甚至冲突取代等等)纳入你系统特有的各种目标。

问题回答

许多其他概念也涉及依赖树木,如SNMP MIB决议、C/C++源代码汇编。 因此,你可以参考任何谈论这一点的其他材料:





相关问题
How to structure files / dependencies in Visual C++ project

This is more of a design question than a C++ question. I m working on a Texas Hold Em poker game in C++. So far, I have a HandChecker module written that is responsible for determining a player s ...

draw dependency graph for a java class

Heyho, I m searching for a tool like JDepend to draw a graph for a java classfile. JDepend seams to be fine, but it s not resolving the deps from the deps (maybe I m just missing some special options?)...

How to use the -MG flag in cc 4.4.1?

I ve recently upgraded my Ubuntu installation from Jaunty to Karmic. This apparently includes an update of the GNU C compiler, because code that compiled previously no longer does. Running cc 4.4.1 (...

How to manually disable/blacklist Maven repository

In my base project I use dependency of JasperReports which has non-existent repository declaration in its pom. When I run every Maven commad there is dependency looking for commons-collection in this ...

Batch Job Dependencies Using Open Source/Free Software

I run a large data warehouse plant where we have a lot of nightly jobs running concerruently however many have dependencies on a extract or data load process before they start. Currently we use an ...

热门标签