Commit Graph

12865 Commits

Author SHA1 Message Date
Panu Matilainen e49c51e451 Eliminate unused spec argument from parseExpressionBoolean()
- Its never been used beyond assignment to the internal state struct,
  so in reality this is entirely free of any rpmbuild-specifics.
  Meaning we could trivially lift it to librpmio for macros...
- No functional changes here
2014-07-10 13:55:28 +03:00
Panu Matilainen e6ea36806b Add testcase for basic trigger behavior 2014-07-09 16:08:29 +03:00
Florian Festi 90b821df89 Make package dependencies an array 2014-07-08 15:42:54 +02:00
Florian Festi 98a73b7ce0 Add weak deps to the dependency generators 2014-07-08 15:42:54 +02:00
Florian Festi 11a8af9c07 Make calling the dependency generators more generic 2014-07-08 15:42:54 +02:00
Florian Festi a357c99c58 Do not write the dependencies to the header instantly.
Add the dependencies generated from the files to the package and write them to the header at the end.
2014-07-08 15:42:54 +02:00
Florian Festi 400834a731 Redo addReqProv to no longer deal with all tags explictly 2014-07-08 15:42:42 +02:00
Florian Festi c08796791e Add packageDependencies() to allow accesing the rpmds by name tag 2014-07-08 15:28:05 +02:00
Florian Festi 1ba4a76a54 Add rpmdsDToTagN() to convert single char endocding used by the dependency generators to tags 2014-07-08 15:28:05 +02:00
Florian Festi 2e9864752d Add rpmdsD for getting the one char abbreviation for dependency types 2014-07-08 15:28:05 +02:00
Florian Festi 39382b5675 Add tagNToChar() to convert tag values to single char encoding.
Used by rpmdsDNEVR fixing the problem of multiple tags starting with the same character. The characters match the ones used in the dependecy dependency generators during build.
2014-07-08 15:28:05 +02:00
Florian Festi 9209165c67 Add rpmSanitizeDSFlags() function
to centralize this code and remove it from the build code
2014-07-08 15:27:41 +02:00
Lubos Kardos 899d602616 addReqProv() and handleOneTrigger() now use rpmds with trigger indices. 2014-07-08 11:49:46 +02:00
Lubos Kardos 06122bc1a4 Now it is possible to save trigger index in rpmds.
This enables to handle trigger rpmds in the same way as normal
rpmds. Merging of rpmds takes into account trigger indices if
they are set and rpmdsPutToHeader()/rpmdsNewPool() puts/gets
trigger indices into/from header if resulting rpmds is trigger
rpmds.
2014-07-08 11:49:46 +02:00
Panu Matilainen cbbfe6388a Fix VFP/Neon detection on armv7
- VFPv3D16 is a specific type of VFP, which AIUI is never a NEON,
  so the test made little sense and, AIUI did not work at all, at
  least for detecting NEON-class system.
  Test for generic VFPv3 support instead (although this doesn't likely
  make a whole lot of sense as AIUI all ARMv7 systems are supposed
  to come with VFPv3 level VFP but guess it doesn't hurt either...)
- The local define for HWCAP_ARM_VFPv3D16 from commit
  5a04330db8 was wrong, (1 << 13) is
  actually HWCAP_ARM_VFPv3. Which is of course exactly what we want here,
  but the commit looks fishy because of this.
- This is all just sooooo wonderfully arbitrary...
2014-07-03 18:11:04 +03:00
Panu Matilainen 43c4478d6c Add testcase for db iterator wildcard matching 2014-07-03 13:41:03 +03:00
Panu Matilainen 708fb8c35e Fix db iterator pattern matching (RhBug:1115824)
- Should've been in / Fixes a regression introduced in (pick your favorite)
  commit bc871e8fea
2014-07-03 13:31:34 +03:00
Panu Matilainen d4ab1d82d7 Macro-expand %{load:...} argument to make the thing more useful... 2014-07-01 12:05:51 +03:00
Panu Matilainen 7f88d79dbe Add test for multiple hardlink groups, ie previous commit 2014-06-30 15:18:22 +03:00
Florian Festi b7b8b3343f Fix handling of hardlinks during rpmbuild
After looping over the hardlinks and writing their headers entries to the
archive we need to return to the first entry to make sure we do not leave out
other groups of hardlinked files that start between the group we are currently
processing
2014-06-30 13:30:38 +02:00
Panu Matilainen 2273916148 Shut up bogus warning about possible uninitialized use
- The way manageFile() is called, fmode can never be uninitialized
  but lets make gcc happy by adding a default case to the switch...
- Additionally make fmode const because it is
2014-06-30 11:20:19 +03:00
Panu Matilainen e48ac41ebb Oops, add missing files from commit e4d1b7722a 2014-06-27 15:36:36 +03:00
Panu Matilainen b52b5b98f2 Only test for ARM FPU on -mfloat-abi=hard builds
- If you dont know, you'll want to keep it that way.
  However if you know this is wrong, let me know...
- If you're still reading, the point here is supposed to be that on ARM
  there are systems with and without a hardware FPU, and then bazillion
  different ABIs which might or might not have to do with the FPU and its
  calling conventions. On any sane system this would be communicated runtime
  via hwcaps but this is ARM so what did you expect? Apparently there is
  a way to get that during runtime by parsing the ELF headers of
  /proc/self/exe but I'll leave that exercise to somebody else. So...
  we only enable the FPU capability tests which determine the arm
  architecture level when we're being compiled to -mfloat-abi=hard.
- If this all sounds crazy and convoluted, I agree. Its also entirely
  possible I've misunderstood some/all of this, uh, subtlety, so dont
  take my word for it. What do I know, I only work here.
- GCC apparently also got this wrong initially, AIUI this
  only works reliably on gcc < 4.5 which dont support hw floating point
  at all, and gcc >= 4.6 where __ARM_PCS_VFP is reliably defined when
  appropriate.
- If you're STILL reading, this glorious one-liner is supposed to
  replace the arch-dependent patch application of the kind of ARM
  detection logic added in commit 2d67ca74c9
2014-06-27 12:29:57 +03:00
Panu Matilainen fd3549fef0 Add detection for Sparc Niagara (aka sun4v, aka sparcv9v / sparc64v)
- Loosely based on similar patch in Fedora, but use hwcap instead
  of parsing /proc/cpuinfo. Untested but hey, its only hardware
  detection. What could possibly go wrong?
2014-06-27 10:57:53 +03:00
Panu Matilainen 5a04330db8 Add copies for the hwcap bits we need in case not present in auxv.h 2014-06-27 10:35:21 +03:00
Lubomir Rintel 2d67ca74c9 Detect arm armv6hl, armv7hl and armv7hnl machines
Read presence of relevant extensions from hwcap. Loosely based on what's
currently in use for Fedora (armv7hl) and Pidora (armv6hl).

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-06-27 10:26:06 +03:00
Panu Matilainen f8868f11d7 Check for sys/auxv.h header, always include if present
- We'll need this to access any HWCAP_* bits for platforms that need it,
  regardless of whether getauxval() is present or not. On glibc
  systems this is likely to be equivalent, on others dunno (Solaris
  appears to have sys/auxv.h header as well)
2014-06-27 10:24:07 +03:00
Panu Matilainen a69d5b5a1b Change snapshot tarball versioning to use '-' instead of '.'
- ...just to be avoid having to fiddle with separators when going
  from snapshots to -beta, -rc etc...
2014-06-26 15:56:14 +03:00
Panu Matilainen e4d1b7722a Update translations from Transifex, including two new ones 2014-06-25 13:39:47 +03:00
Panu Matilainen aa2765a872 Bump library versions to match reality
- Rpm 4.11.2 is at 5:1:2. We've tonne of new APIs but none removed
  or changed incompatibly (I think, knock wood...) so no need
  for full soname bump, this brings us to libtool version 6:0:3
  in preparation for rpm 4.12
2014-06-25 13:34:34 +03:00
Panu Matilainen 3f2f483515 Use unified libtool version for all our libraries
- Our libraries are in reality so interdependent that its not even
  possible to use them independently of others, so having them
  all follow sort of independent versioning information just doesn't
  make any sense and is a PITA everytime I need to touch the data.
- This causes librpmsign soname bump with no good reason so its
  probably "evil" and all ... so sue me, its not as if anybody
  is actually using this library outside rpm itself.
2014-06-25 13:21:00 +03:00
Panu Matilainen 817959609b Handle line continuation in grabArgs() (related to RhBug:1045723)
- Commit 1bdcd05008 to fix RhBug:1045723
  broke some funky java macros in Fedora which include line continuation
  in the argument (comments 6-7 in the bug). That it ever worked seems
  far more like luck than by design but since this seems to fix it...
2014-06-25 11:32:24 +03:00
Panu Matilainen 454285b3a2 Add disabler flag + --noplugins cli switch for plugins
- Always knew we'd need a plugin disabler flag sooner than later but
  didn't realize enabled plugins would fail basically the entire
  test-suite :)
- Enable --noplugins for entire test-suite for now, but eventually
  we'll need to come up with ways to test plugins as well
2014-06-24 15:14:35 +03:00
Panu Matilainen d8ebc90e64 Initialize plugins based on DSO discovery
- %__transaction_plugins style configuration is problematic for plugins
  because we want plugins to be, well, pluggable. As in drop-in to
  enable, which is not achievable with a single macro entry. Look up
  all DSO's from the plugin dir and enable if a matching
  %__transaction_foo macro is defined.
- This isn't optimal but it'll buy us the drop-in capability, which
  is what matters most right now. We'll want to have forcability as
  well later on (ie it should be possible to require given plugins
  to be present)
2014-06-24 14:46:37 +03:00
Panu Matilainen 713914bde1 Drop the experimental collection support
- The basic concept is not without merit but what was implemented here
  has been stuck in experimental state in middle of two sorta conflicting
  goals for four years now, and world has moved onward in the meanwhile.
  The sepolicy part is better handled in the new selinux plugin, and other
  action business belongs to packages (in the form of some trigger-like
  scripts or such) rather than rpm plugins.
- Deleted here, but the sepolicy plugin functionality still needs
  merging into the new selinux plugin...
- RPMTAG_COLLECTIONS left in place but tagged unimplemented as per policy
  to never actually remove tags
2014-06-17 16:27:24 +03:00
Panu Matilainen cc512d188d Fix libtool dependency generation with libtool >= 2.4.2
- libtool string change broke our scripts and nobody noticed for
  a long time... Related to RhBug:1061619.
2014-06-16 12:19:06 +03:00
Panu Matilainen eb62542695 Fix ancient buffer overflow on unterminated macro options
- Test for terminating ')' existence before copying, otherwise we'll
  end up walking over the edge of the world.
- Return address from doDefine() on error will likely differ after
  this, whether that actually affects anything remains to be seen...
2014-06-11 15:40:00 +03:00
Panu Matilainen 272033470b Avoid pointless large stack alloction (RhBug:1106594)
- Within rpm itself, this allocation from 12 years ago doesn't come anywhere
  close to stack limits on Linux at least, but since we're a library
  we should be considerate to API users stack needs as well. Allocate
  the buffer from heap instead, its not performance critical either
  since this will always be limited by physical IO and digest calculation
  speed rather than a single malloc.
2014-06-11 13:16:06 +03:00
Panu Matilainen 4089316531 Fix ancient buffer overflows on macro define and undefine (RhBug:1087000)
- Both doDefine() and doUndefine() assumed the macro string would
  always fit into MACROBUFSIZ, which of course is true for any
  normal use but we cant make such assumptions.
- In the case of %define/%global there are various other overrun-issues
  that need further changes to fix.
2014-06-09 14:35:19 +03:00
Panu Matilainen 348eea3a41 Try to cope with duplicate id's and names in verification (ticket #872)
- When duplicate user/groupnames or UID/GIDs are present, data can be
  inconsistent depending on which way the id/name lookup is done.
  Reporting an error when neither the file ownership or the related
  user/group entry was changed on the system seems wrong, so try
  to do better... Look up the data both ways and only fail the
  verification if data from both is wrong, but warn about duplicates
  on inconsistent results.
2014-06-06 12:50:31 +03:00
Panu Matilainen 79fbedea94 Export header magic in python module as rpm.header_magic bytes object 2014-06-05 07:28:24 +03:00
Lubos Kardos 4baa1f3936 "rpmkey -K" didn't show error message in case of malformed signature
- Fixes regression from commit 8cbc1bd929

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-06-04 11:11:35 +03:00
Lubos Kardos 8090b1466d Error message with wrong filename was showed in case of error.
This was caused by commit 90833a57c5.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-27 12:08:16 +03:00
Lubos Kardos 1a8a5bade3 rpmSign() always returned -1 if signatures was inserted into original rpm
- This was caused by commit 90833a57c5 but
  because of another problem fixed in previous commit it didn't exhibit.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-27 12:08:15 +03:00
Lubos Kardos e1fd794253 rpmSign() returned value 0 (success) in case of failure
- Fixes regression from commit c0aad81e9b.
- That commit added line "res = replaceSignature(...)" that sets variable
  "res" to value 0. But error handling code following this line expects
  this variable set to -1. So in case of error value 0 (success) was
  returned but value -1 (failure) should have been returned.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-27 12:08:15 +03:00
Trần Ngọc Quân 9e651c7292 l10n: vi.po (759t): Init Vietnamese translation
* Init then translate all strings
  * Add vi to LINGUAS

Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-21 13:08:13 +03:00
Lubos Kardos 90833a57c5 Reserve space for gpg signature during building of package.
- During building of a package a dummy tag is added to the signature
header. This tag reserves some space for gpg signatures. So during
signing of the package the gpg signatures can be put in this reserved
space and it is not necessary to rewrite the whole package to make some
space for gpg signatures.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-21 13:02:44 +03:00
Lubos Kardos 75f7b0dcfa Function manageFile was modified to support also "r+.ufdio" mode.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-21 13:02:17 +03:00
Lubos Kardos 1aace27fb9 Passing data to sign to the gpg program by a pipe.
- This change shorten signing time beacause it is not necessary to
write data that should be signed, into a temporary file and then pass
this file to gpg program.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-21 10:47:41 +03:00
Lubos Kardos 17ad1fb27b Removed now unused internal helper functions.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-21 10:46:26 +03:00