From 078334bc5d909f5c4e422fbb7740f9a74cc7ad8f Mon Sep 17 00:00:00 2001 From: Alberto Carretero Date: Fri, 22 Nov 2024 12:15:44 +0100 Subject: [PATCH] fix: remove implicit copyright installation (#170) --- internal/slicer/slicer.go | 11 ----------- internal/slicer/slicer_test.go | 8 +------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/internal/slicer/slicer.go b/internal/slicer/slicer.go index 2991e253..2d4c45e4 100644 --- a/internal/slicer/slicer.go +++ b/internal/slicer/slicer.go @@ -100,8 +100,6 @@ func Run(options *RunOptions) error { extract[slice.Package] = extractPackage } arch := pkgArchive[slice.Package].Options().Arch - copyrightPath := "/usr/share/doc/" + slice.Package + "/copyright" - hasCopyright := false for targetPath, pathInfo := range slice.Contents { if targetPath == "" { continue @@ -119,9 +117,6 @@ func Run(options *RunOptions) error { Path: targetPath, Context: slice, }) - if sourcePath == copyrightPath && targetPath == copyrightPath { - hasCopyright = true - } } else { // When the content is not extracted from the package (i.e. path is // not glob or copy), we add a ExtractInfo for the parent directory @@ -136,12 +131,6 @@ func Run(options *RunOptions) error { }) } } - if !hasCopyright { - extractPackage[copyrightPath] = append(extractPackage[copyrightPath], deb.ExtractInfo{ - Path: copyrightPath, - Optional: true, - }) - } } // Fetch all packages, using the selection order. diff --git a/internal/slicer/slicer_test.go b/internal/slicer/slicer_test.go index 9e232fae..a49fdd97 100644 --- a/internal/slicer/slicer_test.go +++ b/internal/slicer/slicer_test.go @@ -246,7 +246,7 @@ var slicerTests = []slicerTest{{ "/dir/text-file-3": "file 0644 5b41362b {test-package_myslice}", }, }, { - summary: "Copyright is installed", + summary: "Copyright is not installed implicitly", slices: []setup.SliceKey{{"test-package", "myslice"}}, pkgs: []*testutil.TestPackage{{ Name: "test-package", @@ -265,12 +265,6 @@ var slicerTests = []slicerTest{{ filesystem: map[string]string{ "/dir/": "dir 0755", "/dir/file": "file 0644 cc55e2ec", - // Hardcoded copyright entries. - "/usr/": "dir 0755", - "/usr/share/": "dir 0755", - "/usr/share/doc/": "dir 0755", - "/usr/share/doc/test-package/": "dir 0755", - "/usr/share/doc/test-package/copyright": "file 0644 c2fca2aa", }, manifestPaths: map[string]string{ "/dir/file": "file 0644 cc55e2ec {test-package_myslice}",