Development/Packaging/Tools/rpmctl
From Mandriva Community Wiki
Contents |
[edit] Upload script (rpmctl)
You must be allowed to use /usr/local/bin/rpmctl on the cluster.
usage /usr/local/bin/rpmctl
rpmctl [options]
Mandrake rpm control tool
options:
--nobugzilla
Do not commit log into the packages database
--nochangelog
Do not send a mail to the changelog mailing list
--pkg [options]
List packages maintainers or maintainers packages
--update
Update maintainer cache
--version
Print version
-a, --arch <arch1> <arch2> ... <arch n>
Restrict architecture to given architectures
-d, --delete [options] <repository> <class> <reason> <package 1> <package 2> ... <package n>
Delete packages from an existing repository
-f, --fast
Use only cached data
-g, --gendeps
Force dependencies regeneration (slower)
-h, --help <path> <to> <the> <function>
Display help, eg. rpmctl -h option_X suboption_Y.
-m, --move [options] <repository> <class> <destination repository> <destination class> <reason> <package 1> <package 2> ... <package n>
Move packages to another repository and/or class
-n, --nocheck
Do not perform any check before sending the command
-p, --process
Process the command queue
-t, --test
Test mode, only show what it is likely to be done
-v, --verbose
Set verbose level (the higher, the more)
[edit] Package naming
- WARNING: most of the operations must be performed in all architectures, as a consequence specify the package architecture only when you want to perform the command on a specific architecture.
- For ports, if you want to limit the action to a given architecture use the -a (--arch) option.
- "xemacs" means any rpm with the name "xemacs" in all the architectures
- "xemacs-21.4.12" or "xemacs,21.4.12" means rpm with the name "xemacs" and version "21.4.12" in all the architectures
- "xemacs-21.4.12-3mdk.ppc.rpm" or "xemacs,21.4.12,3mdk,ppc" means rpm with the name "xemacs" version "21.4.12" release "3mdk" only in ppc architecture
- "xemacs,,,ppc" means rpm with the name "xemacs" in the ppc architecture
[edit] Global options
- --nocheck: do not perform any checks on the client machine, juste send the command to the server.
- -v --verbose: Print more messages, useful levels are 1 or 2, higher levels are used for debugging purposes.
- -t --test: Test mode, just give what would be the result of the command, if it is likely to be accepted or not.
- -f --fast: Fast mode, do only basic checking, do not check for source packages or for version in dependencies.
- -g --gendeps: regenerate dependencies files, do not rely on the existing depslist and cache files.
[edit] Packages options
- -u --update: Update the maintainers cache package list.
[edit] pkg options
./rpmctl -h pkg
--pkg
Packages listing functions
-m, --maint <maintainer>
List packages of matching maintainers
-p, --package <package>
List maintaienr of matching packages
-s, --source
Set source mode
<package> or <maintainer> are regexp.
e.g.:
rpmctl --pkg -s -p "^xemacs" rpmctl --pkg -m ".*ly$"
[edit] Deleting a package.
./rpmctl -h delete
--delete <repository> <class> <reason> <package 1> <package 2> ... <package n>
Delete packages from an existing repository
--nodeps
ask not to perform dependencies checking
-b, --bin
Include all the binaries from the same sources
-s, --src
Include sources
e.g.:
To remove xemacs packages, its srpm and all the associated binaries:
rpmctl -v 2 -d -s -b cooker main "emacs rules" xemacs
[edit] Moving a package
./rpmctl -h move
--move <repository> <class> <reason> <package 1> <package 2> ... <package n>
Delete packages from an existing repository
--nodeps
ask not to perform dependencies checking
e.g.: To move xemacs to contrib, but only in the ppc architecture
rpmctl -m cooker main cooker contrib "emacs rules" xemacs,,,ppc
[edit] Uploading a package
[edit] How it works
rpmctl uses the hdlist files to perform most of its checks. By default it performs first checks on the client machine, and if it succeeds sends the command line to the server. The server will then run rpmctl with the command line saved into the file. The user can use simpler checks on the client machine to have faster processing. It is the server which, in the end, decides if the action is accepted or not.
rpmctl uses a configuration file which contains most of the customization and the permission checking functions. Permissions are a set of perl functions executed by the rpmctl script which gives a final result to allow or reject a command.

