# updating a port locally how to?



## userxbw (Aug 13, 2019)

I got a few this one for example that I am already trying to "update" locally, but editing the make files and what other files I find in its dir to use the current version . I did this before, I forget what app it was, it did not work. But I am doing it again. 

it is bender, the current one is 2.79b and blender is now 2.8 so I changed the files 


```
root@FreeBSD64:/usr/ports/graphics/blender # ls
Makefile            distinfo
Makefile.options        distinfo.orginal
Makefile.options.orginal    files
Makefile.orginal        pkg-descr
Makefile.versions        pkg-plist
Makefile.versions.orginal
```
changing the verion to 2.8

```
PORTNAME=    blender
PORTVERSION=    2.8
PORTREVISION=    14
```
that portversion=14 is that going to be an issue.

and is this even a valid way to get an update? 

I remember other one I tried needed an address to the source and i tried giving it a current address to the current version of source and that caused it to fail. I do not remember the particular other than that. 

Anyways, what is if there is a correct way to do this, what is it?


----------



## moridin (Aug 13, 2019)

Porters handbook should be able to answer (almost) all of the questions you have, see https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/port-upgrading.html.


----------



## SirDice (Aug 13, 2019)

What I normally do in a situation like this

```
pkg install blender
pkg delete blender
```
This looks like a no-op but the first _install_ will also install all required _run_ dependencies. You then remove only the blender package itself. That way you don't have to build a ton of dependencies too.

In your modified port directory do `make missing`. You may need to install a few _build_ dependencies first. 
Change the version first, then run `make makesum`. This will download the source code and generate the hash for distfiles. 
Run a `make patch`. This will extract the source and apply any patches from files/ or in the Makefile itself. You may need to fix any patching issues that come up.
Then a loop of `make clean` and `make` until you get it to build cleanly, fixing issues as they come up.
`mv pkg-plist pkg-plist.orig` and run `make makeplist > pkg-plist`. EDIT pkg-plist! Compare it with the .orig.


----------



## userxbw (Aug 13, 2019)

SirDice said:


> What I normally do in a situation like this
> 
> ```
> pkg install blender
> ...



ok now I am stuck,  what am I to write here to get the patch to work?

```
root@FreeBSD64:/usr/ports/graphics/blender # cat distinfo
TIMESTAMP = 1565732070
SHA256 (blender-2.80.tar.gz) = cd9d7e505c1f6e63a4f72366ed04d446859977eeb34cde21283aaea6a304a5c0
SIZE (blender-2.80.tar.gz) = 54216321
root@FreeBSD64:/usr/ports/graphics/blender # make patch
===>  Patching for blender-2.80
===>  Applying FreeBSD patches for blender-2.80
File to patch: Makefile
No file found--skip this patch? [n] 
patch: **** can't find Makefile
=> FreeBSD patch patch-ffmpeg4 failed to apply cleanly.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/graphics/blender
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/blender
root@FreeBSD64:/usr/ports/graphics/blender # make patch
===>  Patching for blender-2.80
===>  Applying FreeBSD patches for blender-2.80
File to patch: ffmpeg4
No file found--skip this patch? [n] 
patch: **** can't find ffmpeg4
=> FreeBSD patch patch-ffmpeg4 failed to apply cleanly.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/graphics/blender
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/blender
```


----------



## rigoletto@ (Aug 13, 2019)

userxbw said:


> => FreeBSD patch patch-ffmpeg4 failed to apply cleanly.



You need to look why the patch is failing, and either remove it if the patch was up-streamed (or just not needed anymore) or re-write the patch to apply to the new source code.

*[EDIT]*

See PR 239589.


----------



## userxbw (Aug 13, 2019)

it looks to be in a holding patteren and mw trying to supersed that would be foolish.


----------

