Commit 01a8dc2c authored by Yusei Tahara's avatar Yusei Tahara

Revert "download, downloadunpacked: Check shared directory is not enough....

Revert "download, downloadunpacked: Check shared directory is not enough. Shared directory may be created before completing installation. Check signature file too."

This reverts commit 9be7928b.
parent 9be7928b
......@@ -30,7 +30,7 @@ import shutil
import zc.buildout
import logging
from hashlib import md5
from downloadunpacked import make_read_only_recursively, test_shared_part
from downloadunpacked import make_read_only_recursively
class Recipe(object):
_parts = None
......@@ -87,7 +87,7 @@ class Recipe(object):
log = logging.getLogger(self._name)
if self._shared:
log.info('Checking whether package is installed at shared path: %s', destination)
if test_shared_part(destination, '\n'.join(self._debug_signature_text)):
if os.path.exists(destination):
log.info('This shared package has been installed by other package')
return []
......
......@@ -99,7 +99,7 @@ class Recipe:
def install(self):
if self.shared:
self.logger.info('Checking whether package is installed at shared path : %s', self.destination)
if test_shared_part(self.destination, '\n'.join(self._debug_signature_text)):
if os.path.exists(self.destination):
self.logger.info('This shared package has been installed by other package')
return []
if self.parts is not None:
......@@ -225,12 +225,6 @@ def unpatch_archive_util():
setuptools.archive_util.unpack_tarfile,
)
def test_shared_part(path, expected_signature_text):
signature_path = os.path.join(path, '.slapos.recipe.build.signature')
if os.path.exists(signature_path) and open(signature_path).read() == expected_signature_text:
return True
return False
_read_only_mask = 0o777 ^ (stat.S_IWRITE | stat.S_IWGRP | stat.S_IWOTH)
def make_read_only(path):
os.chmod(path, os.stat(path).st_mode & _read_only_mask)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment