Added unpacking instruction for "zip"ped packages in generated scripts

This commit is contained in:
Pierre Labastie 2012-02-27 10:47:30 +00:00
parent b957bb6fd8
commit 9683707108

View file

@ -123,12 +123,18 @@ cd xc&#xA;</xsl:text>
</xsl:when> </xsl:when>
<xsl:when test="@role = 'installation'"> <xsl:when test="@role = 'installation'">
<xsl:text> <xsl:text>
if [[ -e unpacked ]] ; then if [ "${PACKAGE%.zip}" = "${PACKAGE}" ]; then
if [[ -e unpacked ]] ; then
UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
[[ -n $UNPACKDIR ]] &amp;&amp; [[ -d $UNPACKDIR ]] &amp;&amp; rm -rf $UNPACKDIR [[ -n $UNPACKDIR ]] &amp;&amp; [[ -d $UNPACKDIR ]] &amp;&amp; rm -rf $UNPACKDIR
fi
tar -xvf $PACKAGE > unpacked
UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
else
UNPACKDIR=${PACKAGE%.zip}
[[ -n $UNPACKDIR ]] &amp;&amp; [[ -d $UNPACKDIR ]] &amp;&amp; rm -rf $UNPACKDIR
unzip -d $UNPACKDIR ${PACKAGE}
fi fi
tar -xvf $PACKAGE > unpacked
UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
cd $UNPACKDIR&#xA;</xsl:text> cd $UNPACKDIR&#xA;</xsl:text>
<xsl:apply-templates select=".//screen | .//para/command"/> <xsl:apply-templates select=".//screen | .//para/command"/>
<xsl:if test="$sudo = 'y'"> <xsl:if test="$sudo = 'y'">