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

Diff of /eclass/unpacker.eclass

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

Revision 1.3 Revision 1.5
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.3 2012/02/05 05:57:19 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/unpacker.eclass,v 1.5 2012/02/13 20:53:34 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
194 ;; 194 ;;
195 2.1.3) 195 2.1.3)
196 skip=`grep -a ^offset= "${src}" | awk '{print $3}'` 196 skip=`grep -a ^offset= "${src}" | awk '{print $3}'`
197 (( skip++ )) 197 (( skip++ ))
198 ;; 198 ;;
199 2.1.4|2.1.5) 199 2.1.4|2.1.5|2.1.6)
200 skip=$(grep -a offset=.*head.*wc "${src}" | awk '{print $3}' | head -n 1) 200 skip=$(grep -a offset=.*head.*wc "${src}" | awk '{print $3}' | head -n 1)
201 skip=$(head -n ${skip} "${src}" | wc -c) 201 skip=$(head -n ${skip} "${src}" | wc -c)
202 exe="dd" 202 exe="dd"
203 ;; 203 ;;
204 *) 204 *)
284 comp="xz -dc" ;; 284 comp="xz -dc" ;;
285 *) comp="" ;; 285 *) comp="" ;;
286 esac 286 esac
287 287
288 # then figure out if there are any archiving aspects 288 # then figure out if there are any archiving aspects
289 arch=""
289 case ${m} in 290 case ${m} in
290 *.tgz|*.tbz|*.tbz2|*.txz|*.tar.*|*.tar) 291 *.tgz|*.tbz|*.tbz2|*.txz|*.tar.*|*.tar)
291 arch="tar --no-same-owner -xof" ;; 292 arch="tar --no-same-owner -xof" ;;
292 *.deb) 293 *.deb)
293 arch="unpack_deb" ;; 294 arch="unpack_deb" ;;
294 *.run) 295 *.run)
295 arch="unpack_makeself" ;; 296 arch="unpack_makeself" ;;
296 *) arch="" ;; 297 *.bin)
298 # Makeself archives can be annoyingly named
299 if head -c 100 "${a}" | grep -qs '#.*Makeself' ; then
300 arch="unpack_makeself"
301 fi
302 ;;
297 esac 303 esac
298 304
299 # finally do the unpack 305 # finally do the unpack
300 if [[ -z ${arch}${comp} ]] ; then 306 if [[ -z ${arch}${comp} ]] ; then
301 unpack "$1" 307 unpack "$1"

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20