Lines 356-375
Link Here
|
356 |
add=[] |
356 |
add=[] |
357 |
sub=[] |
357 |
sub=[] |
358 |
if "--update" in myopts or myaction in ("system", "world"): |
358 |
if "--update" in myopts or myaction in ("system", "world"): |
359 |
add.extend(["selective","empty"]) |
359 |
add.extend(["empty"]) |
360 |
if "--emptytree" in myopts: |
360 |
if "--emptytree" in myopts: |
361 |
add.extend(["empty"]) |
361 |
add.extend(["empty"]) |
362 |
sub.extend(["selective"]) |
362 |
sub.extend(["selective"]) |
363 |
if "--nodeps" in myopts: |
363 |
if "--nodeps" in myopts: |
364 |
sub.extend(["recurse"]) |
364 |
sub.extend(["recurse"]) |
365 |
if "--noreplace" in myopts: |
|
|
366 |
add.extend(["selective"]) |
367 |
if "--deep" in myopts: |
365 |
if "--deep" in myopts: |
368 |
add.extend(["deep"]) |
366 |
add.extend(["deep"]) |
369 |
if "--selective" in myopts: |
|
|
370 |
add.extend(["selective"]) |
371 |
if myaction in ["world","system"]: |
372 |
add.extend(["selective"]) |
373 |
elif myaction in ["depclean"]: |
367 |
elif myaction in ["depclean"]: |
374 |
add.extend(["empty"]) |
368 |
add.extend(["empty"]) |
375 |
sub.extend(["selective"]) |
369 |
sub.extend(["selective"]) |
Lines 679-685
Link Here
|
679 |
"--getbinpkg" in self.myopts, |
673 |
"--getbinpkg" in self.myopts, |
680 |
"--getbinpkgonly" in self.myopts) |
674 |
"--getbinpkgonly" in self.myopts) |
681 |
|
675 |
|
682 |
def create(self,mybigkey,myparent=None,addme=1,myuse=None,hard_dep=True,arg=None): |
676 |
def create(self,mybigkey,myparent=None,addme=1,myuse=None,soft_dep=False,arg=None): |
683 |
""" |
677 |
""" |
684 |
Fills the digraph with nodes comprised of packages to merge. |
678 |
Fills the digraph with nodes comprised of packages to merge. |
685 |
mybigkey is the package spec of the package to merge. |
679 |
mybigkey is the package spec of the package to merge. |
Lines 697-707
Link Here
|
697 |
if addme and jbigkey != myparent: |
691 |
if addme and jbigkey != myparent: |
698 |
# Refuse to make a node depend on itself so that the we don't |
692 |
# Refuse to make a node depend on itself so that the we don't |
699 |
# don't create a bogus circular dependency in self.altlist(). |
693 |
# don't create a bogus circular dependency in self.altlist(). |
700 |
self.digraph.addnode(jbigkey, myparent, hard_dep=hard_dep) |
694 |
self.digraph.addnode(jbigkey, myparent, soft_dep=soft_dep) |
701 |
return 1 |
695 |
return 1 |
702 |
jbigkey = " ".join(mybigkey) + " nomerge" |
696 |
jbigkey = " ".join(mybigkey) + " nomerge" |
703 |
if self.digraph.hasnode(jbigkey): |
697 |
if self.digraph.hasnode(jbigkey): |
704 |
self.digraph.addnode(jbigkey, myparent, hard_dep=hard_dep) |
698 |
self.digraph.addnode(jbigkey, myparent, soft_dep=soft_dep) |
705 |
return 1 |
699 |
return 1 |
706 |
|
700 |
|
707 |
self.spinner.update() |
701 |
self.spinner.update() |
Lines 724-730
Link Here
|
724 |
if self.mydbapi[parent_root].match(mykey) or \ |
718 |
if self.mydbapi[parent_root].match(mykey) or \ |
725 |
self.trees[parent_root]["vartree"].dbapi.match(mykey): |
719 |
self.trees[parent_root]["vartree"].dbapi.match(mykey): |
726 |
mybigkey.append(myparent.split()[2]) |
720 |
mybigkey.append(myparent.split()[2]) |
727 |
self.digraph.addnode(" ".join(mybigkey), myparent, hard_dep) |
721 |
self.digraph.addnode(" ".join(mybigkey), myparent, soft_dep=soft_dep) |
728 |
return 1 |
722 |
return 1 |
729 |
else: |
723 |
else: |
730 |
mydbapi = self.trees[myroot][self.pkg_tree_map[mytype]].dbapi |
724 |
mydbapi = self.trees[myroot][self.pkg_tree_map[mytype]].dbapi |
Lines 783-789
Link Here
|
783 |
""" At this point, we have either hit a blocker and returned, found the package in the |
777 |
""" At this point, we have either hit a blocker and returned, found the package in the |
784 |
depgraph already and returned, or we are here. Whether we are merging or not; we must |
778 |
depgraph already and returned, or we are here. Whether we are merging or not; we must |
785 |
add the package to the depgraph; so we do that here. """ |
779 |
add the package to the depgraph; so we do that here. """ |
786 |
self.digraph.addnode(string.join(mybigkey),myparent,hard_dep=hard_dep) |
780 |
self.digraph.addnode(string.join(mybigkey),myparent,soft_dep=soft_dep) |
787 |
|
781 |
|
788 |
""" This section determines whether we go deeper into dependencies or not. |
782 |
""" This section determines whether we go deeper into dependencies or not. |
789 |
We want to go deeper on a few occasions: |
783 |
We want to go deeper on a few occasions: |
Lines 816-839
Link Here
|
816 |
""" We have retrieve the dependency information, now we need to recursively |
810 |
""" We have retrieve the dependency information, now we need to recursively |
817 |
process them. DEPEND gets processed for root = "/", {R,P}DEPEND in myroot. """ |
811 |
process them. DEPEND gets processed for root = "/", {R,P}DEPEND in myroot. """ |
818 |
|
812 |
|
819 |
mydep={} |
|
|
820 |
mp=string.join(mybigkey) |
813 |
mp=string.join(mybigkey) |
821 |
|
814 |
|
822 |
try: |
815 |
try: |
823 |
if myroot=="/": |
816 |
if not self.select_dep("/",edepend["DEPEND"],myparent=mp,myuse=myuse): |
824 |
mydep["/"]=edepend["DEPEND"]+" "+edepend["RDEPEND"] |
817 |
return 0 |
825 |
if not self.select_dep("/",edepend["DEPEND"],myparent=mp,myuse=myuse): |
818 |
if not self.select_dep(myroot,edepend["RDEPEND"],myparent=mp,myuse=myuse,soft_deps=True): |
826 |
return 0 |
819 |
return 0 |
827 |
if not self.select_dep("/",edepend["RDEPEND"],myparent=mp,myuse=myuse,soft_deps=True): |
|
|
828 |
return 0 |
829 |
else: |
830 |
mydep["/"]=edepend["DEPEND"] |
831 |
mydep[myroot]=edepend["RDEPEND"] |
832 |
if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse): |
833 |
return 0 |
834 |
if not self.select_dep(myroot,mydep[myroot],myparent=mp,myuse=myuse,soft_deps=True): |
835 |
return 0 |
836 |
|
837 |
if edepend.has_key("PDEPEND") and edepend["PDEPEND"]: |
820 |
if edepend.has_key("PDEPEND") and edepend["PDEPEND"]: |
838 |
# Post Depend -- Add to the list without a parent, as it depends |
821 |
# Post Depend -- Add to the list without a parent, as it depends |
839 |
# on a package being present AND must be built after that package. |
822 |
# on a package being present AND must be built after that package. |
Lines 1189-1197
Link Here
|
1189 |
|
1172 |
|
1190 |
if myparent: |
1173 |
if myparent: |
1191 |
#we are a dependency, so we want to be unconditionally added |
1174 |
#we are a dependency, so we want to be unconditionally added |
1192 |
hard_dep = not soft_deps and len(vardb.match(x)) == 0 |
1175 |
soft_dep = soft_deps or vardb.match(x) |
1193 |
if not self.create(selected_pkg[0:3], myparent, |
1176 |
if not self.create(selected_pkg[0:3], myparent, |
1194 |
myuse=selected_pkg[-1], hard_dep=hard_dep, arg=arg): |
1177 |
myuse=selected_pkg[-1], soft_dep=soft_dep, arg=arg): |
1195 |
return 0 |
1178 |
return 0 |
1196 |
else: |
1179 |
else: |
1197 |
#if mysource is not set, then we are a command-line dependency and should not be added |
1180 |
#if mysource is not set, then we are a command-line dependency and should not be added |
Lines 1217-1223
Link Here
|
1217 |
while (not mygraph.empty()): |
1200 |
while (not mygraph.empty()): |
1218 |
mycurkey=mygraph.firstzero() |
1201 |
mycurkey=mygraph.firstzero() |
1219 |
if not mycurkey: |
1202 |
if not mycurkey: |
1220 |
installables = mygraph.leaf_nodes(include_soft_deps=False) |
1203 |
installables = mygraph.leaf_nodes(ignore_soft_deps=True) |
1221 |
if not installables: |
1204 |
if not installables: |
1222 |
print "!!! Error: circular dependencies:" |
1205 |
print "!!! Error: circular dependencies:" |
1223 |
print |
1206 |
print |