Ejemplo n.º 1
0
        private void UpdateAndRecompileCvm(ref VirtualFile cvmFile, VirtualDirectory directory, string hostOutputPath, VirtualDirectory newDvdRootDirectory)
        {
            Log.Builder.Info($"Replacing files in {cvmFile.Name}");

            // Deserialize cvm
            Log.Builder.Trace($"Mounting CVM filesystem: {cvmFile.Name}");
            var cvmDirectory = ConvertCvmToVirtualDirectory(cvmFile);

            // Merge contents
            LogModFilesInDirectory(directory);
            cvmDirectory.Merge(directory, Operation.ReplaceOnly);

            // Recompile cvm
            Log.Builder.Trace($"Building new CVM: {cvmFile.Name} to {hostOutputPath}");
            var cvmModCompiler = new CvmModBuilder();

            cvmFile = ( VirtualFile )cvmModCompiler.Build(cvmDirectory, hostOutputPath);

            cvmFile.MoveTo(newDvdRootDirectory, true);
        }