Commit Graph
100 Commits
Author SHA1 Message Date
Ingo Weinhold f16dbba442 Update libsolv package 2013-04-19 01:34:26 +02:00
Ingo Weinhold b50e5e3307 package[_repo]: Print version correctly
Use BPackageVersion::ToString() instead of assembling the version
string manually. This fixes the incorrect pre-release separator.
2013-04-19 01:31:47 +02:00
Ingo Weinhold ea8b5c257d BPackageInfo parser: Allow '.' in micro version component
Otherwise we'd have to encode e.g. "cvs-1.12.13.1" differently.
2013-04-18 18:43:47 +02:00
Ingo Weinhold 06b4ebe51c package-infos in tree: use '~' as pre-release separator 2013-04-18 17:50:47 +02:00
Ingo Weinhold 9d81dc7655 BPackage{Info,Version}: Switch to '~' as pre-release separator
Also allow '.' in the pre-release string (as in "alpha4.1") and in
package and resolvable names.
2013-04-18 17:50:47 +02:00
Ingo Weinhold b7c89d42a6 packagefs: Use '~' as pre-release separator
"[...]" turns out to be not so good an idea after all. In the shell it
would require escaping.
2013-04-18 17:50:46 +02:00
Ingo Weinhold 7fa369956e BOpenHashTable::Clear(): Set fItemCount to 0
If not empty, the count would afterwards be out of sync with reality.
2013-04-18 15:53:34 +02:00
Ingo Weinhold 5e6adff989 BPackageVersion::ToString(): Return empty string, if invalid 2013-04-18 15:12:04 +02:00
Ingo Weinhold 7b2d062147 Enforce current package rules for packages built from tree
* Replace '-' in package name by '_'.
* Use new '[...]' notation for pre-release version component.
2013-04-18 14:44:44 +02:00
Ingo Weinhold defc1f774a BPackage{Version,Info}: Switch to new pre-release rule
Also add several checks in the package-info parser to enforce the
<alphanum_underscore> requirement of package/resolvable names and
version components.
2013-04-18 14:41:27 +02:00
Ingo Weinhold d0367de056 packagefs: Switch to new rule for pre-release version part 2013-04-18 14:38:24 +02:00
Ingo Weinhold ceb18a3777 packagefs: Fix typo in debug output 2013-04-18 14:35:59 +02:00
Ingo Weinhold a8b23e3ecf pkgman resolve-dependencies: Allow specifying multiple packages 2013-04-16 20:43:20 +02:00
Ingo Weinhold caba55ee61 Revert to previous libsolv package
In the latest one the version comparison is broken.
2013-04-16 20:34:52 +02:00
Ingo Weinhold 8d85f8e41e Update libsolv package
The Haiku repository support has been upstreamed and the maintainer,
Michael Schroeder, has fixed and improved a few things.
2013-04-16 17:08:45 +02:00
Ingo Weinhold 4210ed011a Fix BMessage::GetInfo() return value check
Since B_OK is 0, the change doesn't affect the semantics.
2013-04-16 17:08:45 +02:00
Ingo Weinhold 88f22c9768 InstallOptionalHaikuImagePackage: Remove first parameter
Instead deduce the file name from the URL. A long overdue change. Avoids
unnecessary name duplication, which only led to errors.
2013-04-16 14:39:31 +02:00
Ingo Weinhold 6185f6e7cc Fix libtool file name 2013-04-16 13:45:33 +02:00
Ingo Weinhold 202c1daaed BPackageVersion: Rename property release to revision
* ... to avoid confusion with the preRelease property. It's also called
  "revision" in the HaikuPorts recipes.
* Update libsolv package. Was necessary due to the BPackageVersion
  change, but also includes a few more changes.
2013-04-16 00:05:19 +02:00
Ingo Weinhold bd59e0d00d BPackageInfo: Fix Linux build
... including an actual bug (operator "|" instead of "||").
2013-04-16 00:01:02 +02:00
Ingo Weinhold e6216e372a Implement getting a BInstallationLocationInfo
* Rename PackageDaemonDefs.h to DaemonDefs.h.
* Replace the MESSAGE_GET_PACKAGES by the new
  B_MESSAGE_GET_INSTALLATION_LOCATION_INFO, which not only returns the
  packages, but also other information about the installation location.
* daemon: Volume: Implement a change count which is bumped whenever
  packages are activated/deactivated/added/removed. Cache the reply
  for a location info request, using the change count to check whether
  it is still up-to-date.
* Add private BDaemonClient for communication with the daemon.
* BRoster:
  - Add GetInstallationLocationInfo() using BDaemonClient.
  - Reimplement GetActivePackages(), using
    GetInstallationLocationInfo().
2013-04-14 17:06:26 +02:00
Ingo Weinhold d7d9497e31 Add BInstallationLocationInfo 2013-04-14 17:06:26 +02:00
Ingo Weinhold b2d96da589 BPackageInfoSet::Iterator: Fix NULL pointer dereference
Since the BPackageInfoSet's map is created lazily, it can be NULL when
an Iterator is constructed.
2013-04-14 17:06:25 +02:00
Ingo Weinhold 8a4ebe2c46 Make BPackageInfo archivable 2013-04-14 17:06:25 +02:00
Ingo Weinhold bbb2dc237a Add BReferenceable to libbe_build
Unbreaks the build on non-Haiku build platforms
2013-04-13 14:39:35 +02:00
Ingo Weinhold 711a2a6eea BPackageInfoSet: Add copy constructor, assignment operator
* Implement copy-on-write support.
* Add copy constructor and assignment operator.
* Remove Init(). Initialize lazily instead. Since AddInfo() can fail
  and we check initialization anyway, there's no point in having an
  explicit Init(). Given that there was only one invocation of Init()
  in the package kit and its users, it was very likely missing in some
  places.
* Fix a few places where we ignored that the PackageMap actually
  contains lists of PackageInfo objects.
2013-04-13 02:08:43 +02:00
Ingo Weinhold 82ce8682f2 Add missing build header Referenceable.h 2013-04-13 02:04:00 +02:00
Ingo Weinhold 0d50fa87ec pkgman: Add beginnings of the "install" command
So far it only solves the dependencies and prints the result. No
problem handling, no actual installation.
2013-04-12 15:29:50 +02:00
Ingo Weinhold 0d8ed3f2a8 BSolver::Install(): Add optional unmatched specifier return param 2013-04-12 14:21:54 +02:00
Ingo Weinhold 71293f8b03 BSolverPackageSpecifier: Fix string constructor 2013-04-12 14:21:08 +02:00
Ingo Weinhold 334a5a566c BSolverRepository: Change priority from uint8 to int32
This allows us to specifies priorities below and above the user
definable range.
2013-04-12 13:42:27 +02:00
Ingo Weinhold 115eae7371 LibsolvSolver::Install(): Fix broken B_PACKAGE case 2013-04-12 12:27:32 +02:00
Ingo Weinhold 38e528bbc1 pkgman: C++-ify the command handling
There's now a Command class that must be derived and registered with
a CommandManager, all simplified by a REGISTER_COMMAND macro. That gets
rid of the print_command_usage_and_exit() function copy for every
command, moves the short usage texts to the command implementations,
and avoids any repetition of the command name. When implementing a new
command only a new source file needs to be created, nothing else needs
to be touched.
2013-04-12 01:48:53 +02:00
Ingo Weinhold 01758ed332 Rework SolverPackageSpecifier
* It no longer consists of a BPackageResolvableExpression and a
  repository. Instead it can now either refer to a package directly or
  consist of a search string.
* SolverPackageSpecifierList: Add AppendSpecifier() convenience
  versions.
* Adjust LibsolvSolver and pkgman accordingly.
2013-04-12 00:21:49 +02:00
Ingo Weinhold 663e351cb4 BSolver/pkgman: Support for searching in provides
* BSolver/LibsolvSolver:
  * Add B_FIND_IN_NAME and make searching in the names explicit.
  * Add B_FIND_IN_PROVIDES to search the packages' provides list.
* pkgman: Also search in provides.
2013-04-11 23:36:12 +02:00
Ingo Weinhold eb13a353e3 Rename "packages" subdir "config" to "administrative"
... to avoid the impression that it contains something the user can
play with.
2013-04-11 17:44:58 +02:00
Ingo Weinhold dd46d98163 pkgman: Add "search" command 2013-04-11 17:33:23 +02:00
Ingo Weinhold 789867563a pkgman RepositoryBuilder: Add BRepositoryConfig constructor 2013-04-11 17:32:17 +02:00
Ingo Weinhold fc57db481f BSolver/LibsolvSolver: Add FindPackages()
Given a search string it finds all matching packages.
2013-04-11 17:30:08 +02:00
Ingo Weinhold a78a2540a8 LibsolvSolver: Fix the lazy re-/initialization
* _Init() was a bit too enthusiastic, throwing really everything away.
  So, after calling it at the beginning of _AddRepositories() there
  wouldn't be any repositories anymore.
* Rename _Init() to _InitPool() to make its purpose clearer.
* Pull a _CleanupPool() out of _Cleanup() that only deletes the pool
  and anything depending on it.
* RepositoryInfo::HasChanged(): Always consider changed when there's no
  libsolv repo yet.
2013-04-11 17:21:27 +02:00
Ingo Weinhold 62f7022a82 package kit: get active packages list from daemon
* daemon: Implement private message protocol to retrieve the active
  packages.
* BPackageRoster::GetActivePackages(): Get the active packages list
  from the daemon.
2013-04-11 02:03:25 +02:00
Ingo Weinhold b254217a09 package daemon: Properly qualify private package headers
... instead of adding the private package header directory to the
include paths.
2013-04-11 00:59:48 +02:00
Ingo Weinhold 6c6460e1f6 BPackageInfo: Add GetConfigString() and ToString() 2013-04-11 00:37:25 +02:00
Ingo Weinhold 1a34656b57 BPackageVersion: Make version string constructor explicit 2013-04-11 00:36:10 +02:00
Ingo Weinhold 5776551d3d pkgman: Move some classes into own file for reuse
Namely RepositoryBuilder and PackageInfoErrorListener.
2013-04-10 14:41:30 +02:00
Ingo Weinhold 483d49968d LibsolvSolver: Make repeated use of object possible
* _Solve(): Clean up the old solver before creating a new one.
* _AddRepositories(): Don't do anything, if the repositories haven't
  changed.
2013-04-10 13:20:38 +02:00
Ingo Weinhold 50888ebdc0 BSolverRepository: Add a change count
... so we can easily check whether the repository has changed since the
last time we used it.
2013-04-10 12:58:12 +02:00
Ingo Weinhold 40cbf171ef packagefs: don't dup() the packages directory FD
Volume::_AddInitialPackagesFromDirectory(): Use openat() instead of
dup() to get a FD for the packages directory. Currently our fdopendir()
implementation doesn't use it directly anyway, but in theory it could
and would then change the state of the original FD.
2013-04-09 23:35:57 +02:00
Ingo Weinhold 19dc1d084f packagefs: Use the package activation file
If the file exists load only the packages specified in it. If it doesn't
exist or any kind of error occurs, fall back to loading all packages in
the packages directory.
2013-04-09 23:26:56 +02:00
Ingo Weinhold a96531fc51 package daemon: On changes write a file with the active packages 2013-04-09 22:37:18 +02:00
Ingo Weinhold 19a268a459 Update libiconv and sqlite packages
The new package files haven't been rebuilt, just repackaged. Only small
details in the package-info changed.
2013-04-09 20:07:46 +02:00
Ingo Weinhold 92b6d58598 package daemon: Check volume package dependencies initially
Dumps the result (i.e. found problems and solutions) to the syslog.
Eventually the user should be asked what to do when inconsistencies are
encountered.
2013-04-09 19:51:10 +02:00
Ingo Weinhold 4b3ca457b6 BSolverProblemSolution: Fix ToString() template strings 2013-04-09 18:55:07 +02:00
Ingo Weinhold 5e01af3199 package kit: Add data structures for problem solutions
... and add the problem solutions in LibsolvSolver.
2013-04-09 17:24:27 +02:00
Ingo Weinhold 1047e84f39 package daemon: Volume::InitPackages(): Fix error case
Don't assign fListener, when starting node monitoring fails.
2013-04-08 23:36:56 +02:00
Ingo Weinhold a6c7f5e33c package daemon: De/-activate all changed packages together
* We first process the node monitoring events, collecting the required
  package activation changes, then apply all changes together.
* Change the PackageFSActivationChangeItem/-Request structs. The former
  is no longer variable in size, which makes it easier to work with.
2013-04-08 19:06:18 +02:00
Ingo Weinhold ebbefc0151 package daemon: Root: Use a common job for volume work
Add VolumeJob which, besides the Volume, takes a Root method to be
invoked. That allows to replace the specific job classes by simple
methods.
2013-04-08 17:49:14 +02:00
Ingo Weinhold 2508cd615f packagefs: Volume::_ChangeActivation(): Check 0 request size 2013-04-08 17:45:24 +02:00
Ingo Weinhold bb88feaa3a PackageFSActivationChangeRequest: Make items array 0 sized
That's more convenient to use and the actual size of an item is variable
anyway.
2013-04-08 17:45:00 +02:00
Ingo Weinhold def92c01ee packagefs/daemon: Ignore packages/ entries without .hpkg suffix 2013-04-08 15:54:39 +02:00
Ingo Weinhold 379131d97d BString: Add StartsWith() and EndsWith() methods 2013-04-08 15:44:31 +02:00
Ingo Weinhold 91a9b5f276 package daemon: Volume: Make sure move entry events don't get split 2013-04-08 15:21:26 +02:00
Ingo Weinhold 9e4096146f package daemon: Add a Listener interface for Volume
* This way, Volume doesn't have to know Root.
* Suppress listener notifications for node monitoring events when there
  are were already events pending.
2013-04-08 15:19:11 +02:00
Ingo Weinhold 8fb3930a42 package daemon: Make all work with the packages asynchronous
There's now a worker thread per Root that does all the work that can
take time. Node monitoring notifications received in the main thread are
just pushed into the worker's job queue, so the application looper
remains responsive.
2013-04-08 00:05:51 +02:00
Ingo Weinhold 7136419383 Add shared PthreadMutexLocker, an AutoLocker for pthread_mutex_t 2013-04-07 23:59:43 +02:00
Ingo Weinhold 6978941aac packagefs: Remove support for multiple package domains per volume
That also get rid of the job stuff and the package loader thread.
2013-04-07 13:52:41 +02:00
Ingo Weinhold af5c10ab19 packagefs: Remove the packages directory node monitoring 2013-04-07 12:21:54 +02:00
Ingo Weinhold 3d53bd473b package daemon: Add package monitoring and de-/activation
* packagefs: Disable (comment out) node monitoring of the packages
  directory.
* package daemon:
  - When a packagefs volume is added load the respective packages
    directory and get from the volume which of the packages are
    activated.
  - Add node monitoring for the packages directory and
    activate/deactivate packages as packages are added/removed.
2013-04-07 12:02:18 +02:00
Ingo Weinhold 17bb54dc38 packagefs: ioctls for getting and changing package activation
* Add PACKAGE_FS_OPERATION_GET_PACKAGE_INFOS which returns the node refs
  of all packages activated.
* Add PACKAGE_FS_OPERATION_CHANGE_ACTIVATION to activate/deactivate
  multiple packages.
2013-04-07 11:53:50 +02:00
Ingo Weinhold e85e9dadda packagefs: Move the package loading code to Package
* Volume::_LoadPackage() -> Package::Load()
* Volume::_DomainEntryCreated(): Pull a bit of code into a new
  _LoadPackage() method for reuse.
2013-04-07 11:45:47 +02:00
Ingo Weinhold 27197fd74b packagefs Package: Add getters for device and node ID 2013-04-07 11:38:03 +02:00
Ingo Weinhold 2d8ec1d502 Add the obvious node_ref constructor 2013-04-06 23:30:18 +02:00
Ingo Weinhold 26296b0aa4 Add the humble beginnings of the package daemon
It doesn't really do anything yet save for tracking what packagefs
volumes are mounted and unmounted.
2013-04-06 04:29:34 +02:00
Ingo Weinhold 0c6927b5d7 packagefs: Add ioctl to get basic volume information
Also rename the MountType enum and members, since they are no longer
packagefs private.
2013-04-06 04:26:40 +02:00
Ingo Weinhold 91586bd3b6 packagefs: Fix handling of package domain paths
* The package directory path specified when mounting must be interpreted
  in the caller's I/O context. We did always interpret it in the
  kernel's I/O context, so that a relative path or a path in a chroot
  environment wouldn't work correctly. Now opening the directory is done
  in PackageDomain::Init() where we can at least guess the path's
  origin.
* We also normalize the path, though merely to get more conclusive debug
  output, since after opening the directory the path isn't used for
  anything else anymore.
* Make the "packages" mount parameter optional. If not specified, use
  the "packages" folder at our mount point.
2013-04-05 19:19:20 +02:00
Ingo Weinhold 5b6fb78c40 VFS: _kern_open_dir(): Fix NULL path case
It would create an empty path buffer and pass that on to dir_open(),
which accepts NULL, but not empty paths.
2013-04-05 19:19:20 +02:00
Ingo Weinhold d482342399 VM: Fix vm_block_address_range() area protection
B_ALREADY_WIRED, which was erroneously passed for the area protection
parameter to map_backing_store(), has the value 7 which implies user
readable and writable. Hence the address ranges around 0xdeadbeef and
0xcccccccc could actually be read and written from anywhere.
2013-04-05 16:58:50 +02:00
Ingo Weinhold ce577d8db0 packagefs: AttributeIndex: Support duplicates correctly
The tree comparisons didn't allow for different Nodes having the same
attribute value. Therefore only the first node would be added and later
we would try to remove a node not actually in the tree, leading to a
crash.

packagefs seems to finally unmount cleanly, now.
2013-04-05 16:50:20 +02:00
Ingo Weinhold 05940bc514 packagefs: Fix handling of package-links directory on unmount
* Volume::_RemovePackageLinksDirectory(): We don't want to call
  _RemovePackageLinksNode(). Besides that the ID hash table has already
  been emptied before and we would thus release a reference to the node
  erroneously, the method doesn't do anything we want anyway. We don't
  want any children to be removed, since we have unregistered the
  volume's packages already (which removes the respective package link
  directories); the remaining ones are from other volumes and not ours
  to remove.
* PackageFSRoot: Release a reference to the package links directory in
  the destructor. We create the directory in Init() after all and no one
  else takes over ownership.
2013-04-05 00:31:51 +02:00
Ingo Weinhold c7382d4c9d packagefs: Acquire missing reference for shine-through dirs
Since we publish shine-through directories directly to the VFS, we need
to acquire an additional reference, because we release a reference when
a node is put.
2013-04-05 00:20:32 +02:00
Ingo Weinhold dedc1369e1 packagefs: Acquire missing reference for the root dir
We need one for the ID table and one for the volume itself.
2013-04-05 00:17:22 +02:00
Ingo Weinhold ce1d048183 packagefs: Fix adding package links twice to volume
PackageLinkDirectory::NotifyDirectoryAdded() first notified the listener
(Volume) about the directory itself, then about the links it contained.
Since Volume adds the nodes recursively, the latter were added twice,
resulting in a corrupted ID hash table.
2013-04-04 22:25:23 +02:00
Ingo Weinhold 6d04dfb7a9 bindfs: Fix double deletion of root node on unmount
The VFS calls the FS's put_vnode() for all nodes, including the root
node, prior to calling unmount().
2013-04-04 11:24:39 +02:00
Ingo Weinhold 1add554a83 Make LibSolv a mandatory package
... so it is actually installed on the image.
2013-04-03 21:04:55 +02:00
Ingo Weinhold 7216c8944d pkgman resolve-dependencies: Improve usage text formatting 2013-04-03 20:14:54 +02:00
Ingo Weinhold 046f1c4378 pkgman resolve-dependencies: Avoid code duplication 2013-04-03 20:11:11 +02:00
Ingo Weinhold 4b8aabfac9 pkgman resolve-dependencies: Print package paths
... instead of package name and version. The command should now
work as required by haikuporter.
2013-04-03 19:09:38 +02:00
Ingo Weinhold a8b832bf46 BSolverRepository::AddPackage(): Add optional return parameter
... returning the added BSolverPackage object.
2013-04-03 19:06:47 +02:00
Ingo Weinhold 749884283a pkgman resolve-dependencies: Verify result
* Make sure that the computed dependencies don't themselves depend on
  the specified package.
* Print only the actual dependencies, not the specified package.
2013-04-03 18:44:14 +02:00
Ingo Weinhold 65502bbe88 BSolver: Add VerifyInstallation()
... and implement it in LibsolvSolver.
2013-04-03 18:42:20 +02:00
Ingo Weinhold 19f3eaaee6 pkgman: Simplify and rename resolve-build-dependencies
* Now it only gets a package (info) file and a single list of
  repository directories, optionally with priority, and resolves the
  package's dependencies. The more complex two resolving steps it did
  before can just as well be done by haikuporter, and this way the
  command is more flexible.
* Rename to resolve-dependencies.
* Some TODOs still remain.
2013-04-03 15:58:27 +00:00
Ingo Weinhold 07a4d4e370 BSolverRepository: Add SetPriority() 2013-04-03 15:57:16 +00:00
Ingo Weinhold 1acf2be80d pkgman: Add command resolve-build-dependencies
This is a service command for haikuporter. It resolves the dependencies
for a package to be built and lists them, so that haikuporter can
prepare the build environment accordingly.

The implementation isn't quite finished yet. Currently the packages are
printed only with name and version, while it would probably be more
helpful to print the path of the package file. Also, the package itself
(respectively a dummy package) is printed as well.
2013-04-03 02:44:46 +00:00
Ingo Weinhold 1a4d020daf Flesh out the package kit solver API quite a bit more
* Reorganize things a bit:
  - BSolver is now an abstract base class.
  - A libsolv based implementation, LibsolvSolver, lives in a new
    add-on, which is loaded lazily.
  - Get rid of libpackage_solver. Save for LibsolvSolver everything
    is moved to libpackage.
  - This is a nicer solution for the cyclic dependency caused by
    libsolv (libsolvext to be precise) using the package kit for
    reading repositories and package files.
* Add a solver result data structure and and an accessor the solver.
* Add problem reporting support to the solver. There aren't data
  structures for the problem solutions yet and support for selecting
  solutions and re-solving is missing as well.
2013-04-03 02:15:57 +00:00
Ingo Weinhold 2d0563f357 Fix BPackageResolvableExpression::ToString()
The operator was inserted as a number.
2013-04-03 02:09:23 +00:00
Ingo Weinhold a3dd6caf55 Add public package version parsing API
* BPackageVersion: Add respective constructor and SetTo().
* BPackageInfo: Add static ParseVersionString() utility method. It's
  only there because the parser lives in the BPackageInfo
  implementation.
2013-04-03 02:06:26 +00:00
Ingo Weinhold dd6ec1de82 Add libsolv build feature 2013-04-02 17:31:06 +00:00
Ingo Weinhold fc75f2df0c <build>package: Fix build
* StandardErrorOutput.cpp no longer exists (respectively has been moved
  to libpackage).
* Add hack to allow building more correctly on Haiku. We were using
  the installed package kit headers, not the ones from the working
  directory.
2013-04-02 17:27:29 +00:00
Ingo Weinhold 04d1edefe2 Fix the libpackage_build build
* The recently introduced {No,Standard}ErrorOutput.cpp were still
  missing.
* Add hack to allow building more correctly on Haiku. We were using
  the installed package kit headers, not the ones from the working
  directory.
2013-04-02 17:24:22 +00:00
Ingo Weinhold bcdf492404 Simplify/fix the ExtractArchive rule and friends
* The call to the dummy actions isn't needed
* The calls to Extract{Zip,Tar,HPKG}Archive1 couldn't work like that.
  The directory has to be the main target, since ExtractArchive is
  potentially invoked multiple times with different extracted file
  targets and the Extract*Archive1 is only invoked the first time.
  Tested only with the HPKG actions, but they others should work as
  well.
2013-04-02 17:17:46 +00:00