# Deinstall Warning



## talsamon (Jun 25, 2015)

How to make a "deinstall warning" in  the Makefile of a port?


----------



## SirDice (Jun 25, 2015)

What kind of warning do you mean? Do you have an example?


----------



## kpa (Jun 25, 2015)

You want to use a pkg-deinstall script as outlined in the Porter's Handbook:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/pkg-files.html


----------



## talsamon (Jun 25, 2015)

I want:
If I do `make deinstall` in the port, I want get a warning and it should sleep some time (e.g. 20 seconds). So I had time to interrupt.


----------



## talsamon (Jun 25, 2015)

Thanks, Handbook does not help. But I found a solution. Solved.


----------



## tobik@ (Jun 25, 2015)

talsamon said:


> But I found a solution. Solved.


How? Share how you solved it to prevent this from happening.


----------



## talsamon (Jun 25, 2015)

> How? Share how you solved it to prevent this from happening.


;-))


What the Handbook shows was clear, I had in the moment a problem with the deinstall.

```
.if !target(deinstall)
SLEEP_CMD=  /bin/sleep
deinstall:
  @${ECHO_MSG} "If you delete this port, it will damage something"
  @${SLEEP_CMD} 20
  pkg delete -f port_name
.endif
```


----------

