Package update HOWTO/zh-cn

This document shows how to update a package you maintain in Fedora. It assumes you already have a package in the Fedora repositories.

This document is divided in three sections to give Developers, Testers, and Mirror Admins some guidelines on how to submit packages for [[Releases/Rawhide |  and.


 * For more guidance on package updates, refer to Updates_Policy.

Overview
Here you can find detailed information on process of Package Management in Fedora. If you want to know the difference between   and  , and which one is suitable for you, along with an overall understanding of the release naming and repos, visit our new and improved [[ReleaseEngineering/Overview | Fedora Development Process Overview page.

New contributors (mandatory reading), new Testers (highly suggested reading), new Consumers (useful reading), or anybody interested in how Fedora is developed would find this page useful.

In particular, these are the new paths on mirrors:
 * will become the new path of Rawhide. It will continue to not have install images, and will be the place where builds from the  branch in git go to. It'll be  intended content.
 * will become the new path of the branched Fedora content. This is where builds from the F-/ branch in git will go after they pass through Bodhi as "stable".
 * will be where potential Fedora builds go after passing through bodhi as "testing". This is where you'll find the latest stuff proposed for freeze break and where testing and peer review of these freeze breaks will happen. When a maintainer feels enough testing has happened, or enough karma triggers the Bodhi auto request, the build will be marked "stable" and show up in the development/ tree at the next nightly compose.

(View NFR coming soon! New paths on mirrors!)

For Developers
Notes

to the latest pending content || Update your Fedora 12 system by reading instructions at FIXME || Check the QA/Join page that describes the different testable repos, skill level and investment involved. || Read the Package Acceptance Test Plan and use it as a guideline


 * style="background-color:#DDDDDD"| To install Rawhide on your system to test the latest packages ||style="background-color:#DEF3FE" align=center| X ||style="background-color:#DEF3FE" align=center| X ||style="background-color:#DEF3FE" align=center| X || || || ||  ||
 * style="background-color:#DDDDDD"| To install and run as your desktop and participate in test days ||  ||  || ||style="background-color:#DEF3FE" align=center| X ||style="background-color:#DEF3FE" align=center| X || ||  ||
 * style="background-color:#DDDDDD"| To update a Fedora 12 system to the Pending Fedora 13 for testing || || || || || ||style="background-color:#DEF3FE" align=center| X || ||
 * style="background-color:#DDDDDD"| To provide test feedback for new packages || || || || || || ||style="background-color:#DEF3FE" align=center| X ||
 * style="background-color:#DDDDDD"| To represent the QA team in providing feedback on critical path package updates || || || || || || ||style="background-color:#DEF3FE" align=center| X  ||style="background-color:#DEF3FE" align=center| X
 * }
 * style="background-color:#DDDDDD"| To provide test feedback for new packages || || || || || || ||style="background-color:#DEF3FE" align=center| X ||
 * style="background-color:#DDDDDD"| To represent the QA team in providing feedback on critical path package updates || || || || || || ||style="background-color:#DEF3FE" align=center| X  ||style="background-color:#DEF3FE" align=center| X
 * }
 * style="background-color:#DDDDDD"| To represent the QA team in providing feedback on critical path package updates || || || || || || ||style="background-color:#DEF3FE" align=center| X  ||style="background-color:#DEF3FE" align=center| X
 * }
 * }



For Mirror Admins

 * If you are a mirror admin and want to prepare for additional repos coming to your mirror :
 * Read  and watch for announcements regarding new paths being added to the Master Mirror.
 * Check your sync exclusion settings to ensure you either get, or don't get the new path (depending on your needs).

Build a package for Rawhide
To build a package for Rawhide, check it out from the git devel/branch.

Install fedora-packager if not already installed.

Check out a local working copy of the git module you plan to edit, e.g. (for a description of the directory layout, see the Anatomy  page: fedpkg clone 


 * If you update to a new upstream version, you have to upload the tarball to an external lookaside cache. Operations on the lookaside cache require a client-side certificate, to get one, run

fedora-cert -n

To upload a new source tarball and replace an older one, run

fedpkg new-sources /path/to/yournewtarball.tar.gz

You can omit the path if the source is the current directory.

In the branch directory (i.e. devel in this case) or for multiple files: fedpkg new-sources yournewtarball.tar.gz yourdata.tar.gz

This also updates your local copy of the .gitignore and sources files. You will need to do this for each branch that you will be building the new version for. The new tarball will be uploaded only once and the rest will be md5sum checked and not uploaded, only the .gitignore and sources files will be updated.

If you just want to add another tarball (e.g. a big gzipped patch or a documentation tarball), use: fedpkg upload somefile.tar.gz Contrary to, this does not purge old files from the   and   files.

If you just have a small patch, initscript, or otherwise plain text file, you can commit those directly to git. This can be done with the  command, e.g.: git add packagename-fix-the-foobar.patch

fedpkg srpm; koji build --scratch --arch-override x86_64 f17 packagename-version-release.src.rpm
 * Use the command  to test a package build on your local mock system.  Then install and test the package.  If something doesn't work, fix it and repeat this step. You can also use the koji build system to do a scratch build perhaps for some arch you don't have locally. For example, to build just for x86_64:

fedpkg diff
 * Check if everything that has changed is correct with

fedpkg commit git push
 * Commit the verified changes to the  branch.

fedpkg commit -p
 * Commit and push in one go

As a test whether the full commit was fine, you can check out a fresh working copy into a different directory. It should succeed in fetching the binaries from lookaside cache and also pass simple build tests such as make i686 or make srpm at least.

fedpkg build
 * Instruct the builders to build your package:


 * Check the koji build page at http://koji.fedoraproject.org/koji/ for the build process.

Example
fedpkg clone foo cd foo wget -N http://dl.sf.net/foo/foo-0.0.2.tar.bz2 fedpkg new-sources foo-0.0.2.tar.bz2 gedit foo.spec fedpkg mockbuild fedpkg diff fedpkg commit -m "Update to 0.0.2" -p
 * 1) change the required things in the specfile
 * 1) check that the changes you made are correct
 * 1) commit and push

fedpkg build
 * 1) request build

The package builders publish your package in the  tree, also called "Rawhide." If the package is a stable update, you may also provide it to users of the currently-maintained stable, or branched Fedora release. To make it available to F-11 or F-12 users, or testers of the branched F-13 for example, use the procedure outlined in the next chapter.

An alternative may be used, the import of a complete src.rpm.

More in-depth information on the build system is at UsingKoji.

Removing a package build from the devel branch
From time to time you may want to remove a package build you pushed to the devel branch (rawhide). This could happen in a situation where a bug or issue is found in your package that will be resolved upstream in the next release. You may want to wait for this release instead of back-porting a fix yourself, so pulling the broken package from rawhide makes sense.

You can remove the package from rawhide by using koji as follows:

koji untag-pkg f17 foo-1.1.3-1.fc17

Where  is replaced with the name of your package build. See  or  UsingKoji for more information.

Requesting special dist tags
When updating a package affects a large number of dependencies (e.g. all perl, python or ghc packages) it may be better to initially do the builds in another repo, so that there is less disruption in rawhide.

If you think you have an update that falls under this case you can request a special dist tag by filing a release engineering ticket. Someone from release engineering will likely want to discuss your needs to make sure this is really an appropriate case (it's OK ask if you aren't sure) and that you get what you need.

= Working with packages in the stable branches = Stable branches are branches within git for either released Fedoras, or a branched Fedora that is still in bugfix/polish mode but has not yet been released.


 * 1) Switch to the branch which you would like to update with the   command. Here is an example of an update for Fedora 16: fedpkg switch-branch f16
 * 2) Make any required changes. In many cases, you can apply the same changes from the   branch to the other branches. Use the   and   utilities for this purpose.
 * 3) Use the command   to test a package build on your local system.  Then install and test the package.  If something doesn't work, fix it and repeat this step.
 * 4) Commit the verified changes to the branch you are working on: git commit and git push Example of  : git push origin f16:refs/heads/f16/master See also  Fedora branch names.
 * 5) Instruct the builders to build your package: fedpkg build
 * 6) Check the koji build page at http://koji.fedoraproject.org/koji/ for the build process.


 * If you want to build a package for the Pending but it requires package that is not yet pushed "stable" for Fedora 16.
 * 1) You would need to file a buildroot override tag request as outlined in the policy page Alpha_Freeze_Policy
 * 2) Once tagged, you can proceed to build her package and issue the  Bodhi request

Submit your update to Bodhi

 * 1) This can be accomplished in a few different ways.  The easiest being: fedpkg update  If your local username differs from that of your Fedora account, you will need to specify it with the following command: BODHI_USER=foo fedpkg update Or you add   to the file   .  FIXME:  what's the git equivalent?
 * 2) Alternatively, you can also submit your update using the bodhi-client
 * 3) or the web interface.
 * 4) Once submitted, bodhi will automatically request that your update be pushed to updates-testing.  If you feel that community testing is unnecessary for your update, you can choose to push it straight to the stable fedora-updates repository instead. Pushing directly to stable skips peer review and is strongly discouraged!! Note that security updates follow a slightly different process.
 * 5) A Release Engineer then signs and pushes out your updates.  The signing step is currently a manual process, so your updates will not be instantly released once submitted to bodhi.
 * 6) Once pushed to testing, people are able to +1/-1 the updates "karma", based on whether or not it seems to be functional for them.  If your update reaches a karma of 3, it will automatically be pushed to stable.  Likewise, if it reaches -3, it will be automatically unpushed.  If your update does not receive enough feedback to automatically push it to stable, you will have to submit it as a final update yourself.  This can easily be done with the command-line tool, or with the web interface.
 * 7)  You will then be notified when your update has been pushed to stable.  Bodhi will close all associated bugs and send an announcement to fedora-package-announce.  At this point, your update has been officially released!

Get Automatically Notified on New Upstream Releases
To automatically get notifications via bugzilla whenever upstream has a new release, refer to upstream release monitoring page.

参考

 * http://fedoraproject.org/wiki/Using_git_FAQ_for_package_maintainers