/[gentoo-x86]/eclass/unpacker.eclass
Gentoo

Diff of /eclass/unpacker.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.6 Revision 1.7
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 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/unpacker.eclass,v 1.6 2012/04/05 03:20:42 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/unpacker.eclass,v 1.7 2012/04/21 05:45:29 vapier Exp $
4 4
5# @ECLASS: unpacker.eclass 5# @ECLASS: unpacker.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: helpers for extraneous file formats and consistent behavior across EAPIs 8# @BLURB: helpers for extraneous file formats and consistent behavior across EAPIs
251 251
252 local deb=$(find_unpackable_file "$1") 252 local deb=$(find_unpackable_file "$1")
253 253
254 unpack_banner "${deb}" 254 unpack_banner "${deb}"
255 255
256 # on AIX ar doesn't work out as their ar used a different format
257 # from what GNU ar (and thus what .deb files) produce
258 if [[ -n ${EPREFIX} ]] ; then
259 {
260 read # global header
261 [[ ${REPLY} = "!<arch>" ]] || die "${deb} does not seem to be a deb archive"
262 local f timestamp uid gid mode size magic
263 while read f timestamp uid gid mode size magic ; do
264 [[ -n ${f} && -n ${size} ]] || continue # ignore empty lines
265 if [[ ${f} = "data.tar"* ]] ; then
266 head -c "${size}" > "${f}"
267 else
268 head -c "${size}" > /dev/null # trash it
269 fi
270 done
271 } < "${deb}"
272 else
256 ar x "${deb}" 273 ar x "${deb}"
274 fi
275
257 unpack ./data.tar* 276 unpacker ./data.tar*
258} 277}
259 278
260# @FUNCTION: _unpacker 279# @FUNCTION: _unpacker
261# @USAGE: <one archive to unpack> 280# @USAGE: <one archive to unpack>
262# @INTERNAL 281# @INTERNAL

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20