LinuxPath doesn't appear to be working with DebTask #30

Closed
opened 2026-01-29 16:27:42 +00:00 by claunia · 4 comments
Owner

Originally created by @clemensv on GitHub (Jul 4, 2018).

  <ItemGroup>
    <LinuxFolder Include="/etc/myapp" Group="myapp" Owner="myapp" RemoveOnUninstall="true" />
    <Content Include="myapp_config.svc.yml" CopyToOutputDirectory="PreserveNewest"> 
      <LinuxPath>/etc/myapp/myapp_config.yml</LinuxPath>
    </Content>
    <Content Include="myapp_config.machine.yml" CopyToOutputDirectory="PreserveNewest">
      <LinuxPath>/etc/myapp/myapp_config.yml</LinuxPath>
    </Content>
  </ItemGroup>

At present, the two files end up in the application directory and not in /etc.

Originally created by @clemensv on GitHub (Jul 4, 2018). ``` xml <ItemGroup> <LinuxFolder Include="/etc/myapp" Group="myapp" Owner="myapp" RemoveOnUninstall="true" /> <Content Include="myapp_config.svc.yml" CopyToOutputDirectory="PreserveNewest"> <LinuxPath>/etc/myapp/myapp_config.yml</LinuxPath> </Content> <Content Include="myapp_config.machine.yml" CopyToOutputDirectory="PreserveNewest"> <LinuxPath>/etc/myapp/myapp_config.yml</LinuxPath> </Content> </ItemGroup> ``` At present, the two files end up in the application directory and not in /etc.
Author
Owner

@danielmoncada commented on GitHub (Jul 9, 2018):

@clemensv what Linux distro are you using? I'm currently using this feature myself and it works fine. Here's my configuration:

  <ItemGroup>
    <Content Include="my.service" CopyToPublishDirectory="PreserveNewest">
      <LinuxPath>/etc/systemd/system/my.service</LinuxPath>
    </Content>
  </ItemGroup>
@danielmoncada commented on GitHub (Jul 9, 2018): @clemensv what Linux distro are you using? I'm currently using this feature myself and it works fine. Here's my configuration: ```xml <ItemGroup> <Content Include="my.service" CopyToPublishDirectory="PreserveNewest"> <LinuxPath>/etc/systemd/system/my.service</LinuxPath> </Content> </ItemGroup> ```
Author
Owner

@qmfrederik commented on GitHub (Sep 4, 2018):

@clemensv In your case, the files are being ignored because they are empty: https://github.com/qmfrederik/dotnet-packaging/blob/master/Packaging.Targets/ArchiveBuilder.cs#L245

@qmfrederik commented on GitHub (Sep 4, 2018): @clemensv In your case, the files are being ignored because they are empty: https://github.com/qmfrederik/dotnet-packaging/blob/master/Packaging.Targets/ArchiveBuilder.cs#L245
Author
Owner

@claunia commented on GitHub (Jun 26, 2019):

Well for me it's failing also..

  <ItemGroup Condition="$(RuntimeIdentifier.StartsWith('linux')) == false">
    <None Include="../xxxxx-binaries/binary" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="4755"/>
    <None Include="../xxxxx-binaries/lib/*" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="0755" Link="lib\%(Filename)%(Extension)"/>
    <None Include="../xxxxxx-binaries/lib/engines/*" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="0755" Link="lib\engines\%(Filename)%(Extension)"/>
    <LinuxFolder Include="/usr/share/applications" Group="root" Owner="root" RemoveOnUninstall="false" />
    <Content Include="../yyyyy/com.example.desktop" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="0755">
      <LinuxPath>/usr/share/applications/com.example.desktop</LinuxPath>
    </Content>
  </ItemGroup>

All gets copied to publish directory, but the desktop file is not copied to the specified path, that is nonetheless created empty. And yes the desktop file is not empty.

@claunia commented on GitHub (Jun 26, 2019): Well for me it's failing also.. ```xml <ItemGroup Condition="$(RuntimeIdentifier.StartsWith('linux')) == false"> <None Include="../xxxxx-binaries/binary" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="4755"/> <None Include="../xxxxx-binaries/lib/*" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="0755" Link="lib\%(Filename)%(Extension)"/> <None Include="../xxxxxx-binaries/lib/engines/*" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="0755" Link="lib\engines\%(Filename)%(Extension)"/> <LinuxFolder Include="/usr/share/applications" Group="root" Owner="root" RemoveOnUninstall="false" /> <Content Include="../yyyyy/com.example.desktop" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="0755"> <LinuxPath>/usr/share/applications/com.example.desktop</LinuxPath> </Content> </ItemGroup> ``` All gets copied to publish directory, but the desktop file is not copied to the specified path, that is nonetheless created empty. And yes the desktop file is not empty.
Author
Owner

@claunia commented on GitHub (Jun 26, 2019):

Ok found something interesting, in my example above, ../yyyyy/com.example.desktop does not work.
If I move the file to a subfolder inside the project parent folder, like yyyyy/com.example.desktop, it works.

@claunia commented on GitHub (Jun 26, 2019): Ok found something interesting, in my example above, `../yyyyy/com.example.desktop` does not work. If I move the file to a subfolder inside the project parent folder, like `yyyyy/com.example.desktop`, it works.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#30