Commit Graph

40099 Commits

Author SHA1 Message Date
Ingo Weinhold b2709d8a0a Write resolvable compatible version to the package
To avoid a clash with the regular version or an extra attribute level we
use the "package:provides.compatible" package attribute instead of
"package:version.major".
2011-07-17 16:54:39 +02:00
Ingo Weinhold 2db69df113 Support for parsing the compatible version
In the .PackageInfo the compatible version for a resolvable can
optionally be given after the resolvable version via
"'compat[ible]' '>=' <version>".
2011-07-17 16:54:39 +02:00
Ingo Weinhold 22e1ec0e30 Add package attribute for compatible version 2011-07-17 16:54:38 +02:00
Ingo Weinhold c2f56ca020 BPackageResolvable: Add compatibleVersion property 2011-07-17 16:54:38 +02:00
Ingo Weinhold 3a56aaeeb9 BPackageResolvableData: Compatible version field
Add fields haveCompatibleVersion and compatibleVersion. This allows us
to have a minimum version a resolvable is backwards compatible with.
2011-07-17 16:54:38 +02:00
Ingo Weinhold b85a2681d6 Coding style: Fix indentation 2011-07-17 16:54:38 +02:00
Ingo Weinhold e1a393153d Adjust system package versions
They all use package and provides version "R1-alpha3_pm-1", now.
2011-07-17 16:54:38 +02:00
Ingo Weinhold ed6d59a9a9 Introduce a pre-release version component
* The version string pattern is now:
  <major>[.<minor>[.<micro>]][-<pre>][-<release>]
* Introduce B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_PRE_RELEASE package
  attribute.
* Add "preRelease" field to BPackageVersionData.
* Add "preRelease" property to BPackageVersion and packagefs's Version.
* Adjust package reader and writer code accordingly.
2011-07-17 16:54:37 +02:00
Ingo Weinhold 5f039cf037 Fix copy'n'paste error for minor version part 2011-07-17 16:54:37 +02:00
Ingo Weinhold 42ae64447e Fix printf() format string warnings 2011-07-17 16:54:37 +02:00
Ingo Weinhold 59e76dbe41 Support for auto-generated package node attributes
* Add utility class AutoPackageAttributes and AttributeCookie subclass
  AutoPackageAttributeCookie.
* UnpackingAttributeCookie::Open() does now try to create a
  AutoPackageAttributeCookie, when it doesn't find the attribute in the
  PackageNode.
* Adjust UnpackingAttributeDirectoryCookie to also list auto-generated
  attributes.

Currently the only supported attribute is "SYS:PACKAGE", which is the
file name of the package containing the node.
2011-07-17 16:54:37 +02:00
Ingo Weinhold a83fe53dce Added default cookie Close() implementation
Added trivial implementation for AttributeCookie::Close() and
AttributeDirectoryCookie::Close() and removed the identical Close()
implementations in derived classes.
2011-07-17 16:54:36 +02:00
Ingo Weinhold ecf2e3d342 Cleanup 2011-07-17 16:54:36 +02:00
Ingo Weinhold c6739b6af0 Paranoia: Handle unknown mount type 2011-07-17 16:54:36 +02:00
Ingo Weinhold 2a5bef01a3 Volume:Mount(): Better failure output
Also use the FATAL() instead of the ERROR() macro, so something is
printed also with debugging disabled.
2011-07-17 16:54:36 +02:00
Ingo Weinhold c99aa60b78 Allow symlinks in the packages directory 2011-07-17 16:54:35 +02:00
Ingo Weinhold 2d132da8dc Optional dependency resolution tracing 2011-07-17 16:54:35 +02:00
Ingo Weinhold 835ecf5aca Fix dependency resolution on resolvable removable
ResolvableFamily::RemoveResolvable(): Move the resolvable's dependencies
to the update list.
2011-07-17 16:54:35 +02:00
Ingo Weinhold 5165b6b1d8 Fix adding order dependent dependency resolution
PackageFSRoot::_AddPackage(): When adding a resolvable which isn't known
yet, make sure all already added matching dependencies are resolved.
2011-07-17 16:54:35 +02:00
Ingo Weinhold b143a5a861 Notify when removing a package link directory 2011-07-17 16:54:35 +02:00
Ingo Weinhold dd9554ae69 Add dependency package links
The links appear, but the dependency resolution doesn't seem to work
correctly yet.
2011-07-17 16:54:34 +02:00
Ingo Weinhold a39e95cd73 Move PackageLinkDirectory::Link to own file
And rename it to PackageLinkSymlink.
2011-07-17 16:54:34 +02:00
Ingo Weinhold bd66b7e670 Resolve dependencies to resolvables 2011-07-17 16:54:34 +02:00
Ingo Weinhold 4081d37dec ResolvableFamily: Add ResolveDependency() 2011-07-17 16:54:34 +02:00
Ingo Weinhold 0d7d1795a1 Resolvable: Add Version() getter 2011-07-17 16:54:33 +02:00
Ingo Weinhold 8a85232741 Add Dependency::ResolvableVersionMatches() 2011-07-17 16:54:33 +02:00
Ingo Weinhold 5e972a60c3 Dependency: Add Package() getter 2011-07-17 16:54:33 +02:00
Ingo Weinhold 9320567ed2 WIP towards dependency package links
* Add ResolvableFamily and DependencyFamily classes for grouping equally
  named resolvables/dependencies.
* Add hash tables to PackageFSRoot to track resolvables and
  dependencies. That is done in {Add,Remove}Package.
* Resolvable does now have a list of Dependency objects, the ones it
  satisfies.
2011-07-17 16:54:33 +02:00
Ingo Weinhold 38a7f76509 Add TODOs regarding broken add/remove behavior 2011-07-17 16:54:32 +02:00
Ingo Weinhold cd81fea02d Fix package link updates/node monitoring
* PackageLinksListener: Rename methods from *Directory*() to *Node*()
  and change parameter to Node*. Also add a *Changed() method.
* PackageLinkDirectory: Update only when necessary and what is necessary
  (currently only the self link).
2011-07-17 16:54:32 +02:00
Ingo Weinhold 35eeebddc4 Missing locking when adding/removing package nodes 2011-07-17 16:54:32 +02:00
Ingo Weinhold 83d5997db5 Add node monitoring for package link directories 2011-07-17 16:54:32 +02:00
Ingo Weinhold fd6d5d5a51 Reordered methods to match declaration order 2011-07-17 16:54:32 +02:00
Ingo Weinhold 59acdf5045 Volume: Remove all package contents on destruction 2011-07-17 16:54:31 +02:00
Ingo Weinhold 77574d40ee Init fSelfLink 2011-07-17 16:54:31 +02:00
Ingo Weinhold 5f80e51a9e Fix Volume::_RemovePackageLinksNode()
Don't use _RemoveNode() as it also removes the node from its parent.
2011-07-17 16:54:31 +02:00
Ingo Weinhold fc009a29f3 Fix NODE_FLAG_OWNS_NAME value 2011-07-17 16:54:31 +02:00
Ingo Weinhold 1382ade575 If none is given pick volume name by mount type 2011-07-17 16:54:30 +02:00
Ingo Weinhold 724fba1b09 Add Node::Init() flags parameter
* Add Node::Init() flags:
  - NODE_FLAG_KEEP_NAME: Take over ownership of the name.
  - NODE_FLAG_CONST_NAME: Don't copy the name -- it's a constant that
    lives at least as long as the object.
* Remove Init() implementations in derived classes that just call the
  base class version.
2011-07-17 16:54:30 +02:00
Ingo Weinhold 1d8edd93e2 Create self package link 2011-07-17 16:54:30 +02:00
Ingo Weinhold 70c2780c73 PackageLinksDirectory::AddPackage(): Fix check 2011-07-17 16:54:30 +02:00
Ingo Weinhold 1becdcc7c8 Empty Node::VFS{Init(),Uninit}() implementations 2011-07-17 16:54:29 +02:00
Ingo Weinhold 3e7333b7c1 Add package link directories to system volume
* Add PackageLinksListener interface. It is used by
  PackageLink[s]Directory to notify a listener about changes.
* Volume does now implement PackageLinksListener and recursively adds/
  removes package link directories.

This makes the package link directories appear at least. They are still
empty.
2011-07-17 16:54:29 +02:00
Ingo Weinhold 4031a32acc WIP: Create empty package links directories
* Rename PackageFamily to PackageLinkDirectory and derive from
  Directory.
* PackageLinksDirectory: Add the PackageLinkDirectory objects as
  children and remove the no longer needed hash table (we use the
  Directory's child hash table).
2011-07-17 16:54:29 +02:00
Ingo Weinhold 05d7d4818e Add support function get_real_time() 2011-07-17 16:54:29 +02:00
Ingo Weinhold a2fc40be04 Move EmptyAttributeDirectoryCookie to own files 2011-07-17 16:54:28 +02:00
Ingo Weinhold 7e57d12523 Move PackageFamily table to PackageLinksDirectory 2011-07-17 16:54:28 +02:00
Ingo Weinhold b8a96de929 Add yet empty package-links directory
* Add PackageLinksDirectory Directory subclass. Currently not doing
  anything.
* PackageFSRoot: Create a PackageLinksDirectory.
* Volume: Add/remove the package links directory for the system volume.
2011-07-17 16:54:28 +02:00
Ingo Weinhold dce13a0a8c Node: Add setters for ID and parent 2011-07-17 16:54:28 +02:00
Ingo Weinhold ffc66d8dd7 Specify mount type when mounting packagefs 2011-07-17 16:54:27 +02:00