How to re-add in openbsd cvs tree

It’s quite simple but I forget so many times. This short blog post is for all forgetful port monkeys.

Let’s try to re-add net/ktorrent in four simple steps.

  1. First of all checkout whether your port is already imported or in Attic. The easiest way to do this is by checking webcvs. For example net/ktorrent in cvsweb. If you read (in the Attic), you know it was imported but now it’s deleted.

  2. Make sure you do not have update -P in your ~/.cvsrc or a shell alias otherwise you won’t see what cvs(1) tells you.

  3. Initial preparation

    $ cd /usr/ports/
    $ rm -rf net/ktorrent
    $ cvs up -d net/ktorrent
    cvs server: Updating net/ktorrent
    cvs server: Updating net/ktorrent/patches
    cvs server: Updating net/ktorrent/pkg

If you can’t read the cvs(1) server output, you did something wrong in step 2. Be warned! mkdir(1) -p net/ktorrent/pkg would not be sufficient because it would not create the administrative directories net/ktorrent/CVS and net/ktorrent/pkg/CVS.

  1. Re-add
    $ tar -xzvf ~/ktorrent.tar.gz                                                                                                                                               (cvs)-[ports]
    net/ktorrent
    net/ktorrent/Makefile
    net/ktorrent/distinfo
    net/ktorrent/pkg
    net/ktorrent/pkg/PLIST
    net/ktorrent/pkg/DESCR
    $ cd net/ktorrent
    $ cvs add Makefile distinfo pkg/DESCR pkg/PLIST
    cvs server: re-adding file Makefile (in place of dead revision 1.39)
    cvs server: re-adding file distinfo (in place of dead revision 1.8)
    cvs server: re-adding file pkg/DESCR (in place of dead revision 1.2)
    cvs server: re-adding file pkg/PLIST (in place of dead revision 1.12)
    cvs server: use 'cvs commit' to add these files permanently

Now is the best time for a brief, final build and review of the port, to make sure everything works fine.