📜 ⬆️ ⬇️

Using portdowngrade for 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 such a problem, the portdowngrade utility will be suitable.
Without it, we must do the following:
The portdowngrade utility itself analyzes the history of the specified port and shows 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 examining the CVS repository to copying the necessary files to the ports tree.

Consider how the port rolls back to the previous version using the example of eAccelerator.
')

Install portdowngrade


Go to the port directory, run the assembly:
  cd / usr / ports / ports-mgmt / portdowngrade
 make 


And we immediately 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 building the port and execute it with the indication of the default anonymous CVS server. There is also a link 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 the server from the English version of the Handbook, because the information in the Russian version is far from reality.
I did not specify the default CVS server (possible unavailability and other factors). It can be set in the command line parameters when starting portdowngrade.

Install:
  make install clean 


Installation completed.

Using portdowngrade


Go to the ports tree:
  cd / usr / ports 


Starting portdowngrade:
  portdowngrade -s: pserver: anoncvs@anoncvs.fr.FreeBSD.org: / home / ncvs www / eaccelerator 


Do not forget to specify the CVS server (-s parameter) and the name of the port with the category that will be rolled back.
Additional command line parameters can be viewed 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 numbers and present results
 Keys: <space>: next page d: details
             p: previous page
       <enter>: 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 received a list of port versions with a number, date and comment. We are interested in version 0.9.5.3 (number 3). We press “Enter” (“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 the CVS repository

 Step 6: Modifying the port
 Port: www / eaccelerator
 at: 2008/06/18 12:26:58
 The date 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. 

Everything, port rollback in a ports tree is carried out

Now you can install this port using standard tools. But for port upgrades 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.

Source: https://habr.com/ru/post/98946/