From: Antoni Date: Mon, 18 Jul 2022 15:08:46 +0000 (+0200) Subject: Remove unused Apply_Container_Delta() function from CreatePatch.py X-Git-Tag: accepted/tizen/unified/20240419.110853~37^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c893ea37065f54831593ef7a3d1cd6de9ce92f29;p=platform%2Fcore%2Fsystem%2Fupgrade-tools.git Remove unused Apply_Container_Delta() function from CreatePatch.py Change-Id: Id8ad395399ba6b631cf1ad2ecb3ce8b201b95e43 --- diff --git a/mk_delta/common/bin/CreatePatch.py b/mk_delta/common/bin/CreatePatch.py index 566b414..43e7f14 100755 --- a/mk_delta/common/bin/CreatePatch.py +++ b/mk_delta/common/bin/CreatePatch.py @@ -901,79 +901,6 @@ def SS_Generate_Delta(PART_NAME, BASE_OLD, Old_files, Old_dirs, BASE_NEW, New_fi shutil.rmtree(OUT_DIR) -def Apply_Container_Delta(a_apk, b_apk, new_apk, a_folder, g_output_dir): - - # CONTROL NAMES, AND PRINTS AND ERROR CASES... SHOULD NOT PROCEED. - print 'ApplyContainerDelta - ', b_apk, a_folder, g_output_dir - shutil.copy2(g_output_dir + '/' + b_apk, g_output_dir + '/temp') - temp_apk = '../' + g_output_dir + '/' + b_apk - Patch = 'Patch_' + b_apk - ensure_dir_exists(Patch) - shutil.copy2(g_output_dir + '/' + b_apk, Patch + '/' + b_apk) - - # Size issue on Device side?? shd check this - subprocess.call(['unzip', '-q', Patch + '/' + b_apk, '-d', Patch]) - with open(g_output_dir + '/PATCH.txt', 'r') as f_new: - lines = set(f_new.read().splitlines()) - for line in lines: - #print('Action ==> %s' % line) - #Action, Path, Patch = line.split('|') - Items = line.split('|') - Action = Items[0] - Path = Items[1] - ActualPath = a_folder + '/' + Path - PatchPath = Patch + '/' + Path - SrcPath = g_output_dir + '/' + path_leaf(Path) - #print('Action ==> %s Path ==> %s ' % (Action, Path)) - if line[0] == 'c': - patchName = g_output_dir + '/' + Items[2] - #print('Apply Patch: ActualPath %s SrcPath %s PatchLoc %s ' % (PatchPath, ActualPath, patchName)) - subprocess.call([DIFFPATCH_UTIL, ActualPath, ActualPath, patchName]) - WorkingDir = os.getcwd() - os.chdir(WorkingDir + "/" + "temp_a") - subprocess.call(['cp', '--parents', Path, '../' + Patch]) - os.chdir(WorkingDir) - elif line[0] == 's': - WorkingDir = os.getcwd() - os.chdir(WorkingDir + "/" + "temp_a") - subprocess.call(['cp', '--parents', Path, '../' + Patch]) - os.chdir(WorkingDir) - else: - print('Apply_Container_Delta - Unknown Error') - #print('Touch all files and set common attributes for DIFF generation') - WorkingDir = os.getcwd() - os.chdir(WorkingDir + "/" + Patch) - - CONTAINER_DATE = '200011111111.11' - CONTAINER_MODE = '0755' - subprocess.call(['find', '.', '-type', 'l', '-exec', 'rm', '-rf', '{}', ';']) - subprocess.call(['find', '.', '-exec', 'touch', '-t', CONTAINER_DATE, '{}', ';']) - subprocess.call(['chmod', '-R', CONTAINER_MODE, '../' + Patch]) - - print 'Update Intermediate Archive' - #subprocess.call(['zip','-ryX', b_apk, '*']) - subprocess.call(['zip', '-ryX', b_apk] + glob.glob('*')) - os.chdir(WorkingDir) - #print('Apply Path completed - Now create diff for this and place in patch folder') - #print os.getcwd() - print('Patch Applied, Create Final Diff - %s %s' % (g_output_dir + '/' + b_apk, new_apk)) - patchName = ('New' + '_%s' + DIFF_SUFFIX) % (b_apk) - patchLoc = '%s/%s' % (g_output_dir, patchName) - - subprocess.call([DIFF_UTIL, Patch + '/' + b_apk, new_apk, patchLoc]) - - # Only on HOST... for testing - if TEST_MODE == 'TRUE': - UpgradedName = '%s_Upgraded' % (b_apk) - subprocess.call([DIFFPATCH_UTIL, Patch + '/' + b_apk, UpgradedName, patchLoc]) - - # This is file only with NEWS and empty diffs and same files. - if TEST_MODE == 'FALSE': - os.remove(g_output_dir + '/' + b_apk) - os.rename(g_output_dir + '/temp', g_output_dir + '/' + b_apk) - shutil.rmtree(Patch) - - def IsSymlink(info): return (info.external_attr >> 16) == 0120777