Results 1 to 2 of 2

Thread: Packaging help for a beginner

  1. #1
    Join Date
    Jan 2013
    Beans
    1

    Packaging help for a beginner

    Hi everyone.

    This is my first post and I am very new to packaging.

    I have been working on creating packages for a few days now. I am using pbuilder as I want to start off by making my packages as well as I can and not just throwing them together.

    I have been doing a lot of reading and now have my package created.

    My issue is when the package is extracted the file ownership is set as root. I know that these are being set by the machine that created the package.

    How do you set the uids of the files to the user that installed it (user as in who they were before they became root).

    I have extracted the spotify deb and had a look at there postinst file to try and get a feel for how others are doing it.

  2. #2
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Packaging help for a beginner

    Do you use sudo?

    In that case, if you call a script with

    Code:
    sudo script-name
    it will run with the user variable $USER equal to root.

    If you call a script without sudo, but have sudo commands inside it, or call another script with sudo inside it, you can use $USER with the value of the current user. Set an internal variable if you like, and use that value to set the ownership of the files that should be owned by the current user. For example

    Code:
    myname=$USER

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •