Commit Graph

8176 Commits

Author SHA1 Message Date
Panu Matilainen d1c9e039a4 Fix typo in sqlite backend preventing it from building 2008-06-06 18:53:44 +03:00
Jindrich Novy 90c18fbece Introduce 64bit rpm_loff_t 2008-06-06 15:15:01 +02:00
Jindrich Novy 18def17376 Teach sqlite backend 64bit handling 2008-06-06 15:10:57 +02:00
Jindrich Novy e2427595aa Handle RPM_INT64_TYPE in header functions 2008-06-06 15:04:25 +02:00
Jindrich Novy 49dfc587d5 Introduce htonll() 2008-06-06 15:03:19 +02:00
Jindrich Novy 56a8f9d908 Introduce RPM_INT64_TYPE 2008-06-06 14:57:05 +02:00
Panu Matilainen 09d8cbafff Unexport file state machine internals
- fsmGetTs(), fsmGetFi(), fileStageString(), fileActionString(),
  fsmMapPath(), fsmMapAttrs() and fsmStage() aren't needed outside fsm,
  make 'em static to avoid leaking to symbol space
2008-06-03 14:26:34 +03:00
Panu Matilainen 50f34a622e Rip doputenv() for good 2008-06-03 13:51:57 +03:00
Panu Matilainen ed859877a5 Use setenv() for preparing scriptlet environ
- setenv() allocates memory as needed, no need to leak it
- setenv() is nicer interface for the purpose anyway
2008-06-03 13:48:57 +03:00
Panu Matilainen a7a9595d9b Rip dosetenv()
- just use regular setenv() instead
- we already carry setenv() in misc/ for platforms that don't have it
2008-06-03 13:39:07 +03:00
Panu Matilainen 6f010ec18d Unexport rpmsqCaught now that nothing needs it 2008-06-03 12:11:05 +03:00
Panu Matilainen 0863a4420b Use rpmsqIsCaught() instead of directly accessing rpmsqCaught sigset 2008-06-03 12:10:02 +03:00
Panu Matilainen cd040ba59b Add rpmsqIsCaught() for testing if a signal has been caught 2008-06-03 12:04:57 +03:00
Panu Matilainen df206dbaaf Unexpose signal queue and direct manipulation functions
- nothing outside rpmsq needs to fiddle with the queue directly
2008-06-03 11:44:20 +03:00
Panu Matilainen fe5ff47868 Don't leak memory on python fi.Digest() calls 2008-06-03 09:09:00 +03:00
Panu Matilainen d6380f029c Change rpmTagGetNames() interface to more like that of headerGet()
- instead of returning a newly allocated rpmtd, take container to use
  as argument
- return number of tags found, 0 on error (pretty arbitrary, just to
  return something...)
2008-06-02 16:10:19 +03:00
Panu Matilainen 6962b29bd9 Remove bogus comment on rpmDoDigest() ignoring algorithm 2008-06-02 13:05:46 +03:00
Panu Matilainen 4dee28ba4c Permit non-md5 digests on --fileid queries
- the used algorithm is not known at this point so we can only do some
  "seems to be in the ballbark" checks on the digest
- dynamically allocate memory for binary conversion as needed
2008-06-02 13:02:54 +03:00
Panu Matilainen 26dbd57da5 Check that digest type is actually supported before enabling it
- we don't necessarily support all types listed in pgpHashAlgo_e, it
  depends on what NSS happens to support
2008-06-02 12:20:22 +03:00
Panu Matilainen a8d8d5a4f4 Enable build-time configuration of non-MD5 file checksum digest algorithms
- if not specified (or 0), quietly assume MD5
- otherwise check for supported digest type, complain and fall back to
  md5 on invalid
- if non-md5 algorithm is used, add rpmlib() feature dependency to package
2008-06-02 12:18:23 +03:00
Panu Matilainen 2cbe2c3f5a Document rpmDigestLength() error behavior 2008-06-02 11:48:22 +03:00
Panu Matilainen acab1c3999 Eliminate ugly static conversion buffer on rpmdbAdd/Remove
- dynamically allocate on heap when hex to binary conversion is done,
  add new parameter to td2key() to communicate this back to caller
- adjust rpmdbAdd+Remove to free key data if signalled by td2key()
2008-06-02 10:53:38 +03:00
Panu Matilainen b8dea77988 Make rpmfiNew() use header specified file digest algo if present
- if not present or unknown algorithm specified, fall back to md5
2008-06-02 09:50:49 +03:00
Panu Matilainen a98970a41b Use RPMTAG_FILEDIGESTS instead of MD5S internally
- no functional changes
2008-06-02 09:50:49 +03:00
Panu Matilainen f788ab42eb Bring back RPMTAG_FILEDIGESTS now that we're a bit more ready for it
- this reverts commit 6db2a8ec03.
2008-06-02 09:50:49 +03:00
Panu Matilainen 05be2a2fdb We don't want per-file digest algorithms, just per package...
- rename RPMTAG_FILEDIGESTALGOS to RPMTAG_FILEDIGESTALGO
- change type from integer array to single integer value
2008-06-02 09:50:49 +03:00
Panu Matilainen b9c69d1bab rpmfiFDigestHex() instead of manual hex conversion
- showQueryPackage() and python rpmfi_Digest() at least..
2008-06-02 09:50:48 +03:00
Panu Matilainen 29bdb49f16 Add rpmfiFDigestHex() for converting the binary digest to hex
- conversion (back to) hex presentation is done manually in several places,
  might as well have a function to do it...
2008-06-02 09:50:48 +03:00
Panu Matilainen db573c81ed Mark rpmfiMD5() deprecated 2008-06-02 09:50:48 +03:00
Panu Matilainen e1724c3d4a On a second thought, rename rpmfiDigest() to rpmfiFDigest() for consistency
- it operates on current file of the set, not on the entire set so while
  changing API, name it similarly to other things that operate on current file
2008-06-02 09:50:48 +03:00
Panu Matilainen fad3c10b90 Add fi.Digest() method to python bindings
- use same code for creating the digest object on iteration and method call
- fi.MD5() left around as alias for fi.Digest(), dunno if that's the best
  thing to do but it's just a python string so returned size isn't that
  critical..
2008-06-02 09:50:48 +03:00
Panu Matilainen 55d5c49736 Convert showQueryPackage() to use rpmfiDigest() 2008-06-02 09:50:48 +03:00
Panu Matilainen 7b696eb1a9 Make rpmVerifyFile() honor rpmfi digest algorithm 2008-06-02 09:50:48 +03:00
Panu Matilainen a1e49ce26b Use new style headerGet() + rpmtd iteration for rpmfi digest population 2008-06-02 09:50:48 +03:00
Panu Matilainen ae5667cf06 Lose unused fdigests array from rpmfi struct
- only used in rpmfiNew() where it's converted to binary from the header
  hex presentation and free'd immediately, a local variable will do just as
  well
- some useless references in fsm and psm, kill'em too
2008-06-02 09:50:48 +03:00
Panu Matilainen ea134adf81 Make handleOverlappedFiles() honor rpmfi digest algorithm 2008-06-02 09:50:48 +03:00
Panu Matilainen 4aa7ab6422 Teach fsm internals to honor rpmfi digest type 2008-06-02 09:50:48 +03:00
Panu Matilainen b851f93fc6 Make rpmfiDecideFate() honor rpmfi digest algorithms
- this gets into trouble if digest algorithm differs between packages,
  can't be helped (same is true of rpmfiCompare() too)
2008-06-02 09:50:48 +03:00
Panu Matilainen 5046e63f27 Make rpmfiConfigConflict() honor fi digest algorithm 2008-06-02 09:50:48 +03:00
Panu Matilainen db4d3ea255 Make rpmfiCompare() use rpmfiDigest() instead of rpmfiMD5() 2008-06-02 09:50:48 +03:00
Panu Matilainen 4c4c6d0423 Make rpmfi initialization honor used digest length 2008-06-02 09:50:48 +03:00
Panu Matilainen 95e65d98ea More preliminaries for non-md5 file checksums
- add rpmfiDigest() method (similar to one in rpm5.org) for retrieving
  file digest, algorithm and digest size
- make rpmfiMD5() just a special case of rpmfiDigest()
2008-06-02 09:50:48 +03:00
Panu Matilainen 479b74bebe Rename rpmfi internals to talk about digest rather than md5
- no functional changes
2008-06-02 09:50:48 +03:00
Panu Matilainen f771b641d3 Rename rpmfi and fsm checksum md5-sum fields to refer to digest
- no functional changes
- groundwork for supporting other than md5 checksums
2008-06-02 09:50:48 +03:00
Panu Matilainen beb573c2a0 Unbreak handling of packages without epoch
- rpmtdToString() returned NULL on empty data, rpmtdFormat() returns
  (unknown type) which isn't exactly appropriate value for epoch...
2008-06-02 09:48:41 +03:00
Panu Matilainen 27855634e9 More generic iterators replaced with safer string iterators
- additionally ensure rasprintf() will never get passed NULL where string
  is expected in doScriptExec()
2008-05-31 13:28:05 +03:00
Panu Matilainen c275732c75 Use safer per-datatype iterator instead of generic one 2008-05-31 13:20:21 +03:00
Panu Matilainen 4bf224c0c9 Replace couple of generic td iterators with safer string iteration 2008-05-31 13:18:19 +03:00
Jindrich Novy 784fe494b7 Make Group: tag not mandatory in spec 2008-05-29 09:48:16 +02:00
Panu Matilainen 903c5d9fec Move key size fixups from rpmdbAdd & Remove to td2key() 2008-05-28 09:53:30 +03:00