Commit Graph

192 Commits

Author SHA1 Message Date
Panu Matilainen fbb44eb66d And finally, permit --hash and --percent cli-switches on erasures too 2012-01-05 16:28:18 +02:00
Panu Matilainen 75cea7a534 Make --pipe command failures reflect our exit codes (RhBug:735481) 2011-09-05 08:38:31 +03:00
Panu Matilainen 306c23ee49 Fix the sanity check on number of query/verify sources (RhBug:691930)
- Prior to commit 2e672f3fae, the
  callback would get called twice for every option so the expected
  number of query/verify sources was doubled. Now the numbers
  match with reality, adjust the check.
2011-07-13 13:56:15 +03:00
Panu Matilainen 5b2c322887 Eliminate dead NULL-assignments at scope-end in main cli utils 2011-05-30 09:36:03 +03:00
Panu Matilainen 5bd382f3a3 Remove no longer relevant references to build from arg sanity checks 2010-11-15 10:48:33 +02:00
Panu Matilainen ac0c2cd71f Eliminate pointless argument sanity check
- --root is valid for all the remaining modes, no point checking for it
- MODES_FOR_DBPATH is completely unused (and dbpath is a common option
  to all anyway)
2010-11-15 10:05:18 +02:00
Panu Matilainen 3ce48d0306 Remove unnecessary includes 2010-11-15 09:17:25 +02:00
Panu Matilainen 26125015e4 Further split the cli-tools to rpminstall, rpmquery and rpmverify
- Installing/erasing packages, querying and verifying require different
  amount of privileges on the system. Having separate binaries for
  these functionalities permits limiting the capabilities through
  SELinux and other similar security mechanisms: for example quering
  needs much less privileges than installing.
- For now, leaving /bin/rpm to be the Swiss Army knife it
  always was: capable of install/erase, query and verify. Eventually
  it should be turned into just a dumb wrapper which just execs
  the per-functionality binaries, but leaving that for later stage,
  as popt exec/aliasing doesn't quite seem to up to par with the task.
  Having the separate binaries available at least makes it possible
  for callers to specify the amount of privileges they need.
2010-10-08 12:29:59 +03:00
Panu Matilainen e8a1f5da3e Lift specfile query out of main rpm(query) into separate binary
- Avoids having to link /bin/rpm with librpmbuild and everything it
  might bring in (eg libmagic) which are not needed for core operation.
- Minimally preserve backwards compatibility with popt exec alias
2010-10-04 14:31:55 +03:00
Panu Matilainen 9f68c7958f Rip IAM_RPMDB, ie --initdb, --rebuilddb etc modes out of rpmqv.c and librpm
- Add popt exec aliases to rpmdb for backwards compatibility
- Change test-suite to use 'rpmdb --initdb' instead of 'rpm --initdb'
  as popt exec aliases with absolute paths dont play very well
  with the test-suite, duh...
2010-09-03 17:13:10 +03:00
Panu Matilainen 3cbda9c03f Rip IAM_RPMK, ie --import and --checksig modes out of rpmqv.c + librpm
- Add popt exec aliases to rpmkeys for backwards compatibility
2010-09-03 16:32:43 +03:00
Panu Matilainen b195048bbb Further simplify rpmcliVerifySignatures()
- Since this is a rpmcliFoo() function, we can assume rpmcliInit()
  is used and the verify disabling bits are set through the common
  rpmcliQueryFlags set, making qva argument unnecessary.
2010-09-03 15:57:14 +03:00
Panu Matilainen c382cd5373 Rrrriiip the addsign/resign/delsign bits out of rpmqv.c + friends
- Add popt exec aliases to rpmsign for backwards compatibility (dejavu...)
2010-09-03 15:12:12 +03:00
Panu Matilainen 8f75ac30fb Lookup signature type from cli utility already
- Avoid relying on the murky rpmLookupSignatureType() foobar on
  low API level, pass the wanted tag explicitly from caller
- rpmLookupSignature(), rpmGetPassPhrase() + the bits they rely on
  are now free of users within librpm itself
2010-09-03 14:23:55 +03:00
Panu Matilainen 00c72fda89 rpmcliSign() only creates or deletes signatures
- Lose the "this has got something to do with signatures and stuff"
  dispatcher mode, rpmcliSign() now only does what it says. It also
  doesn't need transaction set for anything. It doesn't need much
  else than files to operate on, what to do and possibly a passphrase.
  It probably will need more when rpmLookupSignatureType()
  is put out of its misery, but this'll do for now.
- Lose the now unnecessary passPhrase member from QVA_t
2010-09-03 12:30:57 +03:00
Panu Matilainen e95e558ad2 Use rpmcliVerifySignatures() directly from rpmqv.c main 2010-09-03 10:54:09 +03:00
Panu Matilainen fe57228ce1 Use rpmcliImportPubkeys() for importing instead of rpmcliSign()
- Add some more IamYourDaddy modes to rpmqv.c for now. We'll need to
  add junk to get rid of others, sigh...
2010-09-03 10:52:13 +03:00
Panu Matilainen 9d2ad1e4f4 Remove hysterically useless RPMSIGN_NONE + --sign popt leftovers 2010-09-03 10:51:52 +03:00
Panu Matilainen a68bcb383e Use the common rpmcliQueryFlags for signature verify options in rpm cli too
- Technically this changes the rpmcliQuery() and rpmcliVerify() API
  in the sense that we no longer honor the qva->qva_flags for the
  --nosignature and others, but we assume anybody using these (as if
  anybody was using the "cli" API) uses rpmcliInit() which takes
  care of these common bits... shrug.
- Ditch ancient and hidden --nopgp --nogpg switches along with the
  dishwater which are simply alias to --nosignature.
- Eliminate now unused qva_flags from rpmInstallArguments (along with
  a double vsflags goo from rpmgraph)
2010-09-03 10:50:37 +03:00
Panu Matilainen 1d7f4dd6ed Remove ancient autohelp-handling related leftovers 2010-08-24 11:40:25 +03:00
Panu Matilainen fbd92df754 Argh. Realize we already have equivalents of initCli() and finishCli()
- rpmcliInit() and rpmcliFini() do almost exactly the same as our
  newborn cli-helpers, but they've been almost unused until now.
  Use them and lose the new ones.. doh.
- The downside is that popt aliases are now broken when running commands
  from the build tree due to lt-foo in argv[0], whereas initCli() took
  and explicit popt context name argument. Oh well...
- rpmcliFini() was missing several necessary memory cleanup calls,
  add them there while at it.
2010-08-20 15:23:48 +03:00
Panu Matilainen 3c5c19747b Kludge to get rid of ugly lone --quiet on usage message 2010-08-20 14:31:16 +03:00
Panu Matilainen 2c2faa299e Move --pipe handling to cliutils helpers 2010-08-20 13:52:47 +03:00
Panu Matilainen d391d5ec60 Oops, fallout from commit 5fe63cd8e0 2010-08-20 13:50:53 +03:00
Panu Matilainen 03a8511e3b Lump much of the common cli-init + finish tasks into cliutils helpers 2010-08-20 13:50:48 +03:00
Panu Matilainen b217529967 Add a convenience library for stuff common cli-bits into 2010-08-20 13:49:18 +03:00
Panu Matilainen 04b1816f00 If MiNT can't cope, frankly my dear, I dont give a damn 2010-08-20 13:48:42 +03:00
Panu Matilainen a3795d0dc2 Simplify --root argument checking
- We haven't accepted url's in as root since ages, wipe out the goo
2010-08-20 10:57:35 +03:00
Panu Matilainen 5fe63cd8e0 Chainsaw the now unused #ifdef'ed parts out of rpmqv.c and rpmbuild.c 2010-08-20 10:57:20 +03:00
Michal Schmidt 7583fcc341 Allow '--short-circuit' for '-bb'
This patch allows short-circuiting of building binary packages. To
prevent accidental use of short-circuited rpms, they are marked with
an unsatisfiable dependency "rpmlib(ShortCircuited)". A developer using
this feature for local development and testing will use "--nodeps".
Should such a rpm leak into the world, users will quickly notice
it does not install by default.

(v3: avoids API change, suggested by Panu Matilainen.
 v2: added poisoning with unsatisfiable dependency.)

Michal
2010-06-23 16:06:43 +03:00
Panu Matilainen 367c0d7014 Eliminate hysterical --hdlist query option and everything implementing it
- This hidden gem used "system hdlist", ie "/usr/share/comps/%{_arch}/hdlist
  as the source for queries. Such "system hdlist" hasn't existed anywhere
  since RHL 9/FC 1 times...
2010-03-19 16:54:00 +02:00
Panu Matilainen d87d831cdf Eliminate --wtfwalk .. err, --ftswalk and everything implementing it
- that's what find + xargs are for, this is just useless cruft
2010-03-19 16:52:19 +02:00
Florian Festi 51c96db046 Kill RPMTAG_FSNAMES and RPMTAG_FSSIZES and everything implementing them 2010-02-03 16:27:00 +01:00
Panu Matilainen e10e807ce9 Move <mcheck.h> include out of system.h to the couple of places that care
- only two real users inside rpm
- remove mcheck foo from rpminject and rpmsort, we're not interested...
2010-01-05 12:36:37 +02:00
Panu Matilainen 2c6120755c Unconditionally include <sys/wait.h> where needed
- no point conditionalizing what we cant live without
2010-01-05 12:35:54 +02:00
Panu Matilainen 475ba2111f Add noreturn annotations to argerror() helper functions 2009-09-07 15:52:36 +03:00
Panu Matilainen 555af4eadb Replace equal/not equal uses of str[n]cmp() with rstreq[n] in binaries 2009-08-31 13:04:17 +03:00
Panu Matilainen 64280efc1e Put the PGP foobar signature generation out of its misery
- the last freeware PGP version (6.5.8) is from year 2000 and doesn't
  come close to compiling on modern distros, commercial versions we're
  not interested in
- "PGP" signatures in rpm mean RSA, gpg can handle that just fine since
  forever
- the code's been unused for years, unlikely to be functional anyway...
2009-03-26 09:59:01 +02:00
Panu Matilainen 2e672f3fae Show query/verify selection options just once in --help 2009-03-19 16:07:18 +02:00
Jindrich Novy 7acdfded4a Add md5->filedigest aliases (rhbz#487597)
- add %verify(nofiledigest) as %verify(nomd5) file attribute alias
- reference digests as digests not checksums
- make old md5 related symbols obsolete and use newer reference
- update man page accordingly
2009-02-27 14:34:39 +01:00
Rakesh Pandit 430b8cc377 -Use installInterfaceFlags in place of eraseInterfaceFlags. -Moved transaction part from rpmInstall and rpmErase to rpmcliTransaction. 2009-02-16 09:27:58 +02:00
Panu Matilainen e0f57801c0 Permit --noscripts on verify (to disable %verifyscript execution)
- this used to work but got broken by the rpmi/rpmq/... unification
2008-12-18 09:51:37 +02:00
Panu Matilainen 0372f7d8b4 Read default popt aliases again (rhbz#473167)
- makes testsuite depend on local aliases but using default popt config
  is widely documented and needs to work, testsuite needs a better method
  of disabling it if necessary
2008-11-29 14:34:01 +02:00
Panu Matilainen 43b08986a8 Use rpmConfigDir() for finding our popt alias file
- this allows popt aliases to be reliably available in tests
- why do we have the popt initialization done twice?
2008-11-22 18:08:40 +02:00
Panu Matilainen 997f5a24c5 Force "rpm" popt context for everything but build
- we want the same set of aliases to be seen no matter what name we're
  invoked with, except for build which has it's own set of aliases
- this has a nice little side-effect of permitting popt aliases to work
  from source tree on non-static builds despite libtool calling executables
  lt-something instead of their real names
2008-06-25 09:40:04 +03:00
Panu Matilainen cb17fb722c Eliminate rpmd, rpmi, rpmk, rpmq "helper binaries"
- it's all rolled into "rpm" itself, these are just clutter and complicate
  things needlessly
- leave symlinks to rpmquery, rpmverify, rpmsign and rpmdb -> rpm to
  preserve some compatibility (at least rpmquery is known to be used
  in scripts)
2008-06-25 09:40:04 +03:00
Panu Matilainen 6f06fff348 Eliminate the pointless rpmb + rpmt symlinkery
- just build "rpmbuild" executable and install to bindir instead of
  mucking with several different names
2008-06-24 11:08:05 +03:00
Panu Matilainen 961b6c4b2f Check for pipe() return code on --pipe 2008-05-05 07:37:50 +03:00
Panu Matilainen 3e6009a744 Ensure default SIGPIPE handler for --pipe (rhbz#444389) 2008-05-02 11:40:29 +03:00
Panu Matilainen c29adcee80 ARGV_t const pendantry
- const on typedef'ed ARGV_t doesn't mean a thing, add a new,
  (exec* compatible) ARGV_const_t and use where appropriate consistently in
  argv.h, rpmcli.h etc
- popt's argv const is the wrong way around for exec() family, add explicit
  ARGV_t casts on popGetArgs() uses where needed
- compiler silence, aaahh...
2008-04-07 12:19:58 +03:00