Commit Graph

11533 Commits

Author SHA1 Message Date
Florian Festi d951812386 Kill FSM: Make FSM_PKGBUILD a function 2012-03-30 15:00:41 +02:00
Florian Festi c5282fc60d Kill FSM: Make FSM_PKGERASE a function 2012-03-30 15:00:41 +02:00
Florian Festi bd60c4285f Kill FSM: Make FSM_PKGINSTALL a function 2012-03-30 15:00:41 +02:00
Florian Festi 800c60ea10 Prepare for killing the fsm: Move initial call to FSM from fsmSetup to rpmfsmRun. Make fsm FSM_t. 2012-03-30 15:00:41 +02:00
Florian Festi 8cd9750313 Prepare for killing the fsm: Inline FSM_UNDO; Remove FSM_UNDO calls were fsm->postpone is set and FSM_UNDO doesn't do anything. 2012-03-30 15:00:41 +02:00
Florian Festi a78d648c24 Prepare for killing the fsm: Inline remaining FSM_PROCESS code in FSM_PKGINSTALL 2012-03-30 15:00:40 +02:00
Florian Festi 80419742e6 Prepare for killing the fsm: Remove superfluous check for being in FSM_PROCESS to allow killing FSM_PROCESS. fsmVerify is only called while being in FSM_PROCESS. 2012-03-30 15:00:40 +02:00
Florian Festi a6479a8e47 Prepare for killing the fsm: Make FSM_COMMIT a function 2012-03-30 15:00:40 +02:00
Florian Festi 9b96ed08cc Prepare for killing the fsm: Move build code from PSM_PROCESS to FSM_PKGBUILD 2012-03-30 15:00:40 +02:00
Florian Festi 1845c1d711 Prepare for killing the fsm: Move code for erasing files from FSM_COMMIT to FSM_ERASE 2012-03-30 15:00:40 +02:00
Florian Festi ff4f110306 Prepare for killing the fsm: Inline FSM_DESTROY in fsmTeardown() 2012-03-30 15:00:40 +02:00
Florian Festi 9de132d9e5 Prepare for killing the fsm: Inline FSM_FINI code.
Move cleaning the stat_s structs to fsmInit() (beginning of the loop instead of the end)
Drop freeing fsm->path as this is done in fsmInit() and fsmTeardown()
2012-03-30 15:00:40 +02:00
Florian Festi c362272343 Prepare for killing the fsm: Inline the FSM_NOTIFY code 2012-03-30 15:00:40 +02:00
Ales Kozumplik b714dcea37 rpmbuild: warn if header color differs from color of the package architecture.
- For example, warn when building an x86_64 package that only contains 32
  bit binaries.
- This should indicate to the maintainers that they might have gotten the
  architecture wrong.
- Introduces 'archcolor' in rpmrc so we can map architectures to colors.
- Related: RhBug:713323
2012-03-30 13:55:03 +02:00
Panu Matilainen 7c39c65da4 Axe leftover CANONARCH assignment messing up our "base" archs (RhBug:808250)
- This should've been in commit 2a8d036697,
  the leftover CANONARCH resets the "base arch" we just set to a wrong
  value.
2012-03-30 10:04:33 +03:00
Panu Matilainen fe252f21b3 Accept files as command line arguments again in rpmdeps (RhBug:807767)
- Commit a25c3c7bac removed what was
  supposedly a non-supported method of passing files as arguments
  (instead of the normal stdin method) to rpmdeps. Turns out
  rpmdeps is even documented to take files as cli args, and that's
  how Fedora's %filter_setup macros are calling it...
- Allow files as arguments again, but in a way that doesn't cause
  argvFoo() vs popt crash-n-burn.
2012-03-29 11:26:57 +03:00
Florian Festi cc1e2328c1 Inline FSM_NEXT 2012-03-27 14:34:30 +02:00
Florian Festi c8d34d9deb Remove left over debugging code 2012-03-27 14:32:52 +02:00
Florian Festi 75073ae2a4 Move fsm_s to fsm.c and remove fsmNext() from fsm.h 2012-03-27 14:12:42 +02:00
Florian Festi 7c37d52941 Remove Fseek() code from rpmcpioHeaderRead for now
Fseek() does not return a proper error code. This needs to be fixed before we can use it as most comprssed files do not support seeking and we need to be able to detect this reliably
2012-03-27 14:12:42 +02:00
Florian Festi 6492aa800f Untangle lib/fsm.c and lib/cpio.c
Create cpio_t data type that holds the underlaying FD_t instance
Move padding and position handling and trailer generation into cpio.c
Use only one buffer in the fsm (merging the read and write buffer)
Replace the FSM_EAT, FSM_POS, FSM_PAD, FSM_DREAD, FSM_DWRITE states with cpio functions
Prepend "rpm" to the cpio function names
2012-03-27 14:12:42 +02:00
Panu Matilainen dd05fdd35f Dont bother building internal versions of db utilities we dont need
- rpmdb_dump, load, recover, verify, stat etc are useful at times,
  but these are not. This also fixes build with internal db for
  more recent versions of Berkeley DB.
2012-03-26 13:03:03 +03:00
Panu Matilainen 0b8c321802 Eliminate broken data end calculation in dataLength()
- If the caller doesn't know the end pointer, we dont have a whole lot
  of chance to come up with a reasonable one either. Just assume
  the terminating \0's are there when end boundary is not specified:
  when this happens we're dealing with relatively "trusted" data
  anyway, the more critical case of reading in unknown headers does
  always pass end pointers.
- While capping the end pointer to HEADER_DATA_MAX seems like a
  reasonable thing to do (as was done in commit
  f79909d04e), it doesn't really help
  (bad data would likely run past bounds anyway), and it's not right
  either: the pointer can be to a stack address, and the stack can be
  near the top of addressable range, and ptr + HEADER_DATA_MAX can
  cause pointer wraparound. Notably that's exactly what happens
  when running 32bit personality process on 64bit system on Linux,
  at least in case of i386 process on x86_64, causing all sorts of
  breakage..
2012-03-23 14:36:34 +02:00
Panu Matilainen 8a189c6383 Oops, "magic eight" is necessary here afterall
- Fix regression from commit 807b402d95,
  the array gets passed as a pointer (how else would it work at all),
  so despite having seemingly correct type, sizeof(keyid) depends
  on the pointer size. This happens to be 8 on x86_64 and friends
  but breaks pgp fingerprint calculation on eg i386.
- Also return the explicit size from pgpExtractPubkeyFingerprint(),
  this has been "broken" for much longer but then all callers should
  really care about is -1 for error.
2012-03-22 12:34:08 +02:00
Panu Matilainen c411382194 Add test case for scriptlet behavior
- The test-root has a shell but rpm doesn't know about it, add a
  fakeshell metapackage that provides it. Should come in handy for
  other cases as well, up to now we've been limited to lua scripts only.
- Test that all the "normal" scripts get executed, in expected order
  and with expected arguments, on install, upgrade and erase.
- This would've saved the rather embarrassing breakage with commit
  274dbf557d at least, but better
  late than never as they say... It also serves to highlight and
  document  the arguably broken arguments to %pre- and %posttrans
  scripts (ie always 0)
2012-03-21 10:10:07 +02:00
Panu Matilainen 2f20f6e6b2 Transaction element file info can be legally NULL in some cases
- rpmteClose() will wipe out the file info to free memory, we only
  should care whether we failed to (re)load the file info. This
  thinko in commit 06a2f1269b
  broke %posttrans scriptlets (and without commit
  274dbf557d, %pretrans in other
  circumstances), whoopsie *blush*. Now, off to write a test-case
  for our scriptlet behavior...
2012-03-21 09:07:21 +02:00
Panu Matilainen 274dbf557d Don't free up file info sets on transaction test-runs, take II
- Despite commit cef18c9480, we'd still
  end up freeing the file info sets via rpmteClose() while going
  through the test-transaction packages. This together with commit
  06a2f1269b caused install failures
  on packages which have %pretrans scriptlets, if a test-transaction
  was first performed on the same transaction set that gets used
  for the "real" transaction as well. How wonderfully obscure...
2012-03-20 16:32:54 +02:00
Panu Matilainen 72b6a384f5 Bump version to appear newer than 4.10.x branch 2012-03-20 10:05:49 +02:00
Panu Matilainen b699dd4bc1 Update translations from Transifex 2012-03-20 10:00:06 +02:00
Panu Matilainen ac5e6cd521 Bump library sonames in preparation for new release
- This is stupid... only librpm and librpmio actually need the bump due
  to ABI breakage, librpmbuild and librpmsign are unchanged and could
  use just a revision bump. But just incrementing the revision (or age)
  would set us on collision course with maintenance updates to 4.9.x.
  Then again its not like you can actually use librpmbuild or librpmsign
  without also linking to librpm(io) so from everything needs rebuilding
  anyway. This all also pretty much makes the whole libtool library
  versioning a bit moot. Bah.
2012-03-20 09:56:30 +02:00
Panu Matilainen 05487d9a3f Look up obsoletes both ways on dependency checking (RhBug:804069)
- "pure install" like 'rpm -i' never removes anything (long-standing
  behavior that we dont want to change), but that causes us to allow
  installing obsoleting packages without removing what they obsolete,
  which in turn causes errors on verify. Not good.
- This (together with commit 9fb81eac0b)
  makes obsoletes behave like conflicts in such a case, preventing
  the inconsistency from taking place. Also verify will now whine
  on all the involved packages on inconsistencies.
2012-03-19 17:05:52 +02:00
Panu Matilainen 9fb81eac0b Handle obsoletes (more) correctly in rpmdbProvides()
- Obsoletes should only be matched against package names, not provides,
  or file names for that matter. This hasn't really mattered so far
  due to the way rpmdbProvides() gets called currently, but there's
  a missing case that requires this...
2012-03-19 16:51:11 +02:00
Panu Matilainen 3dce75e433 Fixup couple of md5/digest references regarding verify in the manual
- '5' in verify stands for digest nowadays, keep the md5 reference to
  explain why 5 is for digest though (related to RhBug:804049)
- In --dump query everything relates to files, refer to the attribute
  in question ie 'digest' instead of 'filedigest'
2012-03-19 12:46:10 +02:00
Vincent Untz 9ba41db49f Fix find-lang to correctly detect all translations for new gnome help
This was not working for locales with a territory (fr_FR, for instance).

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2012-03-19 10:04:47 +02:00
Panu Matilainen 9a15e18a63 Include more package information in the progress output
- For non-hashed mode, dump the full NEVRA string. This might break
  programs that are parsing the --percent format, but such programs
  almost certainly need adjusting for the added erasure progress anyway.
- For hashed mode, show package NEVR instead of just name. Otherwise
  somebody will sooner or later file a bug on "confusing output"
  as it might seem it's removing what it just installed in upgrade-mode.
  Full NEVRA would be better still but screen estate is tight as it is...
- Also get rid of headerFormat() call here, use RPMTAG_NEVR(A) extensions
  instead.
2012-03-19 08:53:24 +02:00
Panu Matilainen 0d3d3d83f1 Make a bit more room for names in progress output (cosmetics) 2012-03-19 08:21:17 +02:00
Panu Matilainen 1220f6642a Fix rpm2cpio.sh error exit on unrecognized compression
- This is not a function so it needs to be exit, not return.
  Reported as a side-note in RhBug:803421.
2012-03-15 11:41:40 +02:00
Panu Matilainen ff0eed0552 Unbreak lua's base64 encode/decode extensions
- Commit 70f063cb77 accidentally
  changed lua's base64 encode/decode interface too, ugh. Dangers of
  search-and-replace... Only the function name string exported to
  lua matters but renaming the internal functions back as well
  for naming consistency.
2012-03-14 11:35:37 +02:00
Panu Matilainen 1e318f557c Make rpm2cpio exit code accurate for large packages and partial copy
- Grab the uncompressed payload size from header and compare number
  of bytes copied to that for exit code. Previously, truncated
  payloads could have returned with success. This also fixes the
  exit code for large payloads (RhBug:790396)
2012-03-14 11:20:42 +02:00
Panu Matilainen aa90bda89b Fix ufdCopy() for large (> 2GB) files
- Files can be (much) larger than INT32_MAX, change the return
  type to off_t and fix + simplify the calculations. Fixes the other
  half of RhBug:790396 and makes ufdCopy() usable for other purposes too.
2012-03-14 11:19:47 +02:00
Panu Matilainen c3f3696742 Teach rpm2cpio.sh about xz compression (RhBug:674348 & others) 2012-03-12 15:26:01 +02:00
Panu Matilainen dec729bc3a Eliminate rpmSetTable() from the API
- Presumably the rpmrc internals still need the magic table tennis
  but nobody else should want to mess with this, reconfiguration
  for another (build) arch is done through rpmReadConfigFiles().
2012-03-09 13:13:25 +02:00
Panu Matilainen e76ba6f332 rpmSetTables() call in rpmbuild has been dying long enough by now
- The call to rpmSetTables() from rpmbuild is simply redundant for
  all I can tell, it gets called from inside rpmrc/config processing
  with the same values and the extra call here never changes anything
  as the tables have already been set through rpmReadConfigFiles()
  whether building for several targets or not.
2012-03-09 13:05:38 +02:00
Panu Matilainen b542b2fbc6 Allow silent build on automake versions that support it 2012-03-09 12:16:11 +02:00
Panu Matilainen c345cb28e1 Whoops, dont make install progress callbacks on erasure 2012-03-08 15:12:33 +02:00
Panu Matilainen a74b9b72a6 Optimize python db index instances list generation and fix related leak
- The number of entries is well know, allocate the entire list at
  once and set instead of appending one by one. Also cures a leak from
  created tuples not being decref'ed before - list set steals the
  reference whereas append requires an additional decref to transfer
  the ownership to the list.
2012-03-08 10:17:47 +02:00
Panu Matilainen 1432d53383 Optimize header data python conversion for array tags a bit
- We know the array size beforehand, allocate the entire array
  at once and set the elements instead of appending one by one.
  This is (an obvious) and well-measurable, if not a huge, win.
2012-03-08 10:02:51 +02:00
Panu Matilainen 5cf61c9a75 Pull updated translations from Transifex 2012-03-07 15:02:54 +02:00
Panu Matilainen 1b729439c6 Revert to former spec query behavior + comment
- Various tools expect to get the full package list, not just those
  that would actually be built. There are of just as valid reasons
  for only wanting the packages that would be built, but we need
  to make this caller specifiable, just changing the behavior breaks
  existing tools unnecessarily. Add reminder comment why the thing
  is the way it is...
2012-03-07 14:34:34 +02:00
Ville Skyttä 95fe0d53d4 Add --disable-dependency-tracking to %configure options.
autotools dependency tracking isn't generally useful in rpm builds;
disabling it results in cleaner build logs and possibly slight build
speedups.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2012-03-07 14:13:03 +02:00