GithubHelp home page GithubHelp logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
--- apt-cyg-orig        2013-12-20 00:48:38.542186400 +0530
+++ /usr/bin/apt-cyg    2013-12-20 01:07:43.772186400 +0530
@@ -21,15 +21,22 @@

 WGET=`which wget 2> /dev/null`
 BZIP2=`which bzip2 2> /dev/null`
+XZ=`which xz 2> /dev/null`
 TAR=`which tar 2> /dev/null`
 GAWK=`which awk 2> /dev/null`
+FILE=`which file 2> /dev/null`
 if test "-$WGET-" = "--" || test "-$BZIP2-" = "--" || test "-$TAR-" = "--" \
-  || test "-$GAWK-" = "--"
+  || test "-$XZ-" = "--" || test "-$GAWK-" = "--" || test "-$FILE-" = "--"
 then
-  echo You must install wget, tar, gawk and bzip2 to use apt-cyg.
+  echo You must install wget, tar, gawk bzip2 xz and file to use apt-cyg.
   exit 1
 fi

+arch=x86
+if uname -m|grep 'x86_64' > /dev/null 2>&1 ; then
+   arch=x86_64
+fi
+
 function usage()
 {
   echo apt-cyg: Installs and removes Cygwin packages.
@@ -80,12 +87,12 @@
   then
     mirror="`head -1 /etc/setup/last-mirror`"
   fi
-  mirrordir="`echo "$mirror" | sed -e "s/:/%3a/g" -e "s:/:%2f:g"`"
+  mirrordir="`echo "$mirror/" | sed -e "s/:/%3a/g" -e "s:/:%2f:g"`"

   echo Working directory is $cache
   echo Mirror is $mirror
-  mkdir -p "$cache/$mirrordir"
-  cd "$cache/$mirrordir"
+  mkdir -p "$cache/$mirrordir/$arch"
+  cd "$cache/$mirrordir/$arch"
 }


@@ -95,14 +102,14 @@
   then
     touch setup.ini
     mv setup.ini setup.ini-save
-    wget -N $mirror/setup.bz2
+    wget -N $mirror/$arch/setup.bz2
     if test -e setup.bz2 && test $? -eq 0
     then
       bunzip2 setup.bz2
       mv setup setup.ini
       echo Updated setup.ini
     else
-      wget -N $mirror/setup.ini
+      wget -N $mirror/$arch/setup.ini
       if test -e setup.ini && test $? -eq 0
       then
         echo Updated setup.ini
@@ -350,7 +357,12 @@
     fi

     echo "Unpacking..."
-    cat $file | bunzip2 | tar > "/etc/setup/$pkg.lst" xvf - -C /
+
+    if file $file|grep "XZ compressed" > /dev/null 2>&1 ; then
+       cat $file | unxz | tar > "/etc/setup/$pkg.lst" xvf - -C /
+    else
+       cat $file | bunzip2 | tar > "/etc/setup/$pkg.lst" xvf - -C /
+    fi
     gzip -f "/etc/setup/$pkg.lst"
     cd ../..

Original comment by [email protected] on 19 Dec 2013 at 7:47

from apt-cyg.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
Fixed in 0.59.

Original comment by [email protected] on 19 Feb 2014 at 8:43

  • Changed state: Verified

from apt-cyg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.