tpkg / client

tpkg client code
MIT License
5 stars 7 forks source link

Set TPKG_ACTION ENV var on remove or upgrade. #48

Closed visualphoenix closed 9 years ago

visualphoenix commented 9 years ago

Set TPKG_ACTION ENV var on remove or upgrade. This allows for symmetry between preinstall/preremove and postinstall/postremove. It is the complement to the following:

  def unpack(package_file, options={})
    ret_val = 0

    # set env variable to let pre/post install know  whether this unpack
    # is part of an install or upgrade
    if options[:is_doing_upgrade]
       ENV['TPKG_ACTION'] = "upgrade"
    else
       ENV['TPKG_ACTION'] = "install"
    End
jheiss commented 9 years ago

Good idea, thanks