Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deb: create subfolders and use GNU tar format #8

Merged
merged 7 commits into from
Feb 25, 2018

Conversation

caarlos0
Copy link
Member

@caarlos0 caarlos0 commented Feb 25, 2018

closes #6

tl;dr: the problem was in the data.tar.gz, which had only the files, but not the folders themselves.

I had to walk through the desired path and create the headers inside the tar file, which fixes the issue as it seems.

drwxr-xr-x  0 0      0           0 Dec 31  1969 usr/
drwxr-xr-x  0 0      0           0 Dec 31  1969 usr/bin/
-rwxr-xr-x  0 0      0     1034959 Feb 25 14:58 usr/bin/rclone
drwxr-xr-x  0 0      0           0 Dec 31  1969 usr/
drwxr-xr-x  0 0      0           0 Dec 31  1969 usr/share/
drwxr-xr-x  0 0      0           0 Dec 31  1969 usr/share/doc/
drwxr-xr-x  0 0      0           0 Dec 31  1969 usr/share/doc/rclone/
-rw-r--r--  0 0      0        3267 Feb 25 14:58 usr/share/doc/rclone/README.txt
drwxr-xr-x  0 0      0           0 Dec 31  1969 usr/
drwxr-xr-x  0 0      0           0 Dec 31  1969 usr/share/
drwxr-xr-x  0 0      0           0 Dec 31  1969 usr/share/man/
drwxr-xr-x  0 0      0           0 Dec 31  1969 usr/share/man/man1/
-rw-r--r--  0 0      0      355170 Feb 25 14:58 usr/share/man/man1/rclone.1

before that , we had:

-rwxr-xr-x  0 0      0     1034959 Feb 25 14:58 usr/bin/rclone
-rw-r--r--  0 0      0        3267 Feb 25 14:58 usr/share/doc/rclone/README.txt
-rw-r--r--  0 0      0      355170 Feb 25 14:58 usr/share/man/man1/rclone.1

as a bonus, I also changed the format of the headers to GNU format.


TODO:

  • avoid duplicating the paths (usr/ header is added several times)
  • betere cover it with tests

@codecov-io
Copy link

codecov-io commented Feb 25, 2018

Codecov Report

Merging #8 into master will decrease coverage by 5.65%.
The diff coverage is 84.9%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #8      +/-   ##
==========================================
- Coverage   71.53%   65.87%   -5.66%     
==========================================
  Files           3        4       +1     
  Lines         274      337      +63     
==========================================
+ Hits          196      222      +26     
- Misses         39       74      +35     
- Partials       39       41       +2
Impacted Files Coverage Δ
deb/deb.go 73.68% <84.9%> (+3.19%) ⬆️
cmd/nfpm/main.go 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fb90ad...24b75ec. Read the comment docs.

@caarlos0
Copy link
Member Author

drwxr-xr-x  0 0      0           0 Feb 25 17:35 usr/
drwxr-xr-x  0 0      0           0 Feb 25 17:35 usr/bin/
-rwxr-xr-x  0 0      0     1034959 Feb 25 17:35 usr/bin/rclone
drwxr-xr-x  0 0      0           0 Feb 25 17:35 usr/share/
drwxr-xr-x  0 0      0           0 Feb 25 17:35 usr/share/doc/
drwxr-xr-x  0 0      0           0 Feb 25 17:35 usr/share/doc/rclone/
-rw-r--r--  0 0      0        3267 Feb 25 17:35 usr/share/doc/rclone/README.txt

looks great now!

@caarlos0
Copy link
Member Author

λ docker run -v $PWD:/tmp -it ubuntu dpkg -i /tmp/rclone.deb
Selecting previously unselected package rclone.
(Reading database ... 4768 files and directories currently installed.)
Preparing to unpack /tmp/rclone.deb ...
Unpacking rclone (1.39) ...
Setting up rclone (1.39) ...

@caarlos0 caarlos0 merged commit 3c6c7d3 into master Feb 25, 2018
@caarlos0 caarlos0 deleted the fix-subfolders branch February 25, 2018 20:36
@caarlos0
Copy link
Member Author

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@goreleaser goreleaser locked as resolved and limited conversation to collaborators Nov 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.deb not creating directories for files to go in
2 participants