We use portdowngrade on an example
There was a need to roll back one of the FreeBSD ports, namely eAccelerator, from version 0.9.6.1 to 0.9.5.3. This is due to the removal of custom caching functions starting from version 0.9.6-rc1.
To solve this problem, the portdowngrade utility is just right .
Without it, we must perform the following actions:
The portdowngrade utility itself analyzes the history of a given port and displays a list of changes. It remains only to choose which of the previous versions of the port we want to install. Thus, portdowngrade automates the entire sequence of actions described above, from inspecting the CVS repository to copying the necessary files to the ports tree.
Let's see how the port rolls back to the previous version using the eAccelerator example.
Go to the port directory, start the assembly:
And immediately we get the message:
We are offered to stop the port assembly and run it with the default CVS server anonymous. A link is also given to the Handbook page, where there is a list of these servers. From my own experience I can say that it is better to take servers from the English version of the Handbook, because in the Russian version the information is far from reality.
I did not specify the default CVS server (possible inaccessibility and other factors). It can be set in the command line options when running portdowngrade.
Install:
Installation completed.
Go to the ports tree:
Run portdowngrade:
Do not forget to specify the CVS server (option -s) and the name of the port with the category that we will roll back.
Additional command line options can be found in man portdowngrade .
We see the following:
Actually, we got a list of port versions with a number, date and comment. We are interested in version 0.9.5.3 (number 3). Click “Enter” , enter the number, agree that the port will be changed:
That's it, the port was rolled back in the ports tree.
Now you can install this port using standard tools. But to upgrade ports I use portupgrade .
Create a new INDEX.db database file in / usr / ports:
Install eAccelerator:
PS It must be remembered that after the next update of the ports tree, all port changes will be lost.
To solve this problem, the portdowngrade utility is just right .
Without it, we must perform the following actions:
- Track port changes in the FreeBSD CVS repository .
- From the comments, find all the files of the previous release ( example revisions of the Makefile for eAccelerator ).
- Download these files and place them correctly in the FreeBSD ports tree.
- Using standard port management mechanisms, set the port.
The portdowngrade utility itself analyzes the history of a given port and displays a list of changes. It remains only to choose which of the previous versions of the port we want to install. Thus, portdowngrade automates the entire sequence of actions described above, from inspecting the CVS repository to copying the necessary files to the ports tree.
Let's see how the port rolls back to the previous version using the eAccelerator example.
Install portdowngrade
Go to the port directory, start the assembly:
cd / usr / ports / ports-mgmt / portdowngrade make
And immediately we get the message:
Press CTRL-C and define DEFAULT_CVS_SERVER (eg make DEFAULT_CVS_SERVER = ": pserver: anoncvs @ anoncvs. ... .FreeBSD.org: / home / ncvs" install) if you want to use a special CVS server as default. See http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/anoncvs.html for a list of possible cvs server
We are offered to stop the port assembly and run it with the default CVS server anonymous. A link is also given to the Handbook page, where there is a list of these servers. From my own experience I can say that it is better to take servers from the English version of the Handbook, because in the Russian version the information is far from reality.
I did not specify the default CVS server (possible inaccessibility and other factors). It can be set in the command line options when running portdowngrade.
Install:
make install clean
Installation completed.
Using portdowngrade
Go to the ports tree:
cd / usr / ports
Run portdowngrade:
portdowngrade -s: pserver: anoncvs@anoncvs.fr.FreeBSD.org: / home / ncvs www / eaccelerator
Do not forget to specify the CVS server (option -s) and the name of the port with the category that we will roll back.
Additional command line options can be found in man portdowngrade .
We see the following:
portdowngrade 0.6 by Heiner Eichmann Please note, that nothing is changed in the ports tree unless it is explicitly permitted in step 6! Seeking port www / eaccelerator ... found: www / eaccelerator Step 1: Checking out port from CVS repository CVS root directory:: pserver: anoncvs@anoncvs.fr.FreeBSD.org: / home / ncvs Step 2: Reading the port history from the CVS repository Step 3: Analyzing the port history from the CVS repository Step 4: Load port version numbers and present results Keys:: next page d: details p: previous page : leave presentation and downdgrade if wanted =================================================== ========================================= number date portversion comment 1 2010/06/01 08:37:37 0.9.6.1 Update to 0.9.6.1 release. 2 2010/04/11 08:10:38 0.9.6 Update to 0.9.6 release: 3 2008/06/18 12:26:58 0.9.5.3 Update to 0.9.5.3 release. 4 2008/02/11 07:12:33 unknown Enable shared memory and content caching api. .................................................. ....................................... 48 2003/04/04 09:49:28 2.3.8 [New Port] Turck MMCache 2.3.6 (An opcode cache for PHP) Total lines: 48. Command:
Actually, we got a list of port versions with a number, date and comment. We are interested in version 0.9.5.3 (number 3). Click “Enter” , enter the number, agree that the port will be changed:
Enter version number to change port to (0: exit): 3 Step 5: Checking out choosen date of the port from the CVS repository Step 6: Modifying the port Port: www / eaccelerator at: 2008/06/18 12:26:58 Type 'yes' to bring the port to the state of the date above or 'no' to exit without changing anything. Note, that this only changes the port, not the installed software! yes or no: yes The port has been set to the selected version.
That's it, the port was rolled back in the ports tree.
Now you can install this port using standard tools. But to upgrade ports I use portupgrade .
Create a new INDEX.db database file in / usr / ports:
portsdb -Uu
Install eAccelerator:
portupgrade -f eaccelerator
PS It must be remembered that after the next update of the ports tree, all port changes will be lost.