diff options
author | Aleric Inglewood | 2010-10-10 15:45:25 +0200 |
---|---|---|
committer | Aleric Inglewood | 2010-10-10 15:45:25 +0200 |
commit | 7c5b611b1699774f4a86211a03e9cb15b8ad0d76 (patch) | |
tree | 461e1f50552656e8cf27bbb8187920048b18e428 /linden/scripts/install.py | |
parent | Changed version to Experimental 2010.10.09 (diff) | |
download | meta-impy-7c5b611b1699774f4a86211a03e9cb15b8ad0d76.zip meta-impy-7c5b611b1699774f4a86211a03e9cb15b8ad0d76.tar.gz meta-impy-7c5b611b1699774f4a86211a03e9cb15b8ad0d76.tar.bz2 meta-impy-7c5b611b1699774f4a86211a03e9cb15b8ad0d76.tar.xz |
RED-429: Additional fixes.
This patch fixes the regression that you couldn't run
'scripts/install.py' anymore from linden/ when installing a prebuilt
package.
It also adds support for --dry-run: still printing what symlinks are
missing when that options is used without actually adding the symlinks.
Finally, the added symlinks are now added to the 'files' section in
install.xml so that they are also removed again when you uninstall the
package.
Diffstat (limited to 'linden/scripts/install.py')
-rwxr-xr-x | linden/scripts/install.py | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/linden/scripts/install.py b/linden/scripts/install.py index 69f0c64..a16034f 100755 --- a/linden/scripts/install.py +++ b/linden/scripts/install.py | |||
@@ -564,40 +564,43 @@ windows/i686/vs/2003 -- specify a windows visual studio 2003 package""" | |||
564 | tar.extractall(path=install_dir) | 564 | tar.extractall(path=install_dir) |
565 | except AttributeError: | 565 | except AttributeError: |
566 | _extractall(tar, path=install_dir) | 566 | _extractall(tar, path=install_dir) |
567 | if _get_platform() == 'linux' or _get_platform() == 'linux64': | 567 | symlinks = [] |
568 | first = 1 | 568 | if _get_platform() == 'linux' or _get_platform() == 'linux64': |
569 | for tfile in tar.getnames(): | 569 | first = 1 |
570 | if tfile.find('.so.') > 0: | 570 | for tfile in tar.getnames(): |
571 | LINK = re.sub(r'\.so\.[0-9.]*$', '.so', tfile) | 571 | if tfile.find('.so.') > 0: |
572 | link_name = "../" + LINK | 572 | LINK = re.sub(r'\.so\.[0-9.]*$', '.so', tfile) |
573 | if not os.path.exists(link_name): | 573 | link_name = install_dir + "/" + LINK |
574 | if first == 1: | 574 | if not os.path.exists(link_name): |
575 | first = 0 | 575 | if first == 1: |
576 | print "Adding missing symlink(s) for package %s:" % ifile.filename | 576 | first = 0 |
577 | target = os.path.basename(tfile) | 577 | print "Adding missing symlink(s) for package %s:" % ifile.filename |
578 | soname = os.popen("readelf -d \"../%(tfile)s\" " | 578 | target = os.path.basename(tfile) |
579 | " | grep SONAME " | 579 | soname = os.popen("readelf -d \"%(install_dir)s/%(tfile)s\" %(stderr_redirect)s" |
580 | " | sed -e 's/.*\[//;s/\].*//'" % {"tfile": tfile}).read() | 580 | " | grep SONAME | sed -e 's/.*\[//;s/\].*//'" % |
581 | soname = soname.strip() | 581 | {"install_dir": install_dir, "tfile": tfile, "stderr_redirect": ("2>/dev/null" if self._dryrun else "")}).read() |
582 | if soname: # not empty | 582 | soname = soname.strip() |
583 | tmpfname = os.path.dirname(LINK) + "/" + soname | 583 | if soname: # not empty |
584 | if os.path.exists("../" + tmpfname): | 584 | tmpfname = os.path.dirname(LINK) + "/" + soname |
585 | target = soname | 585 | if os.path.exists(install_dir + "/" + tmpfname): |
586 | else: | 586 | target = soname |
587 | print "WARNING: SONAME %s doesn't exist!" % tmpfname | 587 | else: |
588 | print "WARNING: SONAME %s doesn't exist!" % tmpfname | ||
589 | if not self._dryrun: | ||
588 | os.symlink(target, link_name) | 590 | os.symlink(target, link_name) |
589 | print " %s --> %s" % (LINK, target) | 591 | symlinks += [LINK] |
592 | print " %s --> %s" % (LINK, target) | ||
590 | if ifile.pkgname in self._installed: | 593 | if ifile.pkgname in self._installed: |
591 | self._installed[ifile.pkgname].add_files( | 594 | self._installed[ifile.pkgname].add_files( |
592 | ifile.url, | 595 | ifile.url, |
593 | tar.getnames()) | 596 | tar.getnames() + symlinks) |
594 | self._installed[ifile.pkgname].set_md5sum( | 597 | self._installed[ifile.pkgname].set_md5sum( |
595 | ifile.url, | 598 | ifile.url, |
596 | ifile.md5sum) | 599 | ifile.md5sum) |
597 | else: | 600 | else: |
598 | # *HACK: this understands the installed package syntax. | 601 | # *HACK: this understands the installed package syntax. |
599 | definition = { ifile.url : | 602 | definition = { ifile.url : |
600 | {'files': tar.getnames(), | 603 | {'files': tar.getnames() + symlinks, |
601 | 'md5sum' : ifile.md5sum } } | 604 | 'md5sum' : ifile.md5sum } } |
602 | self._installed[ifile.pkgname] = InstalledPackage(definition) | 605 | self._installed[ifile.pkgname] = InstalledPackage(definition) |
603 | self._installed_changed = True | 606 | self._installed_changed = True |