Commit Graph

340 Commits

Author SHA1 Message Date
Panu Matilainen fa0898552d Add support for "lzma alone" compression format (lzdio)
- "lzma alone" is superseeded by XZ but it's used by Suse and Mandriva
  distros so it's nice to have as it doesn't need much, only open differs
  from XZ
- rpmlib() dependency versions are an uuuuuuuugly mess here: Suse used
  "PayloadIsLzma = 4.4.2-1" so that's what we provide to be most compatible
  (hopefully). Built packages require "PayloadIsLzma <= 4.4.6-1" however
  to be compatible with Mandriva 2008.0. Did I already say it's ugly?
- Based on similar patch in Mandriva by Per Øyvind Karlsen, but avoiding
  unnecessary renames in rpmio
2009-03-18 11:24:52 +02:00
Panu Matilainen 8078d0ba24 LZMA -> XZ renaming
- what we support now in payloads is XZ, not the former LZMA format, rename
  user- and header-visible parts to match this
- rpmlib(PayloadIsXz) dependency versioned 5.2-1 to avoid unnecessary
  incompatibility with what rpm5 has and what Mandriva is already using
- only provide the rpmlib dependency if actually built with xz support
- rpmFileIsCompressed() attempts to guess the magicless old lzma format
  by file suffix, so it can handle both right now
2009-03-18 09:42:23 +02:00
Florian Festi 395b5cffd5 Move ->actions from rpmfi to rpmfs
and adjust all code using it
also "revert" a4e345455d
 "Move file action calculations to rpmfiNew() where possible"
2008-12-10 13:40:53 +01:00
Panu Matilainen b12afb1a40 Oops, it wasn't unnecessary include afterall.. 2008-11-27 11:35:56 +02:00
Panu Matilainen 0b5e0fb58c Remove unnecessary rpmfi_internal.h include 2008-11-27 10:59:14 +02:00
Panu Matilainen 610347de6e Pass rpmte to fsmSetup()
- fsm needs the transaction element for progress notification and
  element type anyway
2008-11-27 09:25:12 +02:00
Panu Matilainen 03d0f43f0b Lazy allocation of FSM for file info sets
- new more or less internal rpmfiFSM() to create FSM on demand, move
  mapflags calculation there
2008-11-18 11:27:47 +02:00
Panu Matilainen ff9733b6fd Generate and insert SOURCERPM tag earlier
- needed to make checking for source/binary package in rpmfiNew() reliable
  at build time
2008-11-18 11:22:26 +02:00
Jindrich Novy d535818f42 Add the post-build package checker feature in rpmbuild (upstream ticket #2)
- allow to run helper programs to check:
  - generated SRPM
  - each generated RPM after it is successfully written
  - whole successfully written binary package set
- it is possible to use it for sanity checks
2008-11-10 15:52:29 +01:00
Jindrich Novy ef539ed4dc Fix error messages in processScriptFiles() 2008-09-22 12:10:36 +02:00
Panu Matilainen 9068da47a9 Unbreak payload size tag generation on ppc (rhbz#458817) 2008-08-13 09:43:41 +03:00
Panu Matilainen 219917989a Teach build about 64bit payload etc size tags
- only use 64bit variants for packages that actually need it to avoid
  breaking compatibility when not needed
- old rpm will bail out "cleanly" (with an obscure error message) if
  the 32bit size tags are missing but at least it doesn't crash...
2008-06-26 16:34:32 +03:00
Panu Matilainen 6985cd2372 Type corrections
- Fread() and Fwrite() return ssize_t, not int32_t
- sigtag is rpmSigTag, not int32_t
2008-06-26 10:50:01 +03:00
Panu Matilainen 683b2e5b72 Use type specific headerPut() for all of build/pack.c 2008-06-19 15:43:45 +03:00
Panu Matilainen d68f236bba Convert RPM_BIN_TYPE uses in build to headerPut() 2008-06-18 12:37:42 +03:00
Panu Matilainen 61aa908354 Shut up incompatible pointer warnings from rpmtdFromStringArray()
- it'd be far nicer to be able to append single strings to string arrays
  through rpmtdFromString() but it'll require some interesting hackery
  in header.c
- use temporary const char* pointer where necessary to convert to
  const char ** compatible type before passing to rpmtdFromStringArray()
2008-06-17 16:07:55 +03:00
Panu Matilainen d6aded3128 Convert rest of writeRPM() to headerPut()
- can't use rpmtdFromFoo() on signature header tags so need to construct
  them manually
2008-06-17 14:54:44 +03:00
Panu Matilainen 2b6f72a7ee Convert most of build/pack.c to use rpmtdFromFoo() and headerPut()
- heavy on asserts() for now to catch out any problems
- sigtags can't use rpmtdFromFoo() as the tag numbers collide with the
  regular tag table and would cause failures if we tried
2008-06-17 12:10:01 +03:00
Panu Matilainen 8687797c1c Replace headerRemoveEntry() with headerDel() everywhere
- this is a no-brainer s/headerRemoveEntry/headerDel/g operation as the
  interface didn't actually change at all
2008-06-17 09:07:37 +03:00
Panu Matilainen 161395648f Use 64bit type internally for package archive size & offset
- cpio "new" ascii format limits individual files to UINT32_MAX, no such
  limit on the entire archive though
- RPMSIGTAG_PAYLOADSIZE is 32bit type atm, assert that the archive size
  fits to UINT32_MAX despite internal presentation being larger
- FD_t limits the real archive to rpm_off_t still
2008-06-09 12:29:07 +03:00
Panu Matilainen a9d7285cb0 Oops, don't free data we're supposed to pass around... 2008-05-26 17:07:00 +03:00
Panu Matilainen 5267010b65 Convert addPackageProvides() to new headerGet() 2008-05-26 15:28:03 +03:00
Panu Matilainen 1814782eef Convert writeRPM() to use new headerGet() 2008-05-26 15:25:11 +03:00
Panu Matilainen 0537efeb77 Convert addFileToTag() to new headerGet() 2008-05-26 14:45:00 +03:00
Panu Matilainen ea9b00dab8 Convert internal uses of headerSprintf() to headerFormat() 2008-05-12 16:20:13 +03:00
Panu Matilainen 0ee67fede8 Temp file handling tweaks
- rename rpmMkTemp() (back) to rpmMkTempFile()
- rpmMkTemp() is now a lower level thin wrapper around mkstemp()
2008-05-03 12:34:19 +03:00
Jindrich Novy 341266ae26 Allow lzma payload in writeRPM() 2008-04-22 12:32:59 +02:00
Panu Matilainen 55ebf2c079 Abort build on unknown payload compressor
- explicitly check for supported rpmio names, bail if not supported
2008-04-15 09:16:05 +03:00
Panu Matilainen fde961e25b Rewrite rpmMkTempFile() for sanity
- Actually use mkstemp() for creating the temp file and return a FD_t
  dupped from the file descriptor returned by mkstemp().
- Simplify the interface while at it.
- Change callers for the new interface.
- Yes we now require mkstemp() to work, mkstemp() is in POSIX.1-2001 and
  this is year 2008...
2008-04-11 09:05:05 +03:00
Panu Matilainen 48ff62a529 First crack at adding ISA provides to packages (rhbz#235755)
- Horrible kludgery to get the isa names and bits into platform specific
  macros from installplatform script. That beast needs to die. I mean really

- In build, add provides: name(isa) = evr automatically when it makes
  sense (similarly to name = evr provides). ISA consists of ISA name and
  bitness (or wordsize). This can be used to correctly
  express multilib dependencies without resorting to (expensive!) file
  dependency kludges, eg for dlopen()'ed libraries where automatic
  dep extraction doesn't force dependency on 32bit vs 64bit version, you
  can now use:
      Requires: foo-plugin%{?_isa}
  This expands to foo-plugin(x86-32) for i?86 packages, foo-plugin(x86-64)
  to x86_64 etc, and permits spec to be shared with older distros which
  don't have ISA provides.

- The same could be expressed with "canon arch" just as well, but
  using the ISA to differentiate from %_arch and the like:
  eg i386 could be used instead of x86-32 but it's overloaded with meanings
  (the actual i386 processor vs i386 compatible cpu family etc)
2008-04-10 19:36:03 +03:00
Panu Matilainen c01ef8228d Add a static, far simpler addPackageProvides() to build
- use instead of providePackageNVR() which needs to deal with all sorts
  of hysteric "rpm 3.0.2 did this but 3.0.5 didn't" issues
2008-04-10 15:52:36 +03:00
Panu Matilainen f350b07096 Remove unnecessary providePackageNVR() from writeRPM()
- packageBinaries() already calls providePackageNVR(), no need to do it twice
2008-04-10 11:25:59 +03:00
Panu Matilainen c4659498e3 Eliminate bogus const's from spec structure 2008-03-24 19:03:20 +02:00
Panu Matilainen f35277c8a7 Eliminate wtf pointer games with rpmGetPath result. 2008-03-24 19:01:12 +02:00
Panu Matilainen 7ae38cdd44 Avoid entirely silly rpmio use in addFileToTagAux() 2008-03-24 19:00:48 +02:00
Jindrich Novy a3ceec504b Use rasprintf() to prevent overflows and remove BUFSIZ buffer limit. 2008-03-23 13:50:07 +01:00
Jindrich Novy ca6f318f7a Fix writeRPM, use dynamic allocation, remove bogus const. 2008-03-23 13:48:49 +01:00
Panu Matilainen 8e7bc88eda Make yet more build tables readonly
- preambleList and partList are modified runtime for silly reasons,
  reminders to fix later..
2008-03-06 20:47:17 +02:00
Panu Matilainen d718b12f5b Mass convert (back) to rpmTag as it's usable everywhere now
- cast away a few cases where the enum usage causes ridiculous amount
  of compiler warnings from unhandled switch-cases
2008-02-05 17:42:19 +02:00
Panu Matilainen 130118d594 Use rpmTagType always now that it's available everywhere
- RPM_MASK_TYPE is not a datatype, move it out of the enum
- add missing cases python header handling to shut up gcc
2008-02-05 16:14:34 +02:00
Panu Matilainen e886043a10 Add rpm_off_t type for file size types, use where spotted
- preliminaries for bumping up the max size, use rpm-specific type
  as off_t size varies, header data needs fixed size
2008-02-04 11:27:00 +02:00
Panu Matilainen eb5dc35c19 Include spring-cleaning
- put some consistency into include ordering
- everything (apart from bits missed ;) is now ordered like this
  1. "system.h"
  2. other system includes
  3. rpm public headers
  4. rpm private headers
  5. "debug.h"
2008-01-30 17:05:29 +02:00
Panu Matilainen 99faa2735b rpmlib.h mass eviction
- explicitly include what's really needed instead
- document remaining uses
2008-01-30 13:53:51 +02:00
Panu Matilainen 68e1d60be3 Signedness consistency in rpmfi interface vs internal structures 2008-01-02 17:02:06 +02:00
Panu Matilainen addac6a86b Add rpm_data_t (and _constdata_t) for header data, use everywhere
- consistent, easy to grep for and change...
- bogus consts removed where spotted
2007-12-19 12:05:56 +02:00
Panu Matilainen 8bdd462b50 Make fsm failedFile non-const like it really is
- callers need to free it so const is wrong
- cast away the hardlink-hackery in fsm instead
2007-12-18 10:10:03 +02:00
Panu Matilainen 506a8f5365 Bogus const in temporary variables 2007-12-16 21:24:44 +02:00
Panu Matilainen 598d6efc86 Much of spec internals is exposed, let them be const for now 2007-12-16 20:58:44 +02:00
Panu Matilainen 14284725e6 Remove const from rpmMkTempFile file name parameter
- the temp name is malloced and needs to be freed by caller
2007-12-16 16:25:09 +02:00
Panu Matilainen b6a663ec0a Remove bogus const from rpmGetPath() temporary targets 2007-12-15 10:39:15 +02:00