Commit Graph

237 Commits

Author SHA1 Message Date
Alexander von Gluck IV cc8f1d2ffd headers/os: Add gcc 5 to BeBuild.h
* While we still use gcc 4, the host tools won't
  build on gcc 5 systems without this.
* x86_64 compiles under gcc 5.10 successfully
2015-06-24 23:06:23 -05:00
Axel Dörfler e711e6e42f Moved BJob, and JobQueue into the support kit.
* Put it in the BSupportKit namespace, following the style introduced
  with the package kit for now.
* The BSupportKit::BJob class no longer knows about the package kit's
  Context class. However, the BPackageKit::BJob class does.
* Due to the namespace juggling, a lot of files had to be touched.
* The JobQueue class remains private.
* Due to the way Haiku is built on itself, you cannot build this change
  under Haiku with an older release.
2015-05-21 21:37:01 +02:00
Axel Dörfler 5ce80a78c9 BMessage: implemented KMessage reply.
* When you receive a message from a KMessage, and reply to it,
  it will automatically reply as KMessage, too.
* This allows to communicate with BLoopers from within the kernel
  or libroot.so.
2015-05-13 23:06:51 +02:00
Axel Dörfler 1aaa0c2142 Package Kit: FetchFileJob now contains package size.
* So that you know how much already was, and still has to be downloaded.
* Automatic whitespace cleanup.
* The link in FetchFileJob.h did not fetch the correct header under
  Haiku anymore (since the addition of the private headers to the
  image).
2015-03-31 13:40:42 +02:00
Adrien Destugues 00640ac82e Forgot to fix LDBL_MIN... 2014-10-15 13:08:10 +02:00
Adrien Destugues 1f792e1852 gcc2 float.h: use decimal floats. 2014-10-15 11:29:54 +02:00
Adrien Destugues 7f6fdce3c1 Update haiku copy of gcc2 float.h
Shouldn't be needed, but we may as well use the correct version here
too.
2014-10-14 22:11:27 +02:00
Adrien Destugues 9e616c6b9e Fix HaikuBuildCompatibility to not define atmics anymore.
This reverts commit 34dbbb65fd.
Instead, we can remove thos from HaikuBuildCompatibility and things will work fine, unless one try t build Haiku on BeOS (this isn't
supported anymore) or a very old Haiku which esdon't have those.
2014-08-29 09:37:44 +02:00
Ingo Weinhold 05b565f4f2 Add private BDataPositionIOWrapper
Implements the BPositionIO interface on top of a BDataIO, requiring the
{Read,Write}At() accesses to be sequential.
2014-07-13 17:57:56 +02:00
Ingo Weinhold c55a06055f Add private class BFdIO
Simple BPositionIO implementation using the POSIX API on a FD. In effect
similar to BFile, but more easily ported to kernel and boot loader (and
the FD is reusable).
2014-07-12 15:40:21 +02:00
Ingo Weinhold b3263ad3e1 Switch package kit to BZlibCompressionAlgorithm
... and remove the Zlib{Compressor,Decompressor} API.
2014-06-30 21:55:41 +02:00
Ingo Weinhold dcdc33b0af Add B[Zlib]CompressionAlgorithm
* BCompressionAlgorithm is a base class for classes that provide
  compression/decompression functionality. There are methods for
  compressing/decompressing a single buffer and factory methods for
  a compressing/decompressing input/output BDataIO.
* BZlibCompressionAlgorithm is a BCompressionAlgorithm implementation
  using zlib.
2014-06-30 21:55:41 +02:00
Ingo Weinhold 6a89a36aa0 Move package kit Zlib* classes to support kit
Also move to B* namespace and no longer expose the zlib dependency in
the headers.
2014-06-30 21:55:41 +02:00
Adrien Destugues eef22dfb75 Revert "Remove haiku_host/Errors.h"
This reverts commit f105756e27.

The host header gets included if this file is missing , rather than the
one in the build tree. Fix the build again.
2014-06-26 08:01:00 +02:00
Adrien Destugues f105756e27 Remove haiku_host/Errors.h
The only purpose of this was to use the installed version of Errors.h,
which isn't strictly needed and create some annoyance when new error
codes are added.
2014-06-25 23:01:13 +02:00
Adrien Destugues 6bcbdcc3c0 Use current Errors.h when building libbe_build
This allows adding new error codes to the libbe_build without breaking
the build on older Haiku versions.

Fixes the build for the newly introduced B_PARTIAL_READ and
B_PARTIAL_WRITE.
2014-06-25 08:59:14 +02:00
Ingo Weinhold 84297881bb Remove BPackageKit::[...]::AbstractDataWriter and friends
* FDDataWriter and ZlibDataWriter weren't used anymore.
* AbstractDataWriter was implemented only by PackageFileHeapWriter,
  which was only used by WriterImplBase.
* Add a PackageFileHeapWriter::AddDataThrows() which has semantics
  equivalent to the previously inherited WriteDataThrows().
2014-06-23 22:58:15 +02:00
Ingo Weinhold 32832cbe47 Remove BPackageKit::BDataOutput
Use BDataIO instead.
2014-06-23 22:58:15 +02:00
Ingo Weinhold dec78bb27c Add new error codes B_PARTIAL_{READ,WRITE} 2014-06-23 22:58:15 +02:00
Ingo Weinhold d2d1af830b Revert "Move ZlibDecompressor to libshared"
This reverts commit 9af2105d36.

Conflicts:
	src/kits/package/Jamfile
2014-06-18 22:13:39 +02:00
Ingo Weinhold 707f60f4e9 Revert "Fix build."
This reverts commit 00dfae0bce.
2014-06-18 22:13:39 +02:00
Ingo Weinhold 0de3219e33 package daemon: Rework error and issue propagation to client
* BDaemonClient: Move inner class BCommitTransactionResult to top level
  and make it public.
* BCommitTransactionResult:
  - Add a whole bunch of specific error code enum values. Such an error
    code is now the primary error, as opposed to before where we would
    mix status_t and enum value errors. There's a systemError property
    of type status_t which may provide additional information, though
    (depending on the primary error type).
  - Remove the errorMessage property. Due to mapping all errors to the
    specific error codes this is no longer necessary. Mixing such a
    message with another error description is also not very helpful when
    it comes to localization (still not supported, though).
  - Add several properties (paths, strings, error codes) that serve as
    arguments to the primary error and are used by FullErrorMessage().
  - Add issues property, a list of instances of new class
    BTransactionIssue. Those describe non-critical issues (e.g. failed
    update of a settings file) that occurred in the process of
    committing the transaction. Those issues should be presented to the
    user by the package management program.
* Exception: Adjust to transport the BCommitTransactionResult
  properties.
* CommitTransactionHandler, FsTransactions, Root, Volume: Adjust to
  BCommitTransactionResult/Exception changes.
* CommitTransactionHandler: Now requires a BCommitTransactionResult to
  which it adds the issues it encounters. The reply BMessage is no
  longer needed, though.
* Volume: Refactor common code from the three methods that use
  CommitTransactionHandler into new method _CommitTransaction.
2014-06-15 17:21:01 +02:00
Adrien Destugues bec7cb1006 Also move the build version of BReferenceable.
* Should fix the build, but results in an internal compiler error here
(with a gcc2 haiku host). Let's see what the buildbots think...
2014-06-11 17:53:41 +02:00
Jessica Hamilton 1e31468302 ByteOrder.h: separate host & Haiku versions.
* This avoids polluting the Haiku headers with host issues,
  as pointed out by Axel.
* Should also resolve build issues for various versions of
  host compilers that were introduced in previous commits.
2014-05-30 20:39:43 +12:00
Oliver Tappe 94089b909d Revert 6f68e52 and fix the gcc2 build via template.
* Instead of forcing the hash-table to use a copy of the key,
  introduce and use TypeOperation template to avoid taking a
  reference of a reference type (which gcc2 doesn't allow).
2014-04-20 00:26:29 +02:00
Stephan Aßmus e883b3c9ff Fixed multi-line #ifdef
I definitely compiled last night, but how in the world
was that possible?
2014-03-18 20:40:02 +01:00
Stephan Aßmus 6d19a82f63 Don't define B_SPINLOCK_INITIALIZER for test app_server
* I don't know what I am doing here, but the test app_server only
   ever built for me recently when I disabled the define, so I might
   as well commit this...
2014-03-17 22:54:19 +01:00
Adrien Destugues 00dfae0bce Fix build.
Sorry, renaming headers isn't detected by Jam and not everything was
rebuilt.
2014-02-11 12:50:27 +01:00
Adrien Destugues 9af2105d36 Move ZlibDecompressor to libshared
* This will be used to implement compressed http streams
* Remove the custom BDataOutput class, and use BDataIO instead, for
easier integration with existing code.
2014-02-11 12:06:38 +01:00
Jonathan Schleifer b55c918f57 Import gnuregex 0.12 and remove hardcoded paths
This is required on OS X and other systems which do not have the glibc
extensions for regular expressions (FreeBSD is not one of them as it
already includes gnuregex in /usr). With this there are no hardcoded
non-standard paths for OS X anymore.

regex.c and regex.h are from the official gnuregex 0.12 distribution,
the only modification is that I added __BEGIN_DECLS and __END_DECLS to
regex.h.
2014-02-03 18:27:35 +01:00
Pawel Dziepak d0f2d8282f Merge branch 'scheduler'
Conflicts:
	build/jam/packages/Haiku
	headers/os/kernel/OS.h
	headers/os/opengl/GLRenderer.h
	headers/private/shared/cpu_type.h
	src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.h
	src/bin/sysinfo.cpp
	src/bin/top.c
	src/system/kernel/arch/x86/arch_system_info.cpp
	src/system/kernel/port.cpp
2014-01-17 04:06:15 +01:00
Alexander von Gluck IV aa4b5749d6 runtime_loader: Detect and trigger on PE binaries
* Previously PE binaries would trigger the "incorrectly
  executable" dialog. Now we get a special message for
  B_LEGACY_EXECUTABLE and B_UNKNOWN_EXECUTABLE
* Legacy at the moment is a R3 x86 PE binary. This could
  be extended to gcc2 binaries someday far, far, down the
  road though
* The check for legacy is based on a PE flag I see
  set on every R3 binary (that isn't set on dos ones)
* Unknown is something we know *is* an executable, but
  can't do anything with (such as an MSDOS or Windows
  application)
* No performance drops as we do the PE scan last
* Tested on x86 and x86_gcc2
2014-01-07 19:38:07 -06:00
Alexander von Gluck IV f8da8f3477 ARM: Be aware of ARMEL and ARMEL
* My BeagleBone gcc defines __ARMEL__ but not
  __ARM__ which breaks the native tool builds
* As ARM was originally Little Endian, we assume
  __ARM__ means as such.
* Look for Big Endian ARM and define the needed big
  endian preprocessors
2014-01-01 23:41:02 -07:00
Jonathan Schleifer a7d796e232 Only declare strl{cpy,cat} if they aren't defines.
On some system (e.g. OS X Mavericks), those are defines to compiler
built-ins, thus trying to declare them will fail.
2013-12-17 19:58:51 +01:00
Ingo Weinhold 2b76973fa2 mimeset: Use TextSnifferAddon when using a custom MIME DB
That addresses the problem that packaged text files aren't correctly
identified (ticket #9972). All concerned packages have to be rebuilt,
of course.
2013-11-22 12:24:13 +01:00
Pawel Dziepak 077c84eb27 kernel: atomic_*() functions rework
* No need for the atomically changed variables to be declared as
   volatile.
 * Drop support for atomically getting and setting unaligned data.
 * Introduce atomic_get_and_set[64]() which works the same as
   atomic_set[64]() used to. atomic_set[64]() does not return the
   previous value anymore.
2013-11-05 22:32:59 +01:00
Ingo Weinhold de49e34927 Add symbol versioning for find_directory()
Should already have been done back when the semantics for the
B_COMMON_*DIRECTORY constants was changed.

Currently old and new version behave the same. So this is just a
contingency measure ATM.
2013-10-05 01:33:26 +02:00
Ingo Weinhold 83462cc28d Refactor reusable pkgman code into libpackage
* Move RepositoryBuilder class to libpackage and add B* prefix to name.
* Pull BPackageManager class out of PackageManager and move to
  libpackage. The base class is customizable via three handler objects
  responsible for transaction handling, request execution, respectively
  user interaction.
* Reorganize _ApplyPackageChanges(): Now we first prepare the
  transactions for all affected installation locations (downloading
  files etc.) and then commit them.
2013-08-31 21:19:07 +02:00
Ingo Weinhold 30cdb26b5f Add BDriverSettings to libbe_build 2013-07-06 02:11:18 +02:00
Ingo Weinhold 98c6dfa41e Switch build system from optional package to repositories
* Build libsolv and the dependency solver part of the package kit for
  the build platform.
* Add build tool get_package_dependencies. Given a list of package files
  and a list of repository files it determines the additional packages
  that need to be retrieved from the repositories and prints their URLs.
* Add rules to work with external repositories in the build system
  (build/jam/RepositoryRules):
  - PackageRepository declares an external repository with all its
    packages. The URL of the repository file isn't specified. It is
    computed from a given base URL and the SHA256 hash of the list of
    package files.
  - GeneratedRepositoryPackageList generates a file containing the file
    names of all packages in a repository.
  - IsPackageAvailable returns whether a package is available in any
    repository.
  - PackageURL returns the URL for a package.
* Declare the HaikuPorts repository for x86_gcc2
  (build/jam/repositories/HaikuPorts/x86_gcc2).
* Add rule AddHaikuImagePackages to add a package to the image and rule
  IsHaikuImagePackageAdded to determine whether a package has been
  added.
* OptionalPackages: Remove all entries that just downloaded and
  installed an external package. AddHaikuImagePackages can be used
  instead and is used in the remaining entries. Also move the remaining
  optional package dependency declarations from
  OptionalPackageDependencies here.
* ExtractBuildFeatureArchives: Instead of the URL parameter a package
  name must be specified now. This allows to simplify BuildFeatures
  significantly, since there's no dealing with URLs anymore. "if" out
  the entries that aren't supported yet.
* build_haiku_image: For the packages installed in system and common
  resolve their dependencies and download and install them as well.
2013-07-05 10:51:42 +02:00
Ingo Weinhold 01176bd944 Add basic BUuid class
ATM it's only able to generate random UUIDs.
2013-06-07 02:03:16 +02:00
Ingo Weinhold 4489c88b61 hpkg format: Generalize user/global settings file attributes
* For all identifiers: Rename global settings file to global writable
  file. We want to use the respective attribute also for other writable
  files, not only settings files.
* User settings file/global writable file info/attribute: Add
  isDirectory property/child attribute. This allows declaring global/
  user settings directories associated with the package.
2013-06-06 00:17:02 +02:00
Ingo Weinhold 0f4e11e75c hpkg format: Add attributes for declaring users and groups 2013-05-25 01:12:37 +02:00
Ingo Weinhold a8de2761c7 Move package attribute ID definitions to a separate file
... <package/hpkg/PackageAttributes.h>, which also defines other
properties (name and type) for each attribute. It does so via a macro
that the caller can define to generate whatever code is desired.
2013-05-25 01:12:35 +02:00
Ingo Weinhold fe707a23fc hpkg format: Add attributes for declaring settings files
Global and user settings files can be declared. For global ones an
update policy can be specified. If not specified, the settings file is
not included in the package, but created by the program (or user) later.
If an update type is specified, it defines what to do with the settings
file when updating the package to a newer version.

User settings files are never included in the package; they are always
created by the program or the user. If the package contains a template/
default settings file, it can be declared, but for informative purposes
only.
2013-05-25 01:12:34 +02:00
Ingo Weinhold 1f633814fa hpkg format: compress the whole heap
Instead of handling compression for individual file/attribute data we
do now compress the whole heap where they are stored. This
significantly improves compression ratios. We still divide the
uncompressed data into 64 KiB chunks and use a chunk offset array for
the compressed chunks to allow for quick random access without too much
overhead. The tradeoff is a limited possible compression ratio -- i.e.
we won't be as good as tar.gz (though surprisingly with my test
archives we did better than zip).

The other package file sections (package attributes and TOC) are no
longer compressed individually. Their uncompressed data are simply
pushed onto the heap where the usual compression strategy applies. To
simplify things the repository format has been changed in the same
manner although it doesn't otherwise use the heap, since it only stores
meta data.

Due to the data compression having been exposed in public and private
API, this change touches a lot of package kit using code, including
packagefs and the boot loader packagefs support. The latter two haven't
been tested yet. Moreover packagefs needs a new kind of cache so we
avoid re-reading the same heap chunk for two different data items it
contains.
2013-05-25 01:12:25 +02:00
Ingo Weinhold 0ee1651856 Rename BBlockBufferCache and friends to *Pool*
Also move BBlockBufferPoolNoLock into BHPKG namespace with the other
classes. Not sure why it wasn't there before.
2013-05-25 01:12:25 +02:00
Ingo Weinhold 7575abbca2 Clone read support functionality for HPKG format version 1
It uses sub-namespace BPackage::BHPKG::V1. Unlike the one for the
current format version, the V1 version of BPackageInfoContentHandler
lives in BHPKG(::V1) sub-namespace and is private.
2013-05-25 01:12:22 +02:00
Ingo Weinhold 204dee708a Use libbe_build also on Haiku
This means the build tools will no longer be built against the host
platform's libbe, which avoids compatibility problems -- e.g. an
older Haiku host libbe may not have certain features the build tools
require -- and also makes the build behave more similiar on Haiku and
other platforms. The host libroot dependency still remains and is not
easy to get rid of.

Also remove some bits of BeOS/Dano/Zeta build support.
2013-05-09 18:08:55 +02:00
Ingo Weinhold baadb25955 Add te MimeInfoUpdater to libbe_build 2013-05-09 03:19:25 +02:00