pkgtool: files created by doinst.sh cause warnings when do removepkg - Slackware

This is a discussion on pkgtool: files created by doinst.sh cause warnings when do removepkg - Slackware ; Hi, If I add some statement in doinst.sh to create some additional files in my installation directory, these files will not be removed by 'removepkg' and will cause many unpleasing warnings. Do you get any workaroud? Thanks. - woody...

+ Reply to Thread
Results 1 to 9 of 9

Thread: pkgtool: files created by doinst.sh cause warnings when do removepkg

  1. pkgtool: files created by doinst.sh cause warnings when do removepkg

    Hi,

    If I add some statement in doinst.sh to create some additional files
    in my installation directory, these files will not be removed by
    'removepkg' and will cause many unpleasing warnings. Do you get any
    workaroud? Thanks.

    -
    woody

  2. Re: pkgtool: files created by doinst.sh cause warnings when do removepkg

    On 2008-08-29, Steven Woody wrote:
    >
    > If I add some statement in doinst.sh to create some additional files
    > in my installation directory, these files will not be removed by
    > 'removepkg' and will cause many unpleasing warnings. Do you get any
    > workaroud? Thanks.



    Unless they're config files, you probably shouldn't be doing that.
    It's a feature, not a bug, that removepkg(8) doesn't remove files
    that were not contained in the package.

    If you *want* the files to be removed with the package, then the
    proper way to handle it is to create "dummy" files inside the
    package. For example, in the SlackBuild script, do something like
    this:
    touch /some/file
    Then, in the doinst.sh, do something like this:
    /some/binary_that_does_something > /some/file

    Of course, I might not understand what you're trying to do, so
    if that's not appropriate, give me some more information about
    the situation.

    -RW

  3. Re: pkgtool: files created by doinst.sh cause warnings when doremovepkg

    On Aug 29, 12:08 pm, Robby Workman wrote:
    > On 2008-08-29, Steven Woody wrote:
    >
    >
    >
    > > If I add some statement in doinst.sh to create some additional files
    > > in my installation directory, these files will not be removed by
    > > 'removepkg' and will cause many unpleasing warnings. Do you get any
    > > workaroud? Thanks.

    >
    > Unless they're config files, you probably shouldn't be doing that.
    > It's a feature, not a bug, that removepkg(8) doesn't remove files
    > that were not contained in the package.
    >
    > If you *want* the files to be removed with the package, then the
    > proper way to handle it is to create "dummy" files inside the
    > package. For example, in the SlackBuild script, do something like
    > this:
    > touch /some/file
    > Then, in the doinst.sh, do something like this:
    > /some/binary_that_does_something > /some/file
    >
    > Of course, I might not understand what you're trying to do, so
    > if that's not appropriate, give me some more information about
    > the situation.
    >
    > -RW


    Ok, I understand. I should create these symbol links in SlackBuild
    before it call 'mkpackage'. Thanks.

  4. Re: pkgtool: files created by doinst.sh cause warnings when do removepkg

    Steven Woody wrote:
    > On Aug 29, 12:08 pm, Robby Workman wrote:
    >
    >>On 2008-08-29, Steven Woody wrote:
    >>
    >>
    >>
    >>
    >>>If I add some statement in doinst.sh to create some additional files
    >>>in my installation directory, these files will not be removed by
    >>>'removepkg' and will cause many unpleasing warnings. Do you get any
    >>>workaroud? Thanks.

    >>
    >>Unless they're config files, you probably shouldn't be doing that.
    >>It's a feature, not a bug, that removepkg(8) doesn't remove files
    >>that were not contained in the package.
    >>
    >>If you *want* the files to be removed with the package, then the
    >>proper way to handle it is to create "dummy" files inside the
    >>package. For example, in the SlackBuild script, do something like
    >>this:
    >> touch /some/file
    >>Then, in the doinst.sh, do something like this:
    >> /some/binary_that_does_something > /some/file
    >>
    >>Of course, I might not understand what you're trying to do, so
    >>if that's not appropriate, give me some more information about
    >>the situation.
    >>
    >>-RW

    >
    >
    > Ok, I understand. I should create these symbol links in SlackBuild
    > before it call 'mkpackage'. Thanks.


    I think you mean `makepkg,' but yes that's what you should do. makepkg
    offers you the option to remove symbolic links from the package and
    the place the creation of them into the doinst.sh script. This feature
    was added to Slackware's package tools to work around a bug in tar that
    would cause symbolic links in subdirectories to be mishandled. That bug
    was fixed 12 or 13 years ago, but the package tools still offer to
    handle links via the doinst.sh script...

  5. Re: pkgtool: files created by doinst.sh cause warnings when do removepkg

    In article ,
    Chris Sorenson wrote:

    > I think you mean `makepkg,' but yes that's what you should do. makepkg
    > offers you the option to remove symbolic links from the package and
    > the place the creation of them into the doinst.sh script. This feature
    > was added to Slackware's package tools to work around a bug in tar that
    > would cause symbolic links in subdirectories to be mishandled. That bug
    > was fixed 12 or 13 years ago, but the package tools still offer to
    > handle links via the doinst.sh script...


    I wonder why has this not been changed, then. Does that way of handling
    symlinks offer other advantages that I'm not aware of? Maybe Robby or
    someone else in the know can comment...

    - M.

  6. Re: pkgtool: files created by doinst.sh cause warnings when do removepkg

    Martijn Dekker wrote:
    > In article ,
    > Chris Sorenson wrote:
    >
    >
    >>I think you mean `makepkg,' but yes that's what you should do. makepkg
    >>offers you the option to remove symbolic links from the package and
    >>the place the creation of them into the doinst.sh script. This feature
    >>was added to Slackware's package tools to work around a bug in tar that
    >>would cause symbolic links in subdirectories to be mishandled. That bug
    >>was fixed 12 or 13 years ago, but the package tools still offer to
    >>handle links via the doinst.sh script...

    >
    >
    > I wonder why has this not been changed, then. Does that way of handling
    > symlinks offer other advantages that I'm not aware of? Maybe Robby or
    > someone else in the know can comment...
    >
    > - M.


    I'm not sure Pat isn't convinced the bug isn't still there. It used to
    crop up only on symlinks in very deeply nested subdirectories, and some
    of the big Slackware packages have those. Slackware's handling of
    symlinks from doinst.sh always works though...

  7. Re: pkgtool: files created by doinst.sh cause warnings when do removepkg

    On 2008-08-30, Martijn Dekker wrote:
    > In article ,
    > Chris Sorenson wrote:
    >
    >> I think you mean `makepkg,' but yes that's what you should do. makepkg
    >> offers you the option to remove symbolic links from the package and
    >> the place the creation of them into the doinst.sh script. This feature
    >> was added to Slackware's package tools to work around a bug in tar that
    >> would cause symbolic links in subdirectories to be mishandled. That bug
    >> was fixed 12 or 13 years ago, but the package tools still offer to
    >> handle links via the doinst.sh script...

    >
    > I wonder why has this not been changed, then. Does that way of handling
    > symlinks offer other advantages that I'm not aware of? Maybe Robby or
    > someone else in the know can comment...



    As an exercise, do this in a directory somewhere:
    touch libsomething.so.1.0
    ln -s libsomething.so.1.0 libsomething.so.1
    ln -s libsomething.so.1 libsomething.so
    ls -l

    You should see something like this:
    lrwxrwxrwx 1 rworkman rworkman 17 2008-08-30 18:44 libsomething.so -> libsomething.so.1
    lrwxrwxrwx 1 rworkman rworkman 19 2008-08-30 18:44 libsomething.so.1 -> libsomething.so.1.0
    -rw-r--r-- 1 rworkman rworkman 0 2008-08-30 18:44 libsomething.so.1.0

    Now, the failure case for adding symlink creation directly to the
    doinst.sh manually won't really apply for shared objects, but it
    will for symlinks to directories and other types of files:
    To demonstrate, do this:
    touch file1
    mkdir file2
    The "file2" is to simulate an already existing directory on the system
    ln -s file1 file2
    What you'll have now is something like this:
    liberty $ ls -l
    -rw-r--r-- 1 rworkman rworkman 0 2008-08-30 18:47 file1
    drwxr-xr-x 2 rworkman rworkman 8 2008-08-30 18:47 file2/
    liberty $ ls -l file2
    lrwxrwxrwx 1 rworkman rworkman 5 2008-08-30 18:47 file1 -> file1

    Notice that the symlink actually got created inside the "file2" directory
    as opposed to what you (probably) wanted; that is, for the file2 symlink
    to point at file1.

    Now, if you'll look at what makepkg(8) does in creating the symlink,
    it first writes a removeal line for the destination, and then it does
    the actual creation. IOW, the above would have been handled like this:
    ( cd /somedir ; rm -rf file2 )
    ( cd /somedir ; ln -s file1 file2 )

    Did all that make sense?

    -RW

  8. Re: pkgtool: files created by doinst.sh cause warnings when do removepkg

    In article ,
    Robby Workman wrote:

    > Now, if you'll look at what makepkg(8) does in creating the symlink,
    > it first writes a removeal line for the destination, and then it does
    > the actual creation. IOW, the above would have been handled like this:
    > ( cd /somedir ; rm -rf file2 )
    > ( cd /somedir ; ln -s file1 file2 )
    >
    > Did all that make sense?


    Yes, thank you.

    Do you think there might be an argument for having package installation
    fail gracefully if the package attempts to replace a directory with a
    symlink, rather than silently deleting the directory and its contents?

    - M.

  9. Re: pkgtool: files created by doinst.sh cause warnings when do removepkg

    On 2008-09-03, Martijn Dekker wrote:
    > In article ,
    > Robby Workman wrote:
    >
    >> Now, if you'll look at what makepkg(8) does in creating the symlink,
    >> it first writes a removeal line for the destination, and then it does
    >> the actual creation. IOW, the above would have been handled like this:
    >> ( cd /somedir ; rm -rf file2 )
    >> ( cd /somedir ; ln -s file1 file2 )
    >>
    >> Did all that make sense?

    >
    > Yes, thank you.
    >
    > Do you think there might be an argument for having package installation
    > fail gracefully if the package attempts to replace a directory with a
    > symlink, rather than silently deleting the directory and its contents?



    Well, I'm inclined to say no. It's a corner case that should *never*
    occur within a -stable tree (i.e. slackware-$VERSION/patches/*), and
    in the rare instance where it occurs in -current, we handle it on a
    per-package basis. For example, it has been an issue with apache/httpd
    in the past (and some here can vouch for that) ;-)

    I would expect any other cases where this occurs to be the result of
    local changes by the system administrator, and if that's the case,
    then the sysadmin needs to be more judicious IMHO. Of course,
    if you're aware of other failure cases that I've not considered,
    please enlighten me.

    -RW

+ Reply to Thread