Merge pull request #93 from qmfrederik/fixes/rpm-null-values

RPM: Support writing null values
This commit is contained in:
Frederik Carlier
2019-04-19 15:30:10 +02:00
committed by GitHub
14 changed files with 92 additions and 40 deletions

View File

@@ -1,6 +1,7 @@
language: csharp
mono: none
dotnet: 2.1.400
dotnet: 2.2.203-1
dist: xenial
branches:
only:

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>netstandard1.5;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<VersionPrefix>0.1.1</VersionPrefix>
<Authors>Frederik Carlier</Authors>
<Company>Quamotion</Company>
@@ -53,10 +53,6 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.5'">
<PackageReference Include="System.Globalization.Extensions" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<Content Include="build\*.*">
<Pack>true</Pack>
@@ -64,20 +60,12 @@
</Content>
<!-- SharpZipLib -->
<Content Include="$(NuGetPackageRoot)\sharpziplib.netstandard\0.86.0.1\lib\netstandard1.3\SharpZipLib.NETStandard.dll" Link="SharpZipLib.NETStandard.dll">
<Pack>true</Pack>
<PackagePath>tools\netstandard1.5\</PackagePath>
</Content>
<Content Include="$(NuGetPackageRoot)\sharpziplib.netstandard\0.86.0.1\lib\netstandard1.3\SharpZipLib.NETStandard.dll" Link="SharpZipLib.NETStandard.dll">
<Pack>true</Pack>
<PackagePath>tools\netstandard2.0\</PackagePath>
</Content>
<!-- Bouncy Castle-->
<Content Include="$(NuGetPackageRoot)\portable.bouncycastle\1.8.1.3\lib\netstandard1.3\BouncyCastle.Crypto.dll" Link="BouncyCastle.Crypto.dll">
<Pack>true</Pack>
<PackagePath>tools\netstandard1.5\</PackagePath>
</Content>
<Content Include="$(NuGetPackageRoot)\portable.bouncycastle\1.8.1.3\lib\netstandard2.0\BouncyCastle.Crypto.dll" Link="BouncyCastle.Crypto.dll">
<Pack>true</Pack>
<PackagePath>tools\netstandard2.0\</PackagePath>

View File

@@ -855,7 +855,14 @@ namespace Packaging.Targets.Rpm
case IndexType.RPM_STRING_ARRAY_TYPE:
foreach (var value in (IEnumerable<string>)record.Value.Value)
{
size += Encoding.UTF8.GetByteCount(value) + 1;
if (value != null)
{
size += Encoding.UTF8.GetByteCount(value) + 1;
}
else
{
size += 1;
}
}
break;

View File

@@ -182,14 +182,16 @@ namespace Packaging.Targets.Rpm
if (value == null)
{
throw new ArgumentNullException(nameof(value));
stream.WriteByte(0x00);
}
else
{
var length = Encoding.UTF8.GetByteCount(value) + 1;
byte[] data = new byte[length];
Encoding.UTF8.GetBytes(value, 0, value.Length, data, 0);
var length = Encoding.UTF8.GetByteCount(value) + 1;
byte[] data = new byte[length];
Encoding.UTF8.GetBytes(value, 0, value.Length, data, 0);
stream.Write(data, 0, data.Length);
stream.Write(data, 0, data.Length);
}
}
}
}

View File

@@ -1,8 +1,8 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Packaging.Targets.TarballTask" AssemblyFile="$(MSBuildThisFileDirectory)..\tools\netstandard1.5\Packaging.Targets.dll" />
<UsingTask TaskName="Packaging.Targets.ZipTask" AssemblyFile="$(MSBuildThisFileDirectory)..\tools\netstandard1.5\Packaging.Targets.dll" />
<UsingTask TaskName="Packaging.Targets.RpmTask" AssemblyFile="$(MSBuildThisFileDirectory)..\tools\netstandard1.5\Packaging.Targets.dll" />
<UsingTask TaskName="Packaging.Targets.DebTask" AssemblyFile="$(MSBuildThisFileDirectory)..\tools\netstandard1.5\Packaging.Targets.dll" />
<UsingTask TaskName="Packaging.Targets.TarballTask" AssemblyFile="$(MSBuildThisFileDirectory)..\tools\netstandard2.0\Packaging.Targets.dll" />
<UsingTask TaskName="Packaging.Targets.ZipTask" AssemblyFile="$(MSBuildThisFileDirectory)..\tools\netstandard2.0\Packaging.Targets.dll" />
<UsingTask TaskName="Packaging.Targets.RpmTask" AssemblyFile="$(MSBuildThisFileDirectory)..\tools\netstandard2.0\Packaging.Targets.dll" />
<UsingTask TaskName="Packaging.Targets.DebTask" AssemblyFile="$(MSBuildThisFileDirectory)..\tools\netstandard2.0\Packaging.Targets.dll" />
<Target Name="CreatePackageProperties" DependsOnTargets="Publish">
<PropertyGroup>

View File

@@ -1,4 +1,4 @@
image: Previous Visual Studio 2017
image: Visual Studio 2017
version: '0.1.{build}'
skip_branch_with_pr: true

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp1.0;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<VersionPrefix>0.1.1</VersionPrefix>
<Authors>Frederik Carlier</Authors>
<Company>Quamotion</Company>
@@ -20,14 +20,14 @@ See https://github.com/qmfrederik/dotnet-packaging/ for more information on how
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.3.4" />
<PackageReference Include="NerdBank.GitVersioning" Version="2.3.38">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Content Include="$(NuGetPackageRoot)\microsoft.extensions.commandlineutils\1.1.1\lib\netstandard1.3\Microsoft.Extensions.CommandLineUtils.dll" Link="Microsoft.Extensions.CommandLineUtils.dll">
<Content Include="$(NuGetPackageRoot)\mcmaster.extensions.commandlineutils\2.3.4\lib\netstandard2.0\McMaster.Extensions.CommandLineUtils.dll" Link="McMaster.Extensions.CommandLineUtils.dll">
<Pack>true</Pack>
<PackagePath>lib\$(TargetFramework)\</PackagePath>
</Content>

11
dotnet-msi/Program.cs Normal file
View File

@@ -0,0 +1,11 @@
namespace Dotnet.Packaging
{
class Program
{
static int Main(string[] args)
{
PackagingRunner runner = new PackagingRunner("Windows Installer package", "CreateMsi");
return runner.Run(args);
}
}
}

View File

@@ -0,0 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp1.0;netcoreapp2.0</TargetFrameworks>
<VersionPrefix>0.1.1</VersionPrefix>
<Authors>Frederik Carlier</Authors>
<Company>Quamotion</Company>
<Copyright>Copyright (c) Frederik Carlier and Contributors</Copyright>
<PackageLicenseUrl>https://github.com/qmfrederik/dotnet-packaging/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/qmfrederik/dotnet-packaging/</PackageProjectUrl>
<RepositoryUrl>https://github.com/qmfrederik/dotnet-packaging/</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>dotnet cli packaging deb debian ubuntu mint installer</PackageTags>
<Description>Create Debian and Ubuntu installers (.deb files ) of your .NET Core projects straight from the command line.
Once you've installed this package as a .NET CLI tool, run dotnet deb to generate a .deb file which contains the publish output of your .NET Project.
See https://github.com/qmfrederik/dotnet-packaging/ for more information on how to use dotnet deb.</Description>
<Product>Packaging Tools for .NET CLI</Product>
<NugetPackageFolder Condition="$(NugetPackageFolder) == ''">$(USERPROFILE)\.nuget\packages</NugetPackageFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
</ItemGroup>
<ItemGroup>
<Content Include="$(NugetPackageFolder)\microsoft.extensions.commandlineutils\1.1.1\lib\netstandard1.3\Microsoft.Extensions.CommandLineUtils.dll" Link="Microsoft.Extensions.CommandLineUtils.dll">
<Pack>true</Pack>
<PackagePath>lib\$(TargetFramework)\</PackagePath>
</Content>
<!-- Required in the package root to run the cli tool always with bundled runtime -->
<Content Include="../prefercliruntime">
<PackagePath>prefercliruntime</PackagePath>
<Pack>true</Pack>
</Content>
</ItemGroup>
<ItemGroup>
<Compile Include="..\dotnet-rpm\PackagingRunner.cs" Link="PackagingRunner.cs" />
</ItemGroup>
</Project>

View File

@@ -1,4 +1,4 @@
using Microsoft.Extensions.CommandLineUtils;
using McMaster.Extensions.CommandLineUtils;
using System;
using System.Diagnostics;
using System.Text;

View File

@@ -1,4 +1,4 @@
using Microsoft.Extensions.CommandLineUtils;
using McMaster.Extensions.CommandLineUtils;
using System;
using System.Diagnostics;
using System.Text;

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp1.0;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<VersionPrefix>0.1.1</VersionPrefix>
<Authors>Frederik Carlier</Authors>
<Company>Quamotion</Company>
@@ -20,14 +20,14 @@ See https://github.com/qmfrederik/dotnet-packaging/ for more information on how
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.3.4" />
<PackageReference Include="NerdBank.GitVersioning" Version="2.3.38">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Content Include="$(NuGetPackageRoot)\microsoft.extensions.commandlineutils\1.1.1\lib\netstandard1.3\Microsoft.Extensions.CommandLineUtils.dll" Link="Microsoft.Extensions.CommandLineUtils.dll">
<Content Include="$(NuGetPackageRoot)\mcmaster.extensions.commandlineutils\2.3.4\lib\netstandard2.0\McMaster.Extensions.CommandLineUtils.dll" Link="McMaster.Extensions.CommandLineUtils.dll">
<Pack>true</Pack>
<PackagePath>lib\$(TargetFramework)\</PackagePath>
</Content>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp1.0;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<VersionPrefix>0.1.1</VersionPrefix>
<Authors>Frederik Carlier</Authors>
<Company>Quamotion</Company>
@@ -20,14 +20,14 @@ See https://github.com/qmfrederik/dotnet-packaging/ for more information on how
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.3.4" />
<PackageReference Include="NerdBank.GitVersioning" Version="2.3.38">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Content Include="$(NuGetPackageRoot)\microsoft.extensions.commandlineutils\1.1.1\lib\netstandard1.3\Microsoft.Extensions.CommandLineUtils.dll" Link="Microsoft.Extensions.CommandLineUtils.dll">
<Content Include="$(NuGetPackageRoot)\mcmaster.extensions.commandlineutils\2.3.4\lib\netstandard2.0\McMaster.Extensions.CommandLineUtils.dll" Link="McMaster.Extensions.CommandLineUtils.dll">
<Pack>true</Pack>
<PackagePath>lib\$(TargetFramework)\</PackagePath>
</Content>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp1.0;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<VersionPrefix>0.1.1</VersionPrefix>
<Authors>Frederik Carlier</Authors>
<Company>Quamotion</Company>
@@ -20,14 +20,14 @@ See https://github.com/qmfrederik/dotnet-packaging/ for more information on how
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.3.4" />
<PackageReference Include="NerdBank.GitVersioning" Version="2.3.38">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Content Include="$(NuGetPackageRoot)\microsoft.extensions.commandlineutils\1.1.1\lib\netstandard1.3\Microsoft.Extensions.CommandLineUtils.dll" Link="Microsoft.Extensions.CommandLineUtils.dll">
<Content Include="$(NuGetPackageRoot)\mcmaster.extensions.commandlineutils\2.3.4\lib\netstandard2.0\McMaster.Extensions.CommandLineUtils.dll" Link="McMaster.Extensions.CommandLineUtils.dll">
<Pack>true</Pack>
<PackagePath>lib\$(TargetFramework)\</PackagePath>
</Content>