Home | History | Annotate | Download | only in applypatch

Lines Matching full:source_file

42 static int GenerateTarget(FileContents* source_file,
653 FileContents source_file;
657 // We try to load the target file into the source_file object.
658 if (LoadFileContents(target_filename, &source_file) == 0) {
659 if (memcmp(source_file.sha1, target_sha1, SHA_DIGEST_LENGTH) == 0) {
667 if (source_file.data.empty() ||
672 source_file.data.clear();
673 LoadFileContents(source_filename, &source_file);
676 if (!source_file.data.empty()) {
677 int to_use = FindMatchingPatch(source_file.sha1, patch_sha1_str, num_patches);
684 source_file.data.clear();
705 return GenerateTarget(&source_file, source_patch_value,
728 FileContents source_file;
737 // Load the target into the source_file object to see if already applied.
741 if (LoadPartitionContents(fullname.c_str(), &source_file) == 0 &&
742 memcmp(source_file.sha1, target_sha1, SHA_DIGEST_LENGTH) == 0) {
749 if (LoadFileContents(source_filename, &source_file) == 0) {
750 if (memcmp(source_file.sha1, target_sha1, SHA_DIGEST_LENGTH) != 0) {
754 short_sha1(source_file.sha1).c_str());
759 if (WriteToPartition(source_file.data.data(), target_size, target_filename) != 0) {
766 static int GenerateTarget(FileContents* source_file,
796 source_to_use = source_file;
831 if (MakeFreeSpaceOnCache(source_file->data.size()) < 0) {
835 if (SaveFileContents(CACHE_TEMP_SOURCE, source_file) < 0) {
872 if (MakeFreeSpaceOnCache(source_file->data.size()) < 0) {
877 if (SaveFileContents(CACHE_TEMP_SOURCE, source_file) < 0) {