diff options
author | Aleric Inglewood | 2010-10-26 15:54:01 +0200 |
---|---|---|
committer | Aleric Inglewood | 2010-10-26 15:54:01 +0200 |
commit | 209535f2e8c9e0553cb08b6a47fefb0a86c1ea61 (patch) | |
tree | ea1b279bb8735f38d3d2232dcb5e460469fd158e /linden/scripts | |
parent | IMP-667: WARNING: remove: Attempting to remove filename: /ramdisk/imprudence/... (diff) | |
download | meta-impy-209535f2e8c9e0553cb08b6a47fefb0a86c1ea61.zip meta-impy-209535f2e8c9e0553cb08b6a47fefb0a86c1ea61.tar.gz meta-impy-209535f2e8c9e0553cb08b6a47fefb0a86c1ea61.tar.bz2 meta-impy-209535f2e8c9e0553cb08b6a47fefb0a86c1ea61.tar.xz |
IMP-670: Uninstall packages that are renewed
Uninstall old files when a new package with the same name is being
installed. See http://redmine.imprudenceviewer.org/issues/670
Diffstat (limited to 'linden/scripts')
-rwxr-xr-x | linden/scripts/install.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/linden/scripts/install.py b/linden/scripts/install.py index a16034f..f09fc48 100755 --- a/linden/scripts/install.py +++ b/linden/scripts/install.py | |||
@@ -534,24 +534,24 @@ windows/i686/vs/2003 -- specify a windows visual studio 2003 package""" | |||
534 | platform, | 534 | platform, |
535 | cache_dir)) | 535 | cache_dir)) |
536 | to_install = [] | 536 | to_install = [] |
537 | to_uninstall = [] | ||
537 | #print "self._installed",self._installed | 538 | #print "self._installed",self._installed |
538 | for ifile in ifiles: | 539 | for ifile in ifiles: |
539 | if ifile.pkgname not in self._installed: | 540 | if ifile.pkgname not in self._installed: |
540 | to_install.append(ifile) | 541 | to_install.append(ifile) |
541 | elif ifile.url not in self._installed[ifile.pkgname].urls(): | 542 | elif ifile.url not in self._installed[ifile.pkgname].urls(): |
543 | to_uninstall.append(ifile.pkgname) | ||
542 | to_install.append(ifile) | 544 | to_install.append(ifile) |
543 | elif ifile.md5sum != \ | 545 | elif ifile.md5sum != \ |
544 | self._installed[ifile.pkgname].get_md5sum(ifile.url): | 546 | self._installed[ifile.pkgname].get_md5sum(ifile.url): |
545 | # *TODO: We may want to uninstall the old version too | 547 | to_uninstall.append(ifile.pkgname) |
546 | # when we detect it is installed, but the md5 sum is | ||
547 | # different. | ||
548 | to_install.append(ifile) | 548 | to_install.append(ifile) |
549 | else: | 549 | else: |
550 | #print "Installation up to date:", | 550 | #print "Installation up to date:", |
551 | # ifile.pkgname,ifile.platform_path | 551 | # ifile.pkgname,ifile.platform_path |
552 | pass | 552 | pass |
553 | #print "to_install",to_install | 553 | #print "to_install",to_install |
554 | return to_install | 554 | return [to_install, to_uninstall] |
555 | 555 | ||
556 | def _install(self, to_install, install_dir): | 556 | def _install(self, to_install, install_dir): |
557 | for ifile in to_install: | 557 | for ifile in to_install: |
@@ -620,12 +620,17 @@ windows/i686/vs/2003 -- specify a windows visual studio 2003 package""" | |||
620 | cache_dir = os.path.realpath(cache_dir) | 620 | cache_dir = os.path.realpath(cache_dir) |
621 | _mkdir(install_dir) | 621 | _mkdir(install_dir) |
622 | _mkdir(cache_dir) | 622 | _mkdir(cache_dir) |
623 | to_install = self._build_ifiles(platform, cache_dir) | 623 | to_install_uninstall = self._build_ifiles(platform, cache_dir) |
624 | to_install = to_install_uninstall[0] | ||
625 | to_uninstall = to_install_uninstall[1] | ||
624 | 626 | ||
625 | # Filter for files which we actually requested to install. | 627 | # Filter for files which we actually requested to install. |
626 | to_install = [ifl for ifl in to_install if ifl.pkgname in installables] | 628 | to_install = [ifl for ifl in to_install if ifl.pkgname in installables] |
629 | to_uninstall = [ifl for ifl in to_uninstall if ifl in installables] | ||
627 | for ifile in to_install: | 630 | for ifile in to_install: |
628 | ifile.fetch_local() | 631 | ifile.fetch_local() |
632 | if to_uninstall: | ||
633 | self.uninstall(to_uninstall, install_dir) | ||
629 | self._install(to_install, install_dir) | 634 | self._install(to_install, install_dir) |
630 | 635 | ||
631 | def do_install(self, installables, platform, install_dir, cache_dir=None, | 636 | def do_install(self, installables, platform, install_dir, cache_dir=None, |