| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2004 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/rpm.eclass,v 1.10 2004/06/25 00:39:48 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/rpm.eclass,v 1.11 2005/06/25 15:58:55 liquidx Exp $ |
| 4 | |
4 | |
| 5 | # Author : Alastair Tse <liquidx@gentoo.org> (21 Jun 2003) |
5 | # Author : Alastair Tse <liquidx@gentoo.org> (21 Jun 2003) |
| 6 | # |
6 | # |
| 7 | # Convienence class for extracting RPMs |
7 | # Convienence class for extracting RPMs |
| 8 | # |
8 | # |
| … | |
… | |
| 40 | local rpmfile rpmoff decompcmd |
40 | local rpmfile rpmoff decompcmd |
| 41 | rpmfile=$1 |
41 | rpmfile=$1 |
| 42 | if [ -z "${rpmfile}" ]; then |
42 | if [ -z "${rpmfile}" ]; then |
| 43 | return 1 |
43 | return 1 |
| 44 | fi |
44 | fi |
| 45 | |
|
|
| 46 | cd ${WORKDIR} |
|
|
| 47 | if [ -x /usr/bin/rpm2cpio -a -z "${USE_RPMOFFSET_ONLY}" ]; then |
45 | if [ -x /usr/bin/rpm2cpio -a -z "${USE_RPMOFFSET_ONLY}" ]; then |
| 48 | rpm2cpio ${rpmfile} | cpio -idmu --no-preserve-owner --quiet || return 1 |
46 | rpm2cpio ${rpmfile} | cpio -idmu --no-preserve-owner --quiet || return 1 |
| 49 | else |
47 | else |
| 50 | rpmoff=`rpmoffset < ${rpmfile}` |
48 | rpmoff=`rpmoffset < ${rpmfile}` |
| 51 | [ -z "${rpmoff}" ] && return 1 |
49 | [ -z "${rpmoff}" ] && return 1 |