예제 #1
0
파일: build.py 프로젝트: yncat/falcon
 def makePatch(self, build_filename, archive_name):
     patch_name = None
     if constants.BASE_PACKAGE_URL is not None:
         print("Making patch...")
         patch_name = "%s-%spatch" % (constants.APP_NAME, build_filename)
         archiver = diff_archiver.DiffArchiver(constants.BASE_PACKAGE_URL, archive_name, patch_name, clean_base_package=True, skip_root=True)
         archiver.work()
     return patch_name
예제 #2
0
 def test_local(self):
     if os.path.exists("base"): shutil.rmtree("base")
     if os.path.exists("latest"): shutil.rmtree("latest")
     if os.path.exists("patch"): shutil.rmtree("patch")
     archiver = diff_archiver.DiffArchiver("tests/data/base.zip",
                                           "tests/data/modified_latest.zip",
                                           "tmp/patch",
                                           logger=None)
     archiver.work()
     self.assertTrue(os.path.isfile("tmp/patch.zip"))
     os.remove("tmp/patch.zip")
예제 #3
0
 def test_local_clean(self):
     if os.path.exists("base"): shutil.rmtree("base")
     if os.path.exists("latest"): shutil.rmtree("latest")
     if os.path.exists("patch"): shutil.rmtree("patch")
     shutil.copyfile("tests/data/base.zip", "tests/data/base2.zip")
     archiver = diff_archiver.DiffArchiver("tests/data/base.zip",
                                           "tests/data/modified_latest.zip",
                                           "tmp/patch",
                                           logger=None,
                                           clean_base_package=True)
     archiver.work()
     self.assertTrue(os.path.isfile("tmp/patch.zip"))
     self.assertFalse(os.path.isfile("tests/data/base.zip"))
     shutil.move("tests/data/base2.zip", "tests/data/base.zip")
     self.assertTrue(os.path.isfile("tests/data/base.zip"))
     os.remove("tmp/patch.zip")
예제 #4
0
# -*- coding: utf-8 -*-
# diff_archiver sample client
#Copyright (C) 2020 Yukio Nozawa <*****@*****.**>
import diff_archiver

archiver = diff_archiver.DiffArchiver("tests/data/base.zip",
                                      "tests/data/modified_latest.zip",
                                      "patch")
archiver.work()
예제 #5
0
print("deleting temporary version file...")
os.remove("version.txt")
print("Compressing into package...")
shutil.make_archive("%s-%s" % (constants.APP_NAME, build_filename), 'zip',
                    'dist')

if build_filename == "snapshot":
    print("Skipping batch archiving because this is a snapshot release.")
else:
    archive_name = "%s-%s.zip" % (constants.APP_NAME, build_filename)
    if constants.BASE_PACKAGE_URL is not None:
        print("Making patch...")
        patch_name = "%s-%spatch" % (constants.APP_NAME, build_filename)
        archiver = diff_archiver.DiffArchiver(constants.BASE_PACKAGE_URL,
                                              archive_name,
                                              patch_name,
                                              clean_base_package=True,
                                              skip_root=True)
        archiver.work()
    if constants.UPDATER_URL is not None:
        print("downloading updater...")
        urllib.request.urlretrieve(constants.UPDATER_URL, "updater.zip")
        print("writing updater...")
        with zipfile.ZipFile("updater.zip", "r") as zip:
            zip.extractall()
        with zipfile.ZipFile(archive_name, mode="a") as zip:
            zip.write("ionic.zip.dll",
                      "%s/ionic.zip.dll" % (constants.APP_NAME))
            zip.write("updater.exe", "%s/updater.exe" % (constants.APP_NAME))
    print("computing hash...")
    with open(archive_name, mode="rb") as f: