extract_funcs: always extract all distfiles into builddir.
--HG-- extra : convert_revision : 0ba3269604f8d0059fda5a36c30eac2d7e17d6c3
This commit is contained in:
parent
ef3412a7d7
commit
26c9441b87
|
@ -29,8 +29,7 @@
|
||||||
#
|
#
|
||||||
extract_distfiles()
|
extract_distfiles()
|
||||||
{
|
{
|
||||||
local count=0 pkg="$1"
|
local pkg="$1" curfile cursufx ltar_cmd f lver
|
||||||
local curfile cursufx lwrksrc ltar_cmd f lver
|
|
||||||
|
|
||||||
[ -f $XBPS_EXTRACT_DONE ] && return 0
|
[ -f $XBPS_EXTRACT_DONE ] && return 0
|
||||||
[ -z "$in_chroot" -a ! -w $XBPS_BUILDDIR ] && \
|
[ -z "$in_chroot" -a ! -w $XBPS_BUILDDIR ] && \
|
||||||
|
@ -60,18 +59,6 @@ extract_distfiles()
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for f in ${distfiles}; do
|
|
||||||
count=$(($count + 1))
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$count" -gt 1 ]; then
|
|
||||||
if [ -z "$wrksrc" ]; then
|
|
||||||
msg_error "\$wrksrc must be defined with multiple distfiles."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
mkdir $wrksrc
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg_normal "Extracting $pkgname-$lver distfile(s)."
|
msg_normal "Extracting $pkgname-$lver distfile(s)."
|
||||||
|
|
||||||
if [ -n "$tar_override_cmd" ]; then
|
if [ -n "$tar_override_cmd" ]; then
|
||||||
|
@ -109,55 +96,53 @@ extract_distfiles()
|
||||||
msg_error "unknown distfile suffix for $curfile."
|
msg_error "unknown distfile suffix for $curfile."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ $count -gt 1 ]; then
|
|
||||||
lwrksrc="$wrksrc"
|
|
||||||
else
|
|
||||||
lwrksrc="$XBPS_BUILDDIR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case ${cursufx} in
|
case ${cursufx} in
|
||||||
txz)
|
txz)
|
||||||
if [ ! -x $XBPS_MASTERDIR/usr/bin/xz ]; then
|
if [ ! -x $XBPS_MASTERDIR/usr/bin/xz ]; then
|
||||||
msg_error "cannot find xz for extraction."
|
msg_error "cannot find xz for extraction."
|
||||||
fi
|
fi
|
||||||
$ltar_cmd xfJ $XBPS_SRCDISTDIR/$curfile -C $lwrksrc
|
$ltar_cmd xfJ $XBPS_SRCDISTDIR/$curfile \
|
||||||
|
-C $XBPS_BUILDDIR
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
msg_error "extracting $curfile into $lwrksrc."
|
msg_error "extracting $curfile into $XBPS_BUILDDIR."
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
tbz)
|
tbz)
|
||||||
$ltar_cmd xfj $XBPS_SRCDISTDIR/$curfile -C $lwrksrc
|
$ltar_cmd xfj $XBPS_SRCDISTDIR/$curfile \
|
||||||
|
-C $XBPS_BUILDDIR
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
msg_error "extracting $curfile into $lwrksrc."
|
msg_error "extracting $curfile into $XBPS_BUILDDIR."
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
tgz)
|
tgz)
|
||||||
$ltar_cmd xfz $XBPS_SRCDISTDIR/$curfile -C $lwrksrc
|
$ltar_cmd xfz $XBPS_SRCDISTDIR/$curfile \
|
||||||
|
-C $XBPS_BUILDDIR
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
msg_error "extracting $curfile into $lwrksrc."
|
msg_error "extracting $curfile into $XBPS_BUILDDIR."
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
gz|bz2)
|
gz|bz2)
|
||||||
cp -f $XBPS_SRCDISTDIR/$curfile $lwrksrc
|
cp -f $XBPS_SRCDISTDIR/$curfile $XBPS_BUILDDIR
|
||||||
if [ "$cursufx" = ".gz" ]; then
|
if [ "$cursufx" = ".gz" ]; then
|
||||||
cd $lwrksrc && gunzip $curfile
|
cd $XBPS_BUILDDIR && gunzip $curfile
|
||||||
else
|
else
|
||||||
cd $lwrksrc && bunzip2 $curfile
|
cd $XBPS_BUILDDIR && bunzip2 $curfile
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
tar)
|
tar)
|
||||||
$ltar_cmd xf $XBPS_SRCDISTDIR/$curfile -C $lwrksrc
|
$ltar_cmd xf $XBPS_SRCDISTDIR/$curfile \
|
||||||
|
-C $XBPS_BUILDDIR
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
msg_error "extracting $curfile into $lwrksrc."
|
msg_error "extracting $curfile into $XBPS_BUILDDIR."
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
zip)
|
zip)
|
||||||
if [ -x $XBPS_MASTERDIR/usr/bin/unzip ]; then
|
if [ -x $XBPS_MASTERDIR/usr/bin/unzip ]; then
|
||||||
$XBPS_MASTERDIR/usr/bin/unzip \
|
$XBPS_MASTERDIR/usr/bin/unzip \
|
||||||
-q -x $XBPS_SRCDISTDIR/$curfile -d $lwrksrc
|
-q -x $XBPS_SRCDISTDIR/$curfile \
|
||||||
|
-d $XBPS_BUILDDIR
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
msg_error "extracting $curfile into $lwrksrc."
|
msg_error "extracting $curfile into $XBPS_BUILDDIR."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
msg_error "cannot find unzip bin for extraction"
|
msg_error "cannot find unzip bin for extraction"
|
||||||
|
|
Loading…
Reference in New Issue