summaryrefslogtreecommitdiff
path: root/rpmpopt.in
Commit message (Collapse)AuthorAgeFilesLines
* Reimplement --restore as a transaction element, obsolete --setperms & coPanu Matilainen2022-02-031-30/+4
| | | | | | | | | | | | | | | | | | | | | | | --setperms, --setugids and --setcaps were fun demos of alias capabilities in the nineties, but they can be downright dangerous when used separately, are blisfully unaware of all state in rpm yet try to duplicate functionality existing in C, and thus are a constant source of bugs that are between hard to impossible to fix in the alias space. Add a new transaction element type for the restore operation, wire through all the necessary places. In places (like ordering) this is an overkill but otherwise it seems like a natural thing to be able to process restore alongside package install/remove. The restore operation is a cross between install and erase codepath-wise so touches some funny places, but FA_TOUCH does just the thing, and now all the regular disablers like --nocontext and --nocaps can be used if necessary, plugins get to do their work and also timestamps are restored. Remove the dangerous shell implementations of things and just make them aliases to --restore. Fixes: #965
* Skip recorded symlinks in --setperms (RhBug:1900662)Michal Domonkos2022-01-211-0/+1
| | | | | | | | | | | | | | | | | | | If a package contains a symlink in the buildroot which is declared as a ghost or config file but is a regular file or directory on the system where it's installed, a --setperms call will reset its permissions to those of a symlink (777 on Linux), which almost certainly is not the correct thing to do. To fix that, just skip files that were recorded as symlinks. This is a special case of a general issue in --setperms; since file permission semantics may change depending on the file type, to stay on the safe side, any (ghost or config) file whose type changes after installation should probably be skipped. However, symlinks are the most prominent case here, so let's just focus on that now and avoid adding too much cleverness to a popt alias (this got us into trouble not too long ago, see commits 38c2f6e and 0d83637). We may revisit this in the eventual C implementation.
* Remove --sign from rpmbuildFlorian Festi2020-01-311-4/+3
| | | | | | | | | | | | When splitting rpmsign from rpmbuild this command line parameter was kept as an popt alias. But this limits what other parameter can be passed to the rpmsign command in a difficult to understand way. In the end everyone is better off using the rpmsign command directly. Issue a error message stating the parameter is no longer supported and exit rpmbuild. Resolves: #153
* Add all of the rpmbuild macro aliases to rpmspec as wellPeter Jones2019-09-231-4/+21
| | | | | | | | | | | This adds all of the rpmbuild popt aliases that expand to defines to rpmspec as well. It also changes --trace to include --POPTdesc argument help. [v2: fix an error that broke rpmbuild --trace] Signed-off-by: Peter Jones <pjones@redhat.com>
* Add --scm option for %autosetup SCM selectionAndreas Scherer2018-11-051-0/+3
| | | | | Allow selecting %autosetup SCM backend from cli in case it's not hardwired in the spec, handy for eg rediffing patches.
* rpmpopt: make query info command display DistTag if it is non-nullVladimir D. Seleznev2018-11-051-0/+1
| | | | | | | | In ALT there can be different builds of the same NEVR which only differ in DistTag, so it is useful to print its value as part of package information. Signed-off-by: Vladimir D. Seleznev <vseleznv@altlinux.org>
* Remove capabilities instead of setting empty caps via. --setcapsMarkus Linnala2018-11-051-2/+7
| | | | | | | | | | | | | | | | | | | If a file in a package does not have any capabilities rpm --setcaps should remove capabilities of the file. Prior to this patch capabilities of the file were set as empty. Empty capabilities mean more than no capabilities. A file with no capabilities can inherit capabilities, but file with empty capabilities can not. When ever package does not have any capabilities set %|FILECAPS? is false. If some files have capabilities, %|FILECAPS? is true but %{FILECAPS} is '' when the file does not have capabilities and '= <capstring>' when there is some. Reported and patch created by Markus Linnala Commit message edited by Pavlina Moravcova Varekova and Florian Festi. Fixes #585 Fixes #586
* Fix nasty --setperms/--setugids regression in 4.14.2 (RhBug: 1640470)Panu Matilainen2018-10-221-2/+2
| | | | | | | | | | | | | | | | | | | | Commit 38c2f6e160d5ed3e9c3a266139c7eb2632724c15 causes --setperms and --setugids follow symlinks instead of skipping them. In case of --setperms, all encountered symlinks will have their target file/directory permissions set to the 0777 of the link itself (so world writable etc but suid/sgid stripped), temporarily or permanently, depending on whether the symlink occurs before or after it's target in the package file list. When the link occurs before its target, there's a short window where the target is world writable before having it's permissions reset to original, making it particularly bad for suid/sgid binaries. --setugids is similarly affected with link targets owner/group changing to that of the symlink. Add missing parentheses to the conditions introduced in commit 38c2f6e160d5ed3e9c3a266139c7eb2632724c15 to fix. Reported by Karel Srot, patch by Pavlina Moravcova Varekova.
* Skip showing empty Relocations line in rpm -qiZbigniew Jędrzejewski-Szmek2018-08-241-1/+1
| | | | | | Almost nobody uses them, so the "Relocations : (not relocatable)" line is a waste of screen estate. Just output the line if there's something interesting to show.
* Add shortcut to --nodebuginfoFilipe Brandenburger2018-08-201-0/+2
| | | | | | | | | | | | | | Currenlty, the incantation to skip creating debuginfo RPMs is: $ rpmbuild -ba --define "debug_package %{nil}" hello.spec Which looks ad-hoc and always requires me to go back and check my notes... This commit adds a shortcut by making it possible to run: $ rpmbuild -ba --nodebuginfo hello.spec Also add test coverage for the new feature.
* Bring ftp/http documentation up to date, eliminate leftovers (#521)Panu Matilainen2018-08-201-7/+1
| | | | | | | | %_ftpport and %_ftpproxy have been unused since 2007 or so, and the cli options --ftpport and --ftpproxy have been pointing to http proxy, but ftp- and http-proxy is not interchangable. Eliminate the broken options, http-proxy settings are used for everything. Update the manual accordingly, claryifying a few things on the way.
* Remove misleading --setperms and --setugids warnings (RhBug: 1538610)Pavlina Moravcova Varekova2018-06-281-3/+7
| | | | | Non-existent %ghost or %missingok files should not cause warnings generated by rpm --setperms or rpm --setugids.
* Add popt-based options --setcaps and --restore (RhBug:1550745)Pavlina Moravcova Varekova2018-04-241-0/+12
| | | | | | | | | | | | | | | --setcaps resets capabilities of package files. Because the opotion is popt-based it has some drawbacks - it does not know about %ghost files, file states, etc. --restore regenerate owner, group, permissions and capabilities of package files. It uses 3 already defined options in the correct order. rpm --setugids is used first of all, because it may change permissions or capabilities. rpm --setperms is used before rpm --setcaps, but the opposite order is right too.
* Make coloring of output configurableFlorian Festi2017-08-091-0/+2
| | | | Default is never to keep old behaviour
* Add --trace macros to enable %trace on the command line.Peter Jones2017-02-241-0/+6
| | | | | | | | This allows you to do 'rpmspec --trace -P foo.spec", which is much more natural than editing the .spec itself to add %trace, and much more convenient than using --eval yourself. Signed-off-by: Peter Jones <pjones@redhat.com>
* Add --changes to read changelog with full timestampsNeal Gompa (ニール・ゴンパ)2016-10-211-0/+3
| | | | | | As of 57f94a582602f0353cdb17a02dc12c4461d4f32d, it's now possible to have proper changelogs with dates and times properly set. Thus, it makes sense to offer an option to render this information.
* Make help strings a bit nicerFlorian Festi2016-04-121-4/+4
|
* Remove obsolete --fscontext popt aliasFlorian Festi2016-04-121-4/+0
|
* alias -P on --providesThierry Vignaud2016-01-281-0/+1
| | | | let's make it symetric/constistent with -R/--requires
* Add file signature support to rpmsign commandfin@linux.vnet.ibm.com2015-08-121-0/+1
| | | | | | | | | | | | | | | | | | | | | This patch extends the rpmsign tool to sign package files. It defines a new rpmsign option called "signfiles". rpm --addsign [--signfiles] PACKAGE Signfiles signs all the file digests included in the package and stores the signatures in the package header. The file signing key, used to sign the file digests, can be provided one the command line with --fskpath or in a macro file with %_file_signing_key. After including file signatures, the package is signed normally. The package needs to be built with SHA-1 or SHA-2 digests before package files are signed, this prerequisite is noted in rpmsign man page. Changelog: - throw argerror when --fskpath is used without --signfiles Signed-off-by: Lubos Kardos <lkardos@redhat.com>
* Add --filetriggers option to show info about file triggers.Lubos Kardos2015-08-061-0/+8
|
* Fix regression in "--sign" option of rpmbuild command (rhbz:#1239039)Lubos Kardos2015-07-141-1/+1
| | | | Regression from 0bce5fcf270711a2e077fba0fb7c5979ea007eb5
* Add deprecation warning to description of "--addsign"Lubos Kardos2015-03-271-1/+1
|
* Fix --last sorting with non-en localesDenis Ollier2015-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some locales (e.g: french), sort interprets the space character as a thousands separator. As a result, digit(s) at the beginning of package names (e.g: '0' for 0ad), are merged with package installation timestamp and the output of rpm -qa --last is wrong. For instance, the following list: 1398777401 0ad-0.0.15-3.fc20.x86_64 1397901236 kernel-3.13.10-200.fc20.x86_64 1399198174 kernel-3.14.2-200.fc20.x86_64 is sorted like this: 1398777401 0ad-0.0.15-3.fc20.x86_64 1399198174 kernel-3.14.2-200.fc20.x86_64 1397901236 kernel-3.13.10-200.fc20.x86_64 instead of: 1399198174 kernel-3.14.2-200.fc20.x86_64 1398777401 0ad-0.0.15-3.fc20.x86_64 1397901236 kernel-3.13.10-200.fc20.x86_64 This patch ensures that the space character is not interpreted as a thousands separator anymore by setting the environment variable LC_NUMERIC to C locale for numeric sorts.
* Add --recommends, --suggests, --supplements and --enhances aliases to rpm -qFlorian Festi2014-02-191-0/+13
|
* Unbreak --setperms (RhBug:881835)Panu Matilainen2012-11-301-1/+1
| | | | | | | | | - Fixes a regression introduced in rpm >= 4.10 caused by query format simplification (loss of zero padding support), in commit 1f1e5e88a1f6c60cf2d11014d809000e97a63aad. - 'chmod' command doesn't need zero padding, just remove the formatting. In fact we shouldn't be passing the entire mode to it but just the permission bits, but fortunately chmod isn't too picky here.
* Don't call "rpm --addsign" if rpmbuild didn't create RPMs.Tim Landscheidt2012-11-011-1/+1
| | | | Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
* Show arch in --last output too (RhBug:768516)Panu Matilainen2012-01-121-1/+1
|
* Show all interpreter arguments on --scripts query (ticket #847)Panu Matilainen2011-09-121-14/+14
| | | | | | | | | | | | - Previously any arguments to interpreter were invisible unless you happened to know that RPMTAG_FOOPROG are actually string arrays despite their type showing plain string, and queried as arrays. This makes all the arguments for all scriptlets supporting interpreter arguments visible on --scripts query and also serves as an example on how to properly query them.i - Perhaps worth noting is the exact formatting of the query: "(using[ %{PRETRANSPROG}]" instead of the more typical style of "(using [%{PRETRANSPROG} ]" to avoid extra trailing blanks.
* Show possible %verifyscript interpreter similarly to other scriptletsPanu Matilainen2011-09-121-1/+3
|
* Use the new FOO_NEVRS extensions for --requires etc popt aliasesPanu Matilainen2011-09-061-8/+8
| | | | | - Makes the popt foobar somewhat saner and fixes RhBug:717534 and RhBug:735801 while at it.
* Fix rpmsign --key-id popt alias typoPanu Matilainen2011-01-101-1/+1
|
* Remove absolute paths from our popt exec aliases now that we canPanu Matilainen2010-11-151-10/+10
| | | | | | - poptExecPath() pointing to meaningful place allows removal of these. - Make test-suite rely on the --initdb exec alias so we catch out if anything here breaks
* Kill broken --rebuilddbpath popt aliasPanu Matilainen2010-11-091-2/+0
| | | | | - It's been broken because of a typo for the last ten years and nobody noticed, doesn't seem like a particularly useful switch...
* Move --dbpath into common rpm popt options tablePanu Matilainen2010-11-091-5/+0
| | | | | | - This ensures its available in all our executables without adding umphteen copies into rpmpopt (after the cli splits, this was missing in eg rpmdb executable...)
* Lose the remaining dbapi references in code + configurationPanu Matilainen2010-11-041-11/+0
| | | | | | - Changing db_api to db_ver to force breakage on anything using the value, db_ver containing the BDB major version just to put something in the error messages where the dbapi version used to be.
* Add --requires etc popt aliases for rpmspec tooPanu Matilainen2010-10-121-0/+17
| | | | | | - In addition to the regular dependencies, add --buildrequires and --buildconflicts which are just --srpm --requires and --srpm --conflicts in reality
* Add cli switches to override signing key and digest algorithmPanu Matilainen2010-10-041-0/+7
|
* Lift specfile query out of main rpm(query) into separate binaryPanu Matilainen2010-10-041-0/+1
| | | | | | - 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
* Rip IAM_RPMDB, ie --initdb, --rebuilddb etc modes out of rpmqv.c and librpmPanu Matilainen2010-09-031-0/+4
| | | | | | | - 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...
* Rip IAM_RPMK, ie --import and --checksig modes out of rpmqv.c + librpmPanu Matilainen2010-09-031-0/+3
| | | | - Add popt exec aliases to rpmkeys for backwards compatibility
* Rrrriiip the addsign/resign/delsign bits out of rpmqv.c + friendsPanu Matilainen2010-09-031-0/+4
| | | | - Add popt exec aliases to rpmsign for backwards compatibility (dejavu...)
* Eliminate silly and unused timecheck feature from (lib)rpmbuildPanu Matilainen2010-09-011-1/+0
| | | | | | - This was broken for years without anybody complaining, should be safe to conclude nobody will miss it later either. And if somebody misses it, this is a job for rpmlint really.
* Remove signing support from (lib)rpmbuildPanu Matilainen2010-08-201-1/+4
| | | | | | | | | | | | | | | | - Signing is better done in an environment completely separated from the process of actually building packages. This is how its generally done anyway by distros, this change just forces the issue. - While signing on build seems handy and saves some io-churn, this is very insecure as your precious secret passphrase remains unencrypted in memory for the entire duration of the build where it's accessible to whatever happens to be building. This change doesn't affect fix the issue of unencrypted passphrase residing in memory and potentially getting swapped out, it only limits the exposure to the actual signing process which isn't subject to unknown scripts poking around. - Minimally preserve rpmbuild's --sign functionality via popt --pipe hack to call rpm --addsign when build completes
* Add Epoch, Architecture and BugURL to rpm -qi and fix alignment (RhBug:575499)Jindrich Novy2010-03-241-6/+16
|
* Make --httpproxy and friends work again (RhBug:529214)Panu Matilainen2009-10-221-4/+4
| | | | | | | | | - macro fiddling to pass the macros set by --httpproxy etc popt aliases to the url helper - ftp proxy and http proxy control the same thing (http proxy) now to keep things simple - while at it, add %__urlhelper_localopts for local customization needs without having to override the entire __urlhelperopts macro
* Output dependency type on --requires etc queries if verbose (RhBug:528342)Panu Matilainen2009-10-121-4/+4
|
* Use %{_rpmconfigdir} throughout configuration macros and suchPanu Matilainen2008-11-221-1/+1
|
* Add --filecaps popt alias for looking at file capabilitiesPanu Matilainen2008-10-291-0/+3
| | | | - doesn't need much as the capabilities are stored in human readable format
* Argh, the tag is LONGSIZE, not LARGESIZEPanu Matilainen2008-06-261-1/+1
|