Skip to content

Commit

Permalink
Merge pull request #111 from xcz1997/master
Browse files Browse the repository at this point in the history
feature DebUOS 打包支持脚本文件
  • Loading branch information
lindexi authored Mar 12, 2024
2 parents fd5c5cc + bb69c33 commit 3a8dd2c
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,42 @@ public string? DebControlFile
get => GetString();
}

/// <summary>
/// 自定义的 DEBIAN\postinst 文件路径,将直接使用该文件作为 postinst 文件,忽略其他配置。这是比较高级的配置,一般不需要使用,可以用来满足更多的定制化需求
/// </summary>
public string? DebPostinstFile
{
set => SetValue(value);
get => GetString();
}

/// <summary>
/// 自定义的 DEBIAN\prerm 文件路径,将直接使用该文件作为 prerm 文件,忽略其他配置。这是比较高级的配置,一般不需要使用,可以用来满足更多的定制化需求
/// </summary>
public string? DebPrermFile
{
set => SetValue(value);
get => GetString();
}

/// <summary>
/// 自定义的 DEBIAN\postrm 文件路径,将直接使用该文件作为 postrm 文件,忽略其他配置。这是比较高级的配置,一般不需要使用,可以用来满足更多的定制化需求
/// </summary>
public string? DebPostrmFile
{
set => SetValue(value);
get => GetString();
}

/// <summary>
/// 自定义的 DEBIAN\preinst 文件路径,将直接使用该文件作为 preinst 文件,忽略其他配置。这是比较高级的配置,一般不需要使用,可以用来满足更多的定制化需求
/// </summary>
public string? DebPreinstFile
{
set => SetValue(value);
get => GetString();
}

/// <summary>
/// 自定义的 opt\apps\${AppId}\info 文件路径,将直接使用该文件作为 info 文件,忽略其他配置。这是比较高级的配置,一般不需要使用,可以用来满足更多的定制化需求
/// </summary>
Expand Down
21 changes: 21 additions & 0 deletions DebUOS/Packaging.DebUOS/DebUOSPackageFileStructCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,5 +312,26 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration)

File.WriteAllText(controlFile, stringBuilder.ToString(), encoding);
}

if (File.Exists(configuration.DebPostinstFile))
{
var postinstFile = Path.Join(packingFolder, "DEBIAN", "postinst");
File.Copy(configuration.DebPostinstFile, postinstFile);
}
if (File.Exists(configuration.DebPrermFile))
{
var prermFile = Path.Join(packingFolder, "DEBIAN", "prerm");
File.Copy(configuration.DebPrermFile, prermFile);
}
if (File.Exists(configuration.DebPostrmFile))
{
var postrmFile = Path.Join(packingFolder, "DEBIAN", "postrm");
File.Copy(configuration.DebPostrmFile, postrmFile);
}
if (File.Exists(configuration.DebPreinstFile))
{
var preinstFile = Path.Join(packingFolder, "DEBIAN", "preinst");
File.Copy(configuration.DebPreinstFile, preinstFile);
}
}
}

0 comments on commit 3a8dd2c

Please sign in to comment.