From Mageia wiki
Jump to: navigation, search


Drakconf multiflag.png
Other languages
English ; Français ;

How to see the sources

In "Mageia control center" → Software management → "Configure media sources for install and update", install the package "mgarepo" (meaning "Mageia's repository"). Then in /etc/mgarepo.conf , replace

repository = svn+ssh://svn.mageia.org/svn/packages/

by

repository = svn://svn.mageia.org/svn/packages/

then, to download, for instance, the source of the package "libreoffice-kde", in a terminal, launch:

$ mgarepo co libreoffice-kde

FAQ

Is there anonymous access to svn?

  • Yes, you can use for example:
svn co svn://svn.mageia.org/svn/packages/cauldron/$PACKAGE_NAME/current $PACKAGE_NAME

This will check out the spec file and patches of $PACKAGE_NAME, but not the sources.

To get the associated sources, go to the directory 'cd $PACKAGE_NAME/SOURCES/', and then 'cat sha1.lst' will give you something like:

3f17f9de3e1d95ec2be5982f90f2362e474ed9ca fooarchive-0.1.tgz 5a513f683c8b2ec6d2d8c097dbd37e50311d92e3 bararchive-0.2.tgz

For each line, do:

wget http://binrepo.mageia.org/3f17f9de3e1d95ec2be5982f90f2362e474ed9ca -O fooarchive-0.1.tgz
wget http://binrepo.mageia.org/5a513f683c8b2ec6d2d8c097dbd37e50311d92e3 -O bararchive-0.2.tgz

You can then build (after go back to the parent $PACKAGE_NAME directory):

rpmbuild --define "_sourcedir `pwd`/SOURCES" -ba ./SPECS/$PACKAGE_NAME.spec
  • You can also use the SVN web interface to view the rpm spec file and patches of any package.

I am a packager, how can I set up SSH on my box?

To use mgarepo to check out packages from SVN, import new packages or submit packages to the Build System you need to set up SSH on your box; to do so have a look at Basic SSH configuration for packagers.

Does mgarepo support split binrepos?

Not yet.

I am a packager, how can I check out a package from SVN?

mgarepo co $PACKAGE_NAME

How can I commit my modifications?

Using either:

mgarepo ci

or

svn commit

How to update a package to a new version?

When updating a package to a new version, one used to put the new tarball in SOURCES, then

svn rm SOURCES/$previous
svn add SOURCES/$new

update spec file and

svn ci

This has changed a bit in Mageia as the split binrepos is used in mgarepo.

You can use mgarepo upload /path/to/new/tarball.tar.* It will upload the tarball to binrepos, and update the sha1 file. However, you still need to remove the old tarball using

mgarepo del /path/to/old/tarball.tar.*

Or you can use mgarepo sync: to see what it's going to do (without actually doing any changes):

mgarepo sync --dry-run

Once you're sure it's working as expected, actually sync the changes locally:

mgarepo sync

Remember to commit the changes on sha1 file after operations on binary files with

mgarepo ci

How can I see if a package that is already checked out on my hard drive has been updated?

Previously, you would go to the directory and run "svn up". Now the equivalent is using:

mgarepo up

This is needed now to be able to check out the newer tarball (if any) from the binrepos SVN.

Where can I follow changes to packages?

How to query if a commit has already been submitted

function svnrel2() { svn log svn+ssh://svn.mageia.org/svn/packages/cauldron/"$@"/releases }

In case of errors, how can I revert a commit?

You can do

svn merge -rxx:yy SPECS/foo.spec
  • xx is current revision
  • yy is last working revision
  • SPECS/foo.spec is the file for which you want to revert changes
    • in the root of your local checkout, you can also use as the filename if you want to revert all changes to the checkout

If you only want to revert exactly one revision, then use

svn merge -c -yy SOURCES/somefile
  • yy is last working revision
  • SOURCES/somefile is the file for which you want to revert changes
    • in the root of your local checkout, you can also use . as the filename if you want to revert all changes to the checkout.

In case of misspell, how can I edit svn:log?

You can do

svn propedit --revprop svn:log -r <revision>

in a local checkout after setting the EDITOR env var to your favorite editor, or you can do

svn pe --revprop -r <revision> svn:log svn+ssh://svn.mageia.org/svn/packages --editor-cmd nano

to directly work on the remote repository and directly specifying your favorite editor.

How can I import a new package to SVN ?

mgarepo import *.src.rpm

or, as it's only an alias, as you can see from the mgarepo manpage or --help output:

mgarepo import *.src.rpm

You can optionally provide an import log message, other than the default "imported package foobar" if you want to do proper attribution to the original package creator, or give a reason for the import, with the -l switch, like so:

mgarepo import *.src.rpm -l 'your import message here'

Where can I get mgarepo?

Using urpmi

# urpmi mgarepo

How to drop a package from SVN?

There is a directory to move old packages that are no longer needed, but still keep them available in case they are needed later

  • To move a package to this directory use
mgarepo obsolete <pkg> -m "SILENT <message here>"
  • Please remember to use SILENT, in case the package get's restored this message does not appear in the changelog.
  • For further steps on how to obsolete a package so that it will be removed from enduser systems and mirrors, see Obsoleting_a_package

How to know from which branch is my local copy

If you have a local copy of a package from svn, and you don't remember from which release is the copy, you use

svn info

Then you get something like

Relative URL: ^/updates/8/sogo/current

or in case of cauldron

Relative URL : ^/cauldron/python-django/current

saying that local copy is from Mageia 8, respectively cauldron

Return to the Packagers portal