Commit Graph

46456 Commits

Author SHA1 Message Date
Oliver Tappe
7ea6bb1305 Add c++-libs to haiku_cross_devel.hpkg 2013-05-30 00:22:06 +02:00
Oliver Tappe
30c2352188 Adjust buildscript for gcc4 to configure with a sysroot. 2013-05-30 00:22:06 +02:00
Ingo Weinhold
e63bdfec75 Rename post_install dir to post-install 2013-05-29 02:24:54 +02:00
Ingo Weinhold
b361d03f93 haiku.hpkg package info: zlib is a separate package 2013-05-28 03:30:49 +02:00
Ingo Weinhold
56b43eca03 BPackageInfoContentHandler: Handle new attributes
Also add respective *Data constructors to BUser, BUserSettingsFileInfo,
and BGlobalSettingsFileInfo.
2013-05-28 02:44:13 +02:00
Ingo Weinhold
badd403c5e Update grep package 2013-05-27 04:27:26 +02:00
Ingo Weinhold
75c10de291 libroot_build _kern_read_dir(): reset errno before readdir()
Since we're checking errno when readdir() didn't return an entry, we
need to reset it before, or we might see a spurious error value.
2013-05-27 01:05:58 +02:00
Matt Madia
a196160c9a On FreeBSD, "<malloc.h> has been replaced by <stdlib.h>" 2013-05-25 19:41:18 +02:00
Ingo Weinhold
3da422ad05 libroot_build: Fix issues with attribute FD for symlink
AttributeDescriptor: Don't use dup() directly. Check, if the given FD is
one we track and clone it respectively. This allows use with symlink FDs
which we have to fake on Linux (since symlinks cannot be opened). Fixes
extraction of packages containing symlinks with attributes.
2013-05-25 02:38:52 +02:00
Ingo Weinhold
e2f30519ab hpkg format: user big endian for chunk sizes 2013-05-25 01:55:36 +02:00
Ingo Weinhold
a98dd49a6b package info parser: allow escaping of new lines
So we can break long lines without changing the semantics.
2013-05-25 01:12:38 +02:00
Ingo Weinhold
38a0419a72 package info parser: improve parse error column numbers
Assume 4 column tab stops and compute the column numbers accordingly.
2013-05-25 01:12:38 +02:00
Ingo Weinhold
a3e070a7ff WriterImplBase: Add _AddStringAttributeList()
... and simplify some code by using it.
2013-05-25 01:12:38 +02:00
Ingo Weinhold
a11b0003ec packagefs: CachingPackageReader: Don't delete cached heap reader
... in destructor. After we create it, it belongs to the super class and
is destroyed by it.
2013-05-25 01:12:38 +02:00
Ingo Weinhold
c0ab140961 hpkg format: Add attribute for declaring post install scripts 2013-05-25 01:12:37 +02:00
Ingo Weinhold
927e070869 WriterImplBase: Some simplifications
... using the recently introduced _AddStringAttribute[IfNotEmpty]().
2013-05-25 01:12:37 +02:00
Ingo Weinhold
0f4e11e75c hpkg format: Add attributes for declaring users and groups 2013-05-25 01:12:37 +02:00
Ingo Weinhold
c82776b2fa BString: Add Split() 2013-05-25 01:12:36 +02:00
Ingo Weinhold
8698ee4521 BStringList: Declare Join() const 2013-05-25 01:12:36 +02:00
Ingo Weinhold
bf88057b26 ReaderImplBase: Fix copy and paste oversight 2013-05-25 01:12:36 +02:00
Ingo Weinhold
daa10fc3a5 Move package info string builder to its own header 2013-05-25 01:12:36 +02:00
Ingo Weinhold
6da0ce6ff2 Move package info parser to its own file 2013-05-25 01:12:35 +02:00
Ingo Weinhold
79d5ddb77b ReaderImplBase: Verify that the attribute type matches
... the one expected for the respective attribute. Before it was
possible that e.g. a uint was read and then interpreted as a
const char*, if a string was expected for that attribute.
2013-05-25 01:12:35 +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
5497f08e5e hpkg attribute tags: use 7 bits for attribute ID
ATM the 6 bits suffice, but there isn't that much headroom.
2013-05-25 01:12:34 +02:00
Ingo Weinhold
4ffb923413 PackageFileHeapWriter::RemoveDataRanges(): Fix empty heap check 2013-05-25 01:12:34 +02:00
Ingo Weinhold
bac0bb2e8f RepositoryWriterImpl: Write the heap fields in the header 2013-05-25 01:12:34 +02:00
Ingo Weinhold
47039b852e Package/repository file format: Add a minor version header field
* Add minor_version to hpkg_header and hpkg_repo_header and make
  heap_compression uint16.
* If the minor version of a package/repository file is greater than the
  current one unknown attributes are ignored without error. This allows
  introducing new harmless attributes without making the resulting files
  unreadable for older package kit versions.
2013-05-25 01:12:33 +02:00
Ingo Weinhold
5dae1541d6 Add "source" package architecture 2013-05-25 01:12:33 +02:00
Ingo Weinhold
bc306e210f Declare some string constants actually const 2013-05-25 01:12:33 +02:00
Ingo Weinhold
46122852f1 packagefs: Add caching for the package file heap reader
* ReaderImplBase:
  - Add virtual CreateCachedHeapReader() which can create a cached
    reader based on the given heap reader.
  - Rename HeapReader() to RawHeapReader() and add HeapReader() for the
    cached heap reader.
  - Add DetachHeapReader() to allow a clients to remove the heap
    reader(s) after deleting the ReaderImplBase object.
* packagefs:
  - Add CachedDataReader class, which wraps a given
    BAbstractBufferedDataReader and provides caching for it using a
    VMCache. The implementation is based on the IOCache implementation.
  - Use CachedDataReader to wrap the heap reader. For file data that
    means they are cached twice -- in the heap reader cache and in the
    file cache -- but due to the heap reader using a VMCache as well,
    the pages will be recycled automatically anyway. For attribute data
    the cache should be very helpful, since they weren't cached at all
    before.
2013-05-25 01:12:32 +02:00
Ingo Weinhold
69a1f1f53f packagefs: Fix attribute indexing
Since the package nodes' attributes are indexed before the VFS has
accessed any of its nodes, the package wasn't open and reading the
attribute data would fail. We do now open the package explicitly in
UnpackingAttributeCookie::IndexAttribute(). Moreover, as an
optimization, we also open the package in Volume::_AddPackageContent(),
so the package file isn't repeatedly opened and closed as its nodes are
being registered.
2013-05-25 01:12:32 +02:00
Ingo Weinhold
c3bd329fa2 PackageFileHeapAccessorBase: Fix error output 2013-05-25 01:12:32 +02:00
Ingo Weinhold
b814feabd7 packagefs: PackageFile::DataAccessor: Avoid unnecessary locking
... in case of version 2 package files.
2013-05-25 01:12:32 +02:00
Ingo Weinhold
d59e0feb59 package: Suppress version mismatch errors where V1 is supported
* Add flags parameter to Init() of BPackageReader and friends.
* Introduce flag B_HPKG_READER_DONT_PRINT_VERSION_MISMATCH_MESSAGE and
  don't print a version mismatch error when given.
* package extract/list: Use the new flag.
2013-05-25 01:12:31 +02:00
Ingo Weinhold
64bb883062 Support booting with a packaged boot loader
* Add new package haiku_loader.hpkg and move haiku_loader there. The
  package is built without compression, so that the stage 1 boot loader
  has a chance of loading it.
* Adjust the stage 1 boot loader to load the haiku_loader package and
  relocate the boot loader code accordingly.
2013-05-25 01:12:31 +02:00
Ingo Weinhold
01c03710f0 BuildHaikuPackage rule: Add grist to package info file
... to avoids clashes with equally named targets.
2013-05-25 01:12:30 +02:00
Ingo Weinhold
bfa408d70a packagefs: PackageData: Fix copy and paste error 2013-05-25 01:12:30 +02:00
Ingo Weinhold
2a6f1725c6 packagefs: Resolve error output TODOs 2013-05-25 01:12:30 +02:00
Ingo Weinhold
760dee16d1 packagefs: Add va-args version ERRORV() to DebugSupport 2013-05-25 01:12:30 +02:00
Ingo Weinhold
5261923e87 Add dvprintf() 2013-05-25 01:12:29 +02:00
Ingo Weinhold
14713507a3 packagefs: Fix debug build 2013-05-25 01:12:29 +02:00
Ingo Weinhold
1559102fe7 ReaderImplBase: Fix strings subsection validity check
A strings section with 0 strings is still 1 byte long. Also improve the
error output in the error case.
2013-05-25 01:12:29 +02:00
Ingo Weinhold
521545f7fb Add padding in HPKG/HPKR headers
... so that the different alignment on 32 and 64 bit machines doesn't
change the layout.
2013-05-25 01:12:28 +02:00
Ingo Weinhold
5d3de03be5 libroot_build: Fix fs_read_attr() in fs_attr_untyped.cpp
* With a specified buffer size smaller than the attribute size the
  function would fail with ERANGE on Linux although it should just read
  as much as possible. Now we always read into our temporary data buffer
  with the full buffer size.
* Fix return value in case pos is > 0. pos must be subtracted from the
  bytes actually read.
2013-05-25 01:12:28 +02:00
Ingo Weinhold
88adb4a8e7 PackageFileHeapWriter: Add error message
... in case compression fails unexpectedly.
2013-05-25 01:12:28 +02:00
Ingo Weinhold
d03ac965a2 ReaderImplBase: Fix gcc 4 build 2013-05-25 01:12:28 +02:00
Ingo Weinhold
b05413ed78 PackageFileHeapWriter: Fix update case
* Pull _UnwriteLastPartialChunk() out of Reinit() for reuse.
* _UnwriteLastPartialChunk(): fPendingDataSize wasn't set.
* _PushChunks(): Some simplifications for clarity.
* ChunkBuffer/RemoveDataRanges(): Use data reading and decompression
  methods provided by our base class instead of duplicating the
  implementation.
* RemoveDataRanges():
  - _FlushPendingData() before starting, so we don't ignore the pending
    data and _UnwriteLastPartialChunk() when done, so a partial chunk
    is read back into the pending data buffer.
  - fUncompressedHeapSize wasn't reset before the main processing loop,
    thus resulting in an erroneous size later on.
2013-05-25 01:12:27 +02:00
Ingo Weinhold
520a7a76c7 PackageFileHeapAccessorBase: small refactoring
* Pull method DecompressChunkData() out of ReadAndDecompressChunkData()
  for potential reuse.
* Also fix/improve some error output strings.
2013-05-25 01:12:27 +02:00