Brock Pytlik wrote: > >>http://cr.opensolaris.org/~bpytlik/ips-15843-v1/ > > > >As far as I can tell, you're resolving the dependencies implied by a > >file only in the proto area that the file is found in, which isn't the > >right thing to do. Dependencies can be resolved in any of the proto > >areas, which makes me think that proto_dir isn't per-action, but still > >needs to be passed around as its own object, only now it's a list. > > This had me confused originally too. Remember there are 2 phases generate > and resolve. Generate actually looks at and examines the files, resolve > merely looks at manifests. So, when doing the generate phase, we need to > look @ the files, so we need the proto_dirs around to see where the files > might be found. Once we know which proto_dir a file is found in, we have > all the information generate needs. > > Resolve, on the other hand and including the internal resolve deps bit > that generate does, always works on image-relative paths. The proto_dirs > are totally irrelevant at the resolve stage.
Okay, so why do we store the proto dir in the action at all, then? > >What's up with process_hardlink_deps() passing "" as proto_dir to > >HardlinkDependency? > > The proto_dir is used by make_relative to relativize the run_paths. > HardlinkDeps never call this function and thus have no use for the > proto_dir. Which is a good thing becuase with this wad, the hardlink > action doesn't have its proto_dir set, so it doesn't have a value to pass > in there in the first place. If you prefer, I can refactor the Dependency > class structure in base.py to create more levels so that it doesn't need > to pass in a proto_dir at all. Could you just remove the proto_dir parameter from HardlinkDependency's constructor, and pass None up to PublishingDependency, documenting that special value there? Otherwise, I'd pass None up from process_hardlink_deps(). Or would None just not work at all (I can't tell if _check_paths() would ever be called)? If that's the case, then I'd put a quick comment in explaining why we're doing something special. "" just seems like we're using the cwd as the proto area, not that we're ignoring it. Danek _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
