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

Diff of /eclass/eutils.eclass

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

Revision 1.48 Revision 1.49
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
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/eutils.eclass,v 1.48 2003/08/25 13:39:17 wolf31o2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.49 2003/09/05 15:42:30 vapier Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 6#
7# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 8# have to implement themselves.
858 ;; 858 ;;
859 2.1.1) 859 2.1.1)
860 skip=`grep -a ^offset= ${src} | awk '{print $2}' | cut -b2-` 860 skip=`grep -a ^offset= ${src} | awk '{print $2}' | cut -b2-`
861 let skip="skip + 1" 861 let skip="skip + 1"
862 ;; 862 ;;
863 2.1.2)
864 skip=`grep -a ^offset= ${src} | awk '{print $3}' | head -n 1`
865 let skip="skip + 1"
866 ;;
863 2.1.3) 867 2.1.3)
864 skip=`grep -a ^offset= ${src} | awk '{print $3}'` 868 skip=`grep -a ^offset= ${src} | awk '{print $3}'`
865 let skip="skip + 1" 869 let skip="skip + 1"
866 ;; 870 ;;
867 *) 871 *)
875 debug-print "Detected Makeself version ${ver} ... using ${skip} as offset" 879 debug-print "Detected Makeself version ${ver} ... using ${skip} as offset"
876 fi 880 fi
877 881
878 # we do this because otherwise a failure in gzip will cause 0 bytes to be sent 882 # we do this because otherwise a failure in gzip will cause 0 bytes to be sent
879 # to tar which will make tar not extract anything and exit with 0 883 # to tar which will make tar not extract anything and exit with 0
880 local out="`(tail +${skip} ${src} | gzip -cd | tar -x --no-same-owner -f -) 2>&1`" 884 tail -n +${skip} ${src} | gzip -cd | tar -x --no-same-owner -f - 2>/dev/null
881 if [ ! -z "${out}" ] ; then 885 local pipestatus="${PIPESTATUS[*]}"
886 pipestatus="${pipestatus// }"
887 if [ "${pipestatus//0}" != "" ] ; then
882 # maybe it isnt gzipped ... they usually are, but not always ... 888 # maybe it isnt gzipped ... they usually are, but not always ...
883 tail +${skip} ${src} | tar -x --no-same-owner -f - \ 889 tail -n +${skip} ${src} | tar -x --no-same-owner -f - \
884 || die "failure unpacking makeself ${shrtsrc} ('${ver}' +${skip})" 890 || die "failure unpacking makeself ${shrtsrc} ('${ver}' +${skip})"
885 fi 891 fi
886} 892}

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.49

  ViewVC Help
Powered by ViewVC 1.1.20