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

Cannot make file executable in deb package #1015

Open
andrzejpolis-dna opened this issue Apr 26, 2022 · 4 comments
Open

Cannot make file executable in deb package #1015

andrzejpolis-dna opened this issue Apr 26, 2022 · 4 comments

Comments

@andrzejpolis-dna
Copy link

In content section I define a file bin/bar to be installed as /usr/local/bin/foo:

"pkg": {
  "content": {
    "/usr/local/bin/foo" : "bin/bar"
  }
}

Although bin/bar is executable it is not anymore in created deb package.
I checked temporary directory where files are prepared and executable flag is already lost there.

How to make file executable?

@arlac77
Copy link
Owner

arlac77 commented Apr 27, 2022

There is currently no way to specify extra file attributes.
If you have an idea how this should look pleas let me know

@arlac77
Copy link
Owner

arlac77 commented Apr 28, 2022

my idea:

"pkgbuild": {
  "content": {
    "/some/file1.sh" : {
      "name": "build/file1.sh",
      "user": "root",
      "group": "sys",
      "mode": "0755"
    }
  }
}

@andrzejpolis-dna
Copy link
Author

Yes, I was thinking about something like this. You already have similar structure you use to keep these entries internally right?

@andrzejpolis-dna
Copy link
Author

andrzejpolis-dna commented Apr 29, 2022

I found a workaround. It is possible to make it executable through post install. And you have support for that with hooks parameter. So I achieved this with...

"pkgbuild": {
  "content": {
    "/usr/local/bin/foo" : "..."
  },
  "hooks": "debian_hook.sh"
}

And file debian_hook.sh containg:

function post_install() {
  chmod a+x /usr/local/bin/foo
}

Still would be more convenient to have this mode parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants