/[gentoo-x86]/eclass/vcs-snapshot.eclass
Gentoo

Diff of /eclass/vcs-snapshot.eclass

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

Revision 1.6 Revision 1.7
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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/vcs-snapshot.eclass,v 1.6 2013/02/08 20:51:35 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/vcs-snapshot.eclass,v 1.7 2013/07/25 07:51:16 mgorny Exp $
4 4
5# @ECLASS: vcs-snapshot.eclass 5# @ECLASS: vcs-snapshot.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# mgorny@gentoo.org 7# mgorny@gentoo.org
8# @BLURB: support eclass for unpacking VCS snapshot tarballs 8# @BLURB: support eclass for unpacking VCS snapshot tarballs
47# Extract all the archives from ${A}. The .tar, .tar.gz, .tar.bz2 47# Extract all the archives from ${A}. The .tar, .tar.gz, .tar.bz2
48# and .tar.xz archives will be unpacked to directories matching their 48# and .tar.xz archives will be unpacked to directories matching their
49# local names. Other archive types will be passed down to regular 49# local names. Other archive types will be passed down to regular
50# unpack. 50# unpack.
51vcs-snapshot_src_unpack() { 51vcs-snapshot_src_unpack() {
52 debug-print-function ${FUNCNAME} "${@}"
53
52 local f 54 local f
53 55
54 for f in ${A} 56 for f in ${A}
55 do 57 do
56 case "${f}" in 58 case "${f}" in
57 *.tar|*.tar.gz|*.tar.bz2|*.tar.xz) 59 *.tar|*.tar.gz|*.tar.bz2|*.tar.xz)
58 local destdir=${WORKDIR}/${f%.tar*} 60 local destdir=${WORKDIR}/${f%.tar*}
59 61
62 debug-print "${FUNCNAME}: unpacking ${f} to ${destdir}"
63
60 # XXX: check whether the directory structure inside is 64 # XXX: check whether the directory structure inside is
61 # fine? i.e. if the tarball has actually a parent dir. 65 # fine? i.e. if the tarball has actually a parent dir.
62 mkdir "${destdir}" || die 66 mkdir "${destdir}" || die
63 tar -C "${destdir}" -x --strip-components 1 \ 67 tar -C "${destdir}" -x --strip-components 1 \
64 -f "${DISTDIR}/${f}" || die 68 -f "${DISTDIR}/${f}" || die
65 ;; 69 ;;
66 *) 70 *)
71 debug-print "${FUNCNAME}: falling back to unpack for ${f}"
72
67 # fall back to the default method 73 # fall back to the default method
68 unpack "${f}" 74 unpack "${f}"
69 ;; 75 ;;
70 esac 76 esac
71 done 77 done

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

  ViewVC Help
Powered by ViewVC 1.1.20