proxy代理   soft软件   IT 业界特快   norton 诺顿病毒库   代理列表   search FTP搜索   whois IP地理位置   blog 追求完美  
money理财   life生活   RSS聚合门户   firefox WEB浏览器   免费域名   typeset 假古文   AntiVirus 反病毒   ipcn 站点导航  

« 找了几篇缓存设计的文章 | Main | stat lstat fstat »

June 22, 2005

rpm rpm2cpio cpio

版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。
https://windtear.net/archives/2005/06/22/000696.html http://windtear.net/archives/2005/06/22/000696.html

把一个rpm解开的话 可以这样:
rpm2cpio a.rpm > a.cpio
cpio -i --no-absolute-filenames --make-directories --force-local --preserve-modification-time < a.cpio
cpio -idm --no-absolute-filenames < a.cpio

-d, --make-directories
-m, --preserve-modification-time
--no-absolute-filenames

其中 rpm2cpio 是 rpm 的一个小工具
可以把 rpm 软件包转成 cpio 格式
/usr/bin/gendiff
/usr/bin/rpm2cpio
/usr/bin/rpmdb
/usr/bin/rpmquery
/usr/bin/rpmsign
/usr/bin/rpmverify

cpio 是一个文件归档处理工具
可以解开归档、打包文件
URL         : ftp://ftp.gnu.org/pub/gnu/cpio/
Summary     : A GNU archiving program.
Description :
GNU cpio copies files into or out of a cpio or tar archive. Archives
are files which contain a collection of other files plus information
about them, such as their file name, owner, timestamps, and access
permissions. The archive can be another file on the disk, a magnetic
tape, or a pipe. GNU cpio supports the following archive formats:
binary, old ASCII, new ASCII, crc, HPUX binary, HPUX old ASCII, old
tar, and POSIX.1 tar.

By default, cpio creates binary format archives, so that they are
compatible with older cpio programs. When it is extracting files
from archives, cpio automatically recognizes which kind of archive
it is reading and can read archives created on machines with a different
byte-order.
/bin/cpio

----->   相关的使用 --help 如下
Usage: rpm [OPTION...]

Query options (with -q or --query):
  -c, --configfiles                list all configuration files
  -d, --docfiles                   list all documentation files
  --dump                           dump basic file information
  -l, --list                       list files in package
  --queryformat=QUERYFORMAT        use the following query format
  -s, --state                      display the states of the listed files
  -a, --all                        query/verify all packages
  -f, --file                       query/verify package(s) owning file
  -g, --group                      query/verify package(s) in group
  -p, --package                    query/verify a package file
  --specfile                       query a spec file
  --whatrequires                   query/verify the package(s) which require a
                                   dependency
  --whatprovides                   query/verify the package(s) which provide a
                                   dependency

Verify options (with -V or --verify):
  --nomd5                          don't verify MD5 digest of files
  --nofiles                        don't verify files in package
  --nodeps                         don't verify package dependencies
  --noscript                       don't execute verify script(s)
  -a, --all                        query/verify all packages
  -f, --file                       query/verify package(s) owning file
  -g, --group                      query/verify package(s) in group
  -p, --package                    query/verify a package file
  --specfile                       query a spec file
  --whatrequires                   query/verify the package(s) which require a
                                   dependency
  --whatprovides                   query/verify the package(s) which provide a
                                   dependency

Signature options:
  --addsign                        sign package(s) (identical to --resign)
  -K, --checksig                   verify package signature(s)
  --import                         import an armored public key
  --resign                         sign package(s) (identical to --addsign)
  --nodigest                       don't verify package digest(s)
  --nosignature                    don't verify package signature(s)

Database options:
  --initdb                         initialize database
  --rebuilddb                      rebuild database inverted lists from
                                   installed package headers

Install/Upgrade/Erase options:
  --aid                            add suggested packages to transaction
  --allfiles                       install all files, even configurations
                                   which might otherwise be skipped
  --allmatches                     remove all packages which match <package>
                                   (normally an error is generated if
                                   <package> specified multiple packages)
  --badreloc                       relocate files in non-relocatable package
  -e, --erase=<package>+           erase (uninstall) package
  --excludedocs                    do not install documentation
  --excludepath=<path>             skip files with leading component <path>
  --fileconflicts                  detect file conflicts between packages
  --force                          short hand for --replacepkgs --replacefiles
  -F, --freshen=<packagefile>+     upgrade package(s) if already installed
  -h, --hash                       print hash marks as package installs (good
                                   with -v)
  --ignorearch                     don't verify package architecture
  --ignoreos                       don't verify package operating system
  --ignoresize                     don't check disk space before installing
  -i, --install                    install package(s)
  --justdb                         update the database, but do not modify the
                                   filesystem
  --nodeps                         do not verify package dependencies
  --nomd5                          don't verify MD5 digest of files
  --noorder                        do not reorder package installation to
                                   satisfy dependencies
  --nosuggest                      do not suggest missing dependency
                                   resolution(s)
  --noscripts                      do not execute package scriptlet(s)
  --notriggers                     do not execute any scriptlet(s) triggered
                                   by this package
  --oldpackage                     upgrade to an old version of the package
                                   (--force on upgrades does this
                                   automatically)
  --percent                        print percentages as package installs
  --prefix=<dir>                   relocate the package to <dir>, if
                                   relocatable
  --relocate=<old>=<new>           relocate files from path <old> to <new>
  --repackage                      save erased package files by repackaging
  --replacefiles                   ignore file conflicts between packages
  --replacepkgs                    reinstall if the package is already present
  --test                           don't install, but tell if it would work or
                                   not
  -U, --upgrade=<packagefile>+     upgrade package(s)

Common options for all rpm modes:
  -D, --define='MACRO EXPR'        define MACRO with value EXPR
  -E, --eval='EXPR'                print macro expansion of EXPR
  --macros=<FILE:...>              read <FILE:...> instead of default file(s)
  --nodigest                       don't verify package digest(s)
  --nosignature                    don't verify package signature(s)
  --rcfile=<FILE:...>              read <FILE:...> instead of default file(s)
  -r, --root=ROOT                  use ROOT as top level directory (default:
                                   "/")
  --querytags                      display known query tags
  --showrc                         display final rpmrc and macro configuration
  --quiet                          provide less detailed output
  -v, --verbose                    provide more detailed output
  --version                        print the version of rpm being used

Options implemented via popt alias/exec:
  --scripts                        list install/erase scriptlets from
                                   package(s)
  --setperms                       set permissions of files in a package
  --setugids                       set user/group ownership of files in a
                                   package
  --conflicts                      list capabilities this package conflicts
                                   with
  --obsoletes                      list other packages removed by installing
                                   this package
  --provides                       list capabilities that this package provides
  --requires                       list capabilities required by package(s)
  --info                           list descriptive information from package(s)
  --changelog                      list change logs for this package
  --triggers                       list trigger scriptlets from package(s)
  --last                           list package(s) by install time, most
                                   recent first
  --filesbypkg                     list all files from each package
  --fileclass                      list file names with classes
  --filecolor                      list file names with colors
  --fileprovide                    list file names with provides
  --filerequire                    list file names with requires
  --redhatprovides                 find package name that contains a provided
                                   capability (needs rpmdb-redhat package
                                   installed)
  --redhatrequires                 find package name that contains a required
                                   capability (needs rpmdb-redhat package
                                   installed)
  --buildpolicy=<policy>           set buildroot <policy> (e.g. compress man
                                   pages)
  --with=<option>                  enable configure <option> for build
  --without=<option>               disable configure <option> for build

Help options:
  -?, --help                       Show this help message
  --usage                          Display brief usage message


rpm2cpio(8)                      Red Hat Linux                     rpm2cpio(8)

NAME
       rpm2cpio - Extract cpio archive from RPM Package Manager (RPM) package.

SYNOPSIS
       rpm2cpio [filename]

DESCRIPTION
       rpm2cpio converts the .rpm file specified as a  single  argument  to  a
       cpio archive on standard out. If a '-' argument is given, an rpm stream
       is read from standard in.

       rpm2cpio rpm-1.1-1.i386.rpm
       rpm2cpio - < glint-1.0-1.i386.rpm

SEE ALSO
       rpm(8)

AUTHOR
       Erik Troan <ewt@redhat.com>

Red Hat, Inc.                   11 January 2001                    rpm2cpio(8)

Usage: cpio {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]
       [-O [[user@]host:]archive] [-F [[user@]host:]archive]
       [--file=[[user@]host:]archive] [--format=format] [--message=message]
       [--null] [--reset-access-time] [--verbose] [--dot] [--append]
       [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]
       [--force-local] [--rsh-command=command] [--help] [--version] < name-list
       [> archive]
       cpio {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H format]
       [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]
       [-F [[user@]host:]archive] [--file=[[user@]host:]archive]
       [--make-directories] [--nonmatching] [--preserve-modification-time]
       [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--dot]
       [--unconditional] [--verbose] [--block-size=blocks] [--swap-halfwords]
       [--io-size=bytes] [--pattern-file=file] [--format=format]
       [--owner=[user][:.][group]] [--no-preserve-owner] [--message=message]
       [--force-local] [--no-absolute-filenames] [--sparse] [--only-verify-crc]
       [--quiet] [--rsh-command=command] [--help] [--version] [pattern...]
       [< archive]
       cpio {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]
       [--null] [--reset-access-time] [--make-directories] [--link] [--quiet]
       [--preserve-modification-time] [--unconditional] [--verbose] [--dot]
       [--dereference] [--owner=[user][:.][group]] [--no-preserve-owner]
       [--sparse] [--help] [--version] destination-directory < name-list
本blog WWW

Posted by windtear at June 22, 2005 7:14 PM

本站使用中的任何问题,请与 windtear @ windtear.net 联系
Copyright© 1999-2024 Windtear. All rights reserved.