OSDN Git Service

Merge: SDK Manager: Rework install logic.
authorRaphael Moll <ralf@android.com>
Wed, 29 Dec 2010 22:57:38 +0000 (14:57 -0800)
committerRaphael Moll <ralf@android.com>
Sat, 8 Jan 2011 06:52:50 +0000 (22:52 -0800)
commit33cca6dabe3e62aa87696344b39d909858c74a96
treee66ad54aab3bf0add75979c31529410d17b6d50c
parent20b35bfcd47af8ef1476a18449865dcdfcc2d3b1
Merge: SDK Manager: Rework install logic.

This should get rid of the annoying behavior on Windows
that prevent the "folder swap" operation due to the folders
being locked. Cf public issue 4410.

High level summary of the issue and the fix: the old behavior
was to unzip in a temp folder, then rename the old folder to
another temp file and finally rename the new folder at the
desired location. This fails typically when there is a file
indexer (e.g. anti-virus) scanning the new folder so we can't
move that folder.
The new logic is to try to move the old folder first into a
temp folder. If the fail move, we have a lock on the old folder
and ask the user to fix it manually. They probably have a file
opened and it's a legit issue to report. Once that succeeded
we can directly unzip the archive into the final destination
without using a temp unzip location, thus avoiding the common
"indexer in progress" issue.
In case the unzip operation fails, we try to copy (not move) the
old folder back.

Change-Id: I4fd862147cf7e0813eeef77a8332c0ce4f97a836
13 files changed:
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AdbWrapper.java [moved from sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/AdbWrapper.java with 95% similarity]
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonPackage.java
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Archive.java
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ArchiveInstaller.java
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/OsHelper.java [new file with mode: 0755]
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Package.java
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/PlatformPackage.java
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/PlatformToolPackage.java
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SamplePackage.java
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ToolPackage.java
sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java