diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2012-09-18 10:34:35 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-21 11:10:23 +0100 |
commit | bf94f4d6f9a846482b40434090bf60118a9623e2 (patch) | |
tree | 6698a1d1729c790671ab9c84f41c236ced87c7c2 /meta/recipes-devtools/installer | |
parent | bd73a4b615f51d6a2330fcd21a33dcdd863497d2 (diff) | |
download | poky-bf94f4d6f9a846482b40434090bf60118a9623e2.tar.gz |
adt-installer: ensure directory exists before copying/removing
If the installation is done in a directory which already contains a
valid installation, opkg will not install anything and the moving the
contents of /install/dir/opt/poky/1.2 (for example) to /install/dir will
throw some errors. However, the install directory will not be affected.
This patch will ensure that the /install/dir/opt/poky/1.2 exists.
(From OE-Core rev: 1cd01533cbec0e9ed61bbd33ecdf5dc306a32eec)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/installer')
-rwxr-xr-x | meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal index 76acaa7e8a..fbcd2ceb3c 100755 --- a/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal +++ b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal | |||
@@ -158,31 +158,33 @@ fi | |||
158 | # the entire directory structure. We could patch opkg to do that but it's far | 158 | # the entire directory structure. We could patch opkg to do that but it's far |
159 | # simpler to do that here and achieve the same result. | 159 | # simpler to do that here and achieve the same result. |
160 | # This is done in two steps: | 160 | # This is done in two steps: |
161 | # Step 1: copy ./opt/${DISTRO}/${SDK_VERSION} contents to $NATIVE_INSTALL_DIR. | 161 | if [ -d $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER ]; then |
162 | # We cannot use move if $NATIVE_INSTALL_DIR is not empty (for example: contains | 162 | # Step 1: copy ./opt/${DISTRO}/${SDK_VERSION} contents to $NATIVE_INSTALL_DIR. |
163 | # another SDK) | 163 | # We cannot use move if $NATIVE_INSTALL_DIR is not empty (for example: contains |
164 | $SUDO cp -r $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER/* $NATIVE_INSTALL_DIR | 164 | # another SDK) |
165 | 165 | $SUDO cp -r $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER/* $NATIVE_INSTALL_DIR | |
166 | # delete the source directory now | 166 | |
167 | $SUDO rm -rf $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER/* | 167 | # delete the source directory now |
168 | 168 | $SUDO rm -rf $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER/* | |
169 | # Step 2: Delete the ./opt/${DISTRO}/${SDK_VERSION} directories too, they should be empty | 169 | |
170 | dir=$NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER | 170 | # Step 2: Delete the ./opt/${DISTRO}/${SDK_VERSION} directories too, they should be empty |
171 | while [ "$dir" != "$NATIVE_INSTALL_DIR" ]; do | 171 | dir=$NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER |
172 | # if the user chose / as the install folder, then we should leave /opt in place | 172 | while [ "$dir" != "$NATIVE_INSTALL_DIR" ]; do |
173 | if [ "$dir" = "/opt" ]; then | 173 | # if the user chose / as the install folder, then we should leave /opt in place |
174 | break | 174 | if [ "$dir" = "/opt" ]; then |
175 | fi | 175 | break |
176 | 176 | fi | |
177 | # try to delete the directory, only if it's empty | 177 | |
178 | $SUDO rmdir $dir | 178 | # try to delete the directory, only if it's empty |
179 | if [ $? -ne 0 ]; then | 179 | $SUDO rmdir $dir |
180 | break | 180 | if [ $? -ne 0 ]; then |
181 | fi | 181 | break |
182 | 182 | fi | |
183 | # go to the next directory | 183 | |
184 | dir=$(dirname $dir) | 184 | # go to the next directory |
185 | done | 185 | dir=$(dirname $dir) |
186 | done | ||
187 | fi | ||
186 | 188 | ||
187 | # Link the ld.so.cache file into the hosts filesystem | 189 | # Link the ld.so.cache file into the hosts filesystem |
188 | if [ ! -f "$OECORE_NATIVE_SYSROOT/etc/ld.so.cache" ]; then | 190 | if [ ! -f "$OECORE_NATIVE_SYSROOT/etc/ld.so.cache" ]; then |