File:  [NetBSD Developer Wiki] / wikisrc / pkgsrc / how_to_update_a_package_in_pkgsrc.mdwn
Revision 1.1: download - view: text, annotated - select for diffs
Sun Nov 20 20:28:27 2011 UTC (2 years, 5 months ago) by mspo
Branches: MAIN
CVS tags: HEAD
import a bunch of pkgsrc articles from the old pkgsrc.se wiki

This article describes by examples how a [[pkgsrc/pkgsrc]] developer can update a package to a later version. 

You may be looking for [[pkgsrc/How to update a package with pkgsrc]]


**Contents**

[[!toc levels=3]]

#  Preparation 

Please install pkgtools/pkgdiff. This tools helps creating patches for pkgsrc. It contains pkgvi, mkpatches and patchdiff. 

#  Trivial: games/gogui from 0.9.1 to 0.9.3 

##  Part 1: Get the new package to build 

  * Change the version number in the DISTNAME variable to 0.9.3. 
  * Run make mdi to download the new distfile and regenerate the checksums. 
  * Run make. 
  * Wait until the build has finished ... 

##  Part 2: Install the new package 

  * Run make deinstall to remove the old package. 
  * Run make install PKG_DEVELOPER=yes, hoping that the list of installed files has not changed. 
  * There is no document describing the changes. Only on the SourceForge project page, there are two comments about minor bugfixes. Keep them in mind for later. 
  * The package has installed without any failures. That's good. 
  * Run make package clean to finish the work. 

##  Part 3: Committing the update 

  * Run pkglint -Wall to see if the package looks good. 
  * Run cvs ci to commit the update. 

    * The text of the commit message is Updated gogui to 0.9.3, followed by an empty line, followed by a comment about the changes. 

  * Run (cd ../../doc && cvs up)
  * Run make changes-entry
  * Run (cd ../../doc && cvs ci CHANGES-*). 

    * The text of the commit message is Updated gogui to 0.9.3. 

#  Simple: devel/rapidsvn from 0.9.3 to 0.9.4 

##  Part 1: Get the new package to build 

  * Change the version number in the DISTNAME variable to 0.9.4. 
  * Run make mdi to download the new distfile and regenerate the checksums. 
    
    
    ...
    fetch: Unable to fetch expected file rapidsvn-0.9.4.tar.gz
    

  * Look at the homepage (see HOMEPAGE) to see where the distfile is. 
  * Change MASTER_SITES accordingly. 
  * Run make mdi again. 
  * Run make and hope that the old patches still apply. 
    
    
    ...
    => Applying pkgsrc patches for rapidsvn-0.9.4
    1 out of 1 hunks failed--saving rejects to configure.rej
    Patch /home/roland/proj/NetBSD/pkgsrc/devel/rapidsvn/patches/patch-ab failed
    ERROR: Patching failed due to modified or broken patch file(s):
    ERROR:  /home/roland/proj/NetBSD/pkgsrc/devel/rapidsvn/patches/patch-ab
    

  * They don't. :( 
  * Look at patches/patch-ab to see which file it is applied to. It's the configure script, so have a look at that. 
  * Hmmm, it looks quite different. Let's see if the old line still exists. 
  * Look for "$GXX" ==. It's in line 19749. 
  * So we need to remove one of the equals characters, since that's what the patch did. 
  * Change to the work directory ($WRKOBJDIR) and edit the file(s) you need to patch with pkgvi, make the changes and save it. pkgvi will automatically create a diff. 
  * Change back to the package directory (e.g. .../pkgsrc/devel/rapidsvn/ and run mkpatches. This will create the new patches from the new diffs in $WRKOBJDIR/.newpatches/ 
  * Now copy the new patch(es) from $WRKOBJDIR/.newpatches/ to `patches/` in the package directory. 
  * Run make patches to regenerate the patches from the working directory. 
  * Look at the patches to see if they contain more than they should, or expanded strings (for example, /usr/pkg instead of @PREFIX@. 
  * Run make mps to regenerate the checksums. 
  * Run make clean; make to try again. 
  * In the mean time, create a patch for configure.in, since that's the source of the code which got patched in the configure script. 
  * Wait until the build has finished ... 

##  Part 2: Install the new package 

  * Run make deinstall to remove the old package. 
  * Run make install PKG_DEVELOPER=yes, hoping that the list of installed files has not changed. 
  * Meanwhile, look at the NEWS, ChangeLog and CHANGES files in the WRKSRC to see what has changed between 0.9.3 and 0.9.4. Save that text to later include it in the commit message. 
  * The package has installed without any failures. That's good. 
  * Run make package clean to finish the work. 

##  Part 3: Committing the update 

  * Run pkglint -Wall to see if the package looks good. 
  * Run cvs ci to commit the update. 

    * The text of the commit message is Updated rapidsvn to 0.9.4, followed by an empty line, followed by the text from the CHANGES file. 

  * Run (cd ../../doc && cvs up)
  * Run make changes-entry
  * Edit ../../doc/TODO to remove the line of the requested update. 
  * Run (cd ../../doc && cvs ci CHANGES-* TODO). 

    * The text of the commit message is Updated rapidsvn to 0.9.4, without all the details. 

##  Part 4: Sending the patches to the upstream authors 

  * Look at the homepage of the project to see where to send bug reports. 
  * Register an account, if needed. 
  * Submit a bug report. <http://rapidsvn.tigris.org/issues/show_bug.cgi?id=497>
  * That's all. 



CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb