# Restoring old portsnap entry



## balanga (Jan 13, 2018)

I recently ran `portsnap fetch update` forgetting that it would update multimedia/webcamd and now I am unable to build webcamd which works with my DVB-T TV dongle. It did work previously using v4.8.0, but it won't work with the latest version, v4.12.0.

Is there any way to restore the old entry?


----------



## SirDice (Jan 13, 2018)

Not by using portsnap(8). It is much easier to track and revert changes if you use subversion for the ports tree.


----------



## balanga (Jan 14, 2018)

SirDice said:


> Not by using portsnap(8). It is much easier to track and revert changes if you use subversion for the ports tree.



Any chance of an example of how to do this? I couldn't find a portsnap repository which I could use with svn... I've only ever used `portsnap fetch` etc.


----------



## marino (Jan 14, 2018)

you don't use svn with portsnap.  If you use SVN, you update the ports tree with svn (meaning you ignore portsnap tool completely).
He's not implying you can use subversion with portsnap images.


----------



## fernandel (Jan 14, 2018)

balanga said:


> I recently ran `portsnap fetch update` forgetting that it would update multimedia/webcamd and now I am unable to build webcamd which works with my DVB-T TV dongle. It did work previously using v4.8.0, but it won't work with the latest version, v4.12.0.
> 
> Is there any way to restore the old entry?



I am using ports-mgmt/portdowngrade


----------



## ls4680 (Jul 19, 2018)

SirDice said:


> Not by using portsnap(8). It is much easier to track and revert changes if you use subversion for the ports tree.



Does this mean that I can NOT use svn to get older versions of the ports tree if I originally use portsnap?

I recently updated my ports tree using portsnap fetch update.  I had previously successfully built multimedia/vlc (2.2.6) but after the update multimedia/vlc (2.2.8) no longer builds (various errors that I have tried many things to resove with no luck).  I need to build multimedia/vlc (2.2.6) so that I can then apply custom patches.

I have found an old post on another site that suggests "svn update -r {2018-04-15} "  but this returns the error "svn: E205000: Syntax error in revision argument '2018-04-15'"

How would a get a previous version of the ports tree so I can rebuild like I did a couple of months ago and all depencicies are also correct versions?


----------



## rigoletto@ (Jul 20, 2018)

If you want to have version control over ports tree you should remove/delete ( It is also possible to keep a separated svn tree on a different place but it will make the things more complicated ) all portsnap data in the tree ( aka /usr/ports ), checkout it with svn, and forget about portsnap.

If you just need one or a few ports from a different revision(s) you do not need to later update the entire tree to that specific revision but the ones you want.

First thing is to find the correct revision number ( lets say it is 473503 ), then `svn -r 473503 /path/to/the/port`.

But be aware what you are willing to do will eventually break ( or be broken already ) some other stuff due to dependency changing, and you should be savvy enough to keep your local working copy of the tree going on with your customization.

*[EDIT]*
Btw, the current multimedia/webcamd version on ports is 4.17.0.3


----------



## rigoletto@ (Jul 20, 2018)

ls4680

How are you building ports? I've just built multimedia/vlc on 10.4R, 11.1R and 11.2R on ports-mgmt/poudriere without any problem, and so it is quite safe to assume there is something wrong on your installation, or how you are managing it.

I guess you are using something like ports-mgmt/portmaster or ports-mgmt/portupgrade, and so be aware both do not automatically take care of things like ABI changes and so it is up to you to know when, what, and how to fix those things.

I do recommend ports-mgmt/synth that ( always ) do everything right ( as good as poudriere but without the complications you apparently don't need ). SYNTH.

Cheers!


----------



## Chris_H (Jul 20, 2018)

devel/subversion came up with some really stupid (short sighted) syntax. For first time, or new(ish) users. svn up means your updating (getting the newest version). Right? Well maybe. up is a synonym, oh wait, that's antinym , called _down_. Meaning; that "up" can go in reverse -- you can "upgrade' to an _older_ version. Makes sense. Right? <roll eyes>.
Anyway. Have a look at the web based FreeBSD svn repo for webcamd:
webcamd at the FreeBSD svn repo
Search through the Makefiles for the version you're interested in, and you'll then know the revision number you want to "svn up" to. 
You don't need to actually svn up your ports tree to accomplish all this. In fact, I'd discourage *against that*.
Perform the following in your home directory:

```
mkdir ports

$ svn co --depth empty -r 412346 svn://svn.freebsd.org/ports/head ports
$ svn up --set-depth empty -r 412346 ports/multimedia
$ svn up -r 412346 ports/multimedia/webcamd
```
You'll now have a tree with _just_ the webcamd port, at the revision you want.
IMPORTANT: that number in that svn command, is the "revision" number you will need to find.
it is *not* the actual number you need. But an example of how to _use_ the revision number! 
Once you've figured that out, and have _actually_ accomplished that. You can simply pkg(8) deinstall/delete webcamd (recursively), and move to your new webcamd port tree, and build, and install it. 

HTH

Feel free to ask, if you run into any problems. 

--Chris


----------



## ls4680 (Jul 20, 2018)

lebarondemerde said:


> ls4680
> 
> How are you building ports? .......



After original install of FreeBSD 11.1 I did *portsnap fetch*, *portsnap install* then *cd /usr/ports/multimedia/vlc* then *make *.... no problems
About a month ago I did *portsnap fetch,* *portsnap update* then *cd /usr/ports/multimedia/vlc* then *make*....... no problems......
A few days ago I did *portsnap fetch*, *portsnap update *then *cd /usr/ports/multimedia/vlc* then *make* ..... now I get 


> /usr/local/lib/qt5/bin/uic -tr "Q_" ui/open_file.ui >> ui/open_file.h.tmp
> /usr/local/lib/qt5/libQt5Core.so.5: version Qt_5.10 required by /usr/local/lib/qt5/bin/uic not found
> gmake[8]: *** [Makefile:3475: ui/equalizer.h] Error 1
> gmake[8]: *** Waiting for unfinished jobs....
> ...



I have tried several solutions including:
*set MAKE_JOBS_UNSAFE=yes *
removing all dependicies and rebuilding again
removing all dependicies and adding them via pkg install
vlc will still not build.......  

I am now trying: 
*rm -r /usr/ports
svn checkout https://svn.FreeBSD.org/ports/head /usr/ports
cd /user/ports/multimedia/vlc
make *
.....I still get compile errors. 

Looking for the command to svn an older copy of ports.


----------



## ls4680 (Jul 20, 2018)

lebarondemerde said:


> First thing is to find the correct revision number ......



How would I find the correct revision number of a previous version of the ports tree (about 2018-04-18) or the revision number of multimedia/vlc 2.2.6?


----------



## Chris_H (Jul 20, 2018)

Here
But I already gave you that link. But this one is more specific. 
Just scroll to the approximate date your looking for, until you hit the right Version. Then use the revision number from that. 
The reason for the error you're seeing (posted one up from your last post) is becuase you don't have QT version *5* installed, or revision, thereof.
You could probably overcome that by installing whatever the newest version of QT5 is in your ports tree. Then try installing VLC again. First performing make clean recursive.

HTH

--Chris


----------



## rigoletto@ (Jul 20, 2018)

ls4680 said:


> After original install of FreeBSD 11.1 I did *portsnap fetch*, *portsnap install* then *cd /usr/ports/multimedia/vlc* then *make *.... no problems
> About a month ago I did *portsnap fetch,* *portsnap update* then *cd /usr/ports/multimedia/vlc* then *make*....... no problems......
> A few days ago I did *portsnap fetch*, *portsnap update *then *cd /usr/ports/multimedia/vlc* then *make* ..... now I get



`make` is not really a good tool to use to *manage* ports.

In other words if you continue managing ports the way you are this kind of problem will happen all the time. As I told you before there is no problem with multimedia/vlc port since I built it ( using `poudriere testport` in fact ) on all supported versions. Basically you are doing it wrong. 

So, my advise is instead of losing time trying to fix what is not broken, get a proper tool for the job. I think ports-mgmt/synth is the best one for the end user. It does everything *strictly* in the way it should be, but there are many others.

*[EDIT]*

If you go for Synth just avoid using `synth upgrade-system`, and use `synth prepare-system` + `pkg upgrade` instead.

Both does basically the same but the first issue pkg to install the updates automatically, what is fine and very convenient until some silly dependency fail to build.

Synth delete the packages to be built from its repository before it start building them, and when some dependency fail it will not be in there (in the repository) anymore and when pkg be issued it will remove that dependency and everything what depends on it .You can easily end up without half of your packages using `synth upgrade-system`. 

So, the best way to fix your system IMO is:

`pkg install synth` (does not bother to build it from source now)
Configure synth as pointed in the GitHub page.
`synth prepare-system`
*log as root*
`pkg prime-origins > pkglist`
While in there edit the pkglist file and remove the ports you do not want
`pkg delete -af`
`pkg install `cat pkglist``

Now you are ready to go, with a proper tool for managing ports, and can still use portsnap.


----------



## Chris_H (Jul 20, 2018)

I have to agree with lebarondemerde , that ports-mgmt/synth is the best tool for a ports management tool.
But I manage a lot of systems. So I (usually) use a server with a couple of dedicated jail(8)s set aside for building up custom systems (software groups), and I simply run build scripts to accomplish the task. I'm also a (ports) maintainer. So the jails work well for testing. IOW I'm comfortable with make(1) and all it (can) provide. Which may well be out of other users "comfort zone". 

--Chris


----------



## ls4680 (Jul 20, 2018)

I have been using FreeBSD since 1998 and have always used [FONT=Courier New]`make`[/FONT] which normally works well for my situation so I never bothered to look for newer methods.  Thanks for the education. I used `synth`last night and it successfully built 600+ ports in about 9:30 hours, generic vlc is running again.  However, remember that my original task is that I have custom patches that were written for vlc 2.2.6 (and I also succussfully patched vlc 2.2.8) need to be applied and for this I need to be able to build vlc using `make`.  Current version of vlc in the ports is now 2.2.8_6,4  and after `synth`"fixed" everything else I still can not `make`vlc 2.2.8_6,4


> . . .
> /usr/local/lib/qt5/bin/moc -DHAVE_CONFIG_H -I../../../include -I../../../include -I../../..    -o styles/seekstyle.moc.cpp styles/seekstyle.hpp
> mkdir -p -- ui
> mkdir -p -- ui
> ...



I had no problems before updating my ports tree a few days ago.  I will also look into `poudriere`


----------



## Chris_H (Jul 20, 2018)

The (LIB|RUN)DEPENDS is NOT being satisfied. THAT's the problem. I mentioned that earlier. Either QT version 5.10 is NOT installed, or it isn't DEFINED correctly (spelling/extraneous spaces/characters, etc...). If I were you, and wanted to continue down the path you're attempting to take. _That's_ where _I'd_ be looking. 

HTH

--Chris


----------



## rigoletto@ (Jul 20, 2018)

If you share the patch we could help you more with it.


----------



## ShelLuser (Jul 20, 2018)

lebarondemerde said:


> `make` is not really a good tool to use to *manage* ports.


Of course not, that's what portsnap is for.

More seriously though: I have to disagree with you here. There is nothing wrong with using make, but what can cause problems over time is ports (re)using libraries installed by other ports which eventually can cause issues. This is why some ports start to insist that you uninstall them before trying to build them again.

Even so, the solution is often very easy: a jail.

A jail can give you a fully clean build environment and after building the packages there you can then install them as binary packages on your main host. Problem solved. Using this methodology will even allow you to continue to use make just as before.

It's not the "make methodology" which is causing problems, it's the way some ports start to misbehave combined with some "pollution" which gathers on the host over time.


----------



## ls4680 (Jul 20, 2018)

Thanks for your help, I am still working through the suggestions provided........  The problem is that I can NOT do a `make` to the clean port even before applying the patches so I am sure that if I applied the patches I would still have the same underlying problem. 


> pkg version | grep qt5
> qt5-5.10.1_1                       =
> qt5-3d-5.10.1                      =
> qt5-assistant-5.10.1               =
> ...





> /usr/local/lib/qt5#ll libQt5Core*
> -rw-r--r--  1 root  wheel     1213 Jul 17 21:33 libQt5Core.prl
> lrwxr-xr-x  1 root  wheel       20 Jul 17 21:33 libQt5Core.so@ -> libQt5Core.so.5.10.1
> lrwxr-xr-x  1 root  wheel       20 Jul 17 21:33 libQt5Core.so.5@ -> libQt5Core.so.5.10.1
> ...





> /usr/local/lib/qt5/bin/moc -DHAVE_CONFIG_H -I../../../include -I../../../include -I../../..    -o util/buttons/DeckButtonsLayout.moc.cpp util/buttons/DeckButtonsLayout.hpp
> /usr/local/lib/qt5/bin/moc -DHAVE_CONFIG_H -I../../../include -I../../../include -I../../..    -o util/buttons/BrowseButton.moc.cpp util/buttons/BrowseButton.hpp
> /usr/local/lib/qt5/bin/moc -DHAVE_CONFIG_H -I../../../include -I../../../include -I../../..    -o styles/seekstyle.moc.cpp styles/seekstyle.hpp
> mkdir -p -- ui
> ...



To me the easiest (though admittedly not the best) solution  would be to use the earlier ports tree that built with out problems.  As far as I know the only thing that I did to break this is that a few days ago I did `portsnap fetch update`


----------



## Chris_H (Jul 20, 2018)

ShelLuser said:


> Even so, the solution is often very easy: a jail.
> 
> A jail can give you a fully clean build environment and after building the packages there you can then install them as binary packages on your main host. Problem solved. Using this methodology will even allow you to continue to use make just as before.
> 
> It's not the "make methodology" which is causing problems, it's the way some ports start to misbehave combined with some "pollution" which gathers on the host over time.


+5 couldn't agree more; where using a jail(8) is concerned!
I do *all* development in them, and services are well served from a jail as well.

Thanks FreeBSD (Poul)!

--Chris


----------



## rigoletto@ (Jul 20, 2018)

ShelLuser

`Make` is the tool for building ports, `portsnap` is the one to manage the ports tree. None of them help you to manage your installed ports and keep them properly upgraded. If you do not use some tool (like Synth or Poudriere, or SOMETOOL) it would be all up to you to find every problem on the installed ports.

But yeah, you can use it for years with many things broken without any major/visible problem because fortunately you never hit the breakage point.

ls4680

multimedia/vlc is flavored to use `make clean` you should tell what flavor should be cleaned, ie:

`make FLAVOR=qt5 clean`

or just delete the work directory. 

The problem of _locking_ the port version would be the dependencies updating, and sooner or later that will be broken too...



ls4680 said:


> The problem is that I can NOT do a  make  to the clean port even before applying the patches so I am sure that if I applied the patches I would still have the same underlying problem.



So there is something wrong on your env/installation. What is it I don't have idea...

Patch vlc as explained in HERE and later build it using `synth test`.

Just be aware there are a bunch of patchs on vlc already and if you patch a file that already have a patch, the old patch will be trashed when you run `make makepatch`.

So, apply your patch after running `make patch` or `make configure`, to when you run `make makepatch` later, the already existing patch will be included.

[EDIT]

Btw, `ports-mgmt/synth` build ports on chroot.


----------



## Chris_H (Jul 20, 2018)

ls4680 said:


> Thanks for your help, I am still working through the suggestions provided........  The problem is that I can NOT do a `make` to the clean port even before applying the patches so I am sure that if I applied the patches I would still have the same underlying problem



Given I've not heard your problem elswhere. I'm inclined to think it must be your patch(1)(es).
is the string

```
Qt_5.10
```
correctly defined -- spelling, underscore, ... ?

That's at least what I can see, w/o access to your environment.

--Chris


----------



## ls4680 (Jul 22, 2018)

Chris_H said:


> Given I've not heard your problem elswhere. I'm inclined to think it must be your patch(1)(es).



I can't get to the point where I even try to install the patches.  I am trying to "divide and conquer" (get the `make`to work in generic source first)!



Chris_H said:


> is the string
> correctly defined -- spelling, underscore, ... ?


Where would that be defined?


----------



## Chris_H (Jul 22, 2018)

Looking closer.

Hmm. You indicate (above) the you have the following:


```
/usr/local/lib/qt5#ll libQt5Core*
-rw-r--r-- 1 root wheel 1213 Jul 17 21:33 libQt5Core.prl
lrwxr-xr-x 1 root wheel 20 Jul 17 21:33 libQt5Core.so@ -> libQt5Core.so.5.10.1
lrwxr-xr-x 1 root wheel 20 Jul 17 21:33 libQt5Core.so.5@ -> libQt5Core.so.5.10.1
lrwxr-xr-x 1 root wheel 20 Jul 17 21:33 libQt5Core.so.5.10@ -> libQt5Core.so.5.10.1
-rwxr-xr-x 1 root wheel 5125248 Jul 17 21:33 libQt5Core.so.5.10.1*
```

Yet, the first error, out of the gate is:

```
/usr/local/lib/qt5/libQt5Core.so.5: version Qt_5.10 required by /usr/local/lib/qt5/bin/uic not found
```
Which _appears_ to be looking for:

```
/usr/local/lib/qt5/libQt5Core.so.5
```
Which your directory listing _doesn't_ show.

Does it work if you symlink(2) libQt5Core.so.5.10.1 to libQt5Core.so.5?

An easy tak to try. But if it doesn't work. Don't forget to get rid of the symlink you just made. 

I can see something like this happening if your system got out of sync somehow. After all. It's a symlink, not an actual file.

HTH

--Chris


----------



## ShelLuser (Jul 22, 2018)

Chris_H said:


> Looking closer.
> Which _appears_ to be looking for:
> 
> ```
> ...


Look closer, it does and it's already a symlink.


----------



## Chris_H (Jul 24, 2018)

D'OH! 

--Chris


----------



## ls4680 (Jul 26, 2018)

Got it working for now.  Did `pkg delete` on many ports and then reinstalled.  Unfortunately vlc is now marked vulnerable, but it does build again with `make DISABLE_VULNERABILITIES=yes`. Of course this brings me back to the original question, how do I get a previous version of ports so I can build a previous version of `vlc`?


----------



## rigoletto@ (Jul 26, 2018)

`svn log -l [number of the commits you want to look back] /usr/ports/multimedia/vlc`
`svn up -r [commit number you got before] /usr/ports/multimedia/vlc`


----------



## ls4680 (Jul 26, 2018)

lebarondemerde said:


> svn log -l [number of the commits you want to look back] /usr/ports/multimedia/vlc
> svn up -r [commit number you got before] /usr/ports/multimedia/vlc



Thanks, that is what I have been looking for.......


----------

