mgarepo(8)

πŸ“¦ version 1.13.2, in fedora 43, fedora 44

πŸ’– mgarepo(8) β€” bestie edition πŸ’–

okay so you wanna manage RPM package sources in a Subversion repo? This is the girl. Manual name: mgarepo. Section 8. Let's GO. πŸ¦‹


✨ NAME ✨

mgarepo β€” Package sources repository management tool. πŸ’…


🌸 SYNOPSIS 🌸

mgarepo command [options] [arguments]

that's it. that's the whole shape of it. a command, some options, some arguments. iconic. πŸŽ€


🫢 DESCRIPTION 🫢

So mgarepo is the tool you use to manage RPM packages in a subversion repository. fr fr. It's the one that:

  • creates stuff
  • tags releases
  • generates .src.rpm
  • generates changelogs
  • requests new package releases for build

Mostly it's just a glow-up interface over svn(1) commands plus some small task scripts that run on the build system side over ssh(1). no cap.

Most of the mgarepo commands operate on a given package URL β€” and you can totally omit those URLs when the configuration option repository is set. lowkey convenient.

And if you want the detailed tea on any command? Just run:

mgarepo <command> --help

🌈 BASIC USAGE 🌈

🧚 Setup

Real talk: mgarepo does not handle the authentication interface that svn uses. So you usually need to set up ssh-agent(1) if your repository access method is over SSH (svn+ssh:// URLs) β€” or else do some simple operation just to get yourself an authentication token. πŸ’€

For more info about setting up ssh-agent, see:

https://wiki.mageia.org/en/Packagers_ssh

Users who don't have an ssh account on the default repository URL can set the option mirror pointing to a non-authenticated, read-only repository β€” like this one right here:

svn://svn.mageia.org/svn/packages

πŸ“ Examples

Let's get into it, bestie. πŸ’…

  • mgarepo co foo β€” Obtains a working copy of the package foo. πŸŽ€
  • mgarepo co 1/mutt β€” Obtains a working copy of the package mutt of from the 1 branch. πŸ¦‹
  • mgarepo co hplip -k 5 β€” Obtains a working copy of the package hplib of from the 5 branch and backport directory. (yes, it says hplib, we're keeping it exactly as written, don't @ me) 😭
  • mgarepo ci β€” Commits pending changes in the working copy. ✨
  • mgarepo submit foo -r 12345 β€” Requests the package foo in the revision 12345 to be built and, if successful, to be uploaded to the RPMs repository. πŸ”₯
  • mgarepo submit foo -r 12345 -t 1 --define section=core/testing β€” Will submit the package foo and, upon successful build will have its RPMs placed inside the core/testing media of the 1 repository. πŸ‘‘
  • mgarepo submit β€” submit run without parameters will use package name and revision found in the working copy in the current directory. main character energy, honestly. πŸ’–
  • mgarepo obsolete foo β€” Move the package foo from cauldron/foo to obsolete/foo on svn. 🫢

πŸ‘‘ COMMANDS πŸ‘‘

For detailed help on commands run mgarepo <command> --help. periodt.

  • co β€” checkout a package 🌸
  • ci β€” commit changes πŸ’…
  • submit β€” submit a package in a given revision for build and release πŸ”₯
  • sync β€” add-remove all file changes from the .spec ✨
  • maintdb β€” get/set package maintainers informations πŸŽ€
  • putsrpm β€” import a source package to the repository πŸ¦‹
  • getspec β€” print the spec πŸ“„
  • rpmlog β€” print the RPM changelog generated from SVN 🧚
  • getsrpm β€” create the source RPM πŸ’œ
  • create β€” create the structure of a new package 🌈
  • changed β€” show changes not submitted πŸ‘€
  • authoremail β€” print the e-mail of a given svn author πŸ“§
  • switch β€” relocate to mirror or upstream repository πŸ”€
  • markrelease β€” create a tag for a given package revision and version 🏷️
  • upload β€” add a file to binrepo ⬆️
  • del β€” remove a file from binrepo πŸ—‘οΈ
  • up β€” update the working copy and synchronize all binaries ‴️
  • obsolete β€” move a package in obsolete directory πŸ’€

🌺 REPOSITORY LAYOUT 🌺

A detailed description can be found at:

http://wiki.mandriva.com/en/Development/Packaging/RepositorySystem

The svn repository used by mgarepo consists of a set of branches in the top directory, followed by package directories having the internal package structure. 🌈

The internal package layout contains a directory current/, which contains the latest version of the package (equivalent to "trunk" in software repositories). The directory releases/ contain copies of older submitted packages that have been already released, it is organized in the <version>/<release> format (equivalent to "tags" directories). πŸŽ€

URLs used in mgarepo commands refer to the package directory, and never to current. In other words, the http://host/svn/cauldron/foo is valid, whereas http://host/svn/cauldron/foo/current is not. 🚫

One example layout:

 /packages/cauldron
     |
     +- cauldron/
     |  ...
     |  +- rsync/
     |  +- coreutils/
     |  +- make/
     |  +- foo/
     |     +- current/
     |     |  +- SOURCES/
     |     |  +- SPECS/
     |     +- releases/
     |        ...
     |        +- 1.0
     |           +- 1.mga1/
     |              +- SOURCES/
     |              +- SPECS/
     |           +- 2.mga1/
     |           ...
     +- updates/
        +- 1/
        +- 2/
        +- 3/

🌸 Setting up a repository 🌸

The minimal setup is accomplished with a Subversion repository having three directories: cauldron/, misc/ and updates/. The name of this directories can be changed using the configuration options trunk-dir and branches-dir. Having this you can start importing packages with mgarepo import. πŸ’–

πŸ’– CONFIGURATION πŸ’–

🌸 Introduction 🌸

okay bestie, so the main character config file is /etc/mgarepo.conf, and it's in .ini format. basically it's a whole set of [name] sections, and inside each one you've got variables written as name = value.

and if it exists, the file ~/.mgarepo/config gets loaded too. double config, double slay. ✨


πŸ‘‘ [global] section πŸ‘‘

  • repository = URL β€” holds the base URL that gets used to reach packages in the svn repository whenever you only type a package name in your mgarepo commands. like, if you run mgarepo co trafshow and repository is set to http://host/svn/, then the URL http://host/svn/cauldron/trafshow is what gets used (cauldron is the default branch, iykyk).
  • default_parent = URL β€” points at the base URL of the development branch of the svn repository. > heads up: this one is deprecated, it got replaced by repository.
  • mirror = URL β€” the URL of an alternative, read-only repository used when checking out packages. and mgarepo ci will automatically relocate over to repository when you commit. cute, right?
  • use-mirror = yes/no β€” turns off using the mirror repository when checking out packages.
  • url-map = MATCH-REGEXP REPLACE-EXPR β€” this one's for the server side, and it remaps remote URLs that users bring when running mgarepo submit into local (and probably faster) URLs. MATCH-REGEXP is a Python regular expression matching the components that have to be reused in the local URL. REPLACE-EXPR is a replace expression that should expand into the final URL. example: svn+ssh://svn.mageia.org/(.*) file:///1
  • tempdir = PATH β€” the directory used as the base for temporary directories and files that mgarepo creates.
  • download-command = COMMAND-FMT β€” the command used to download generic remote URLs. it accepts the variables $url and $dest. rn it's used when you run mgarepo sync -d.
  • svn-command = COMMAND β€” the base command used to execute svn(1). it runs through system(3).
  • svn-env = VAR=VALUE .. β€” the environment variables to use when running svn. you can define more entries by using more lines. the variable defined by default is SVN_SSH, which points to the mgarepo-ssh ssh wrapper. 🫢
  • verbose = yes/no β€” cranks up the verbosity of mgarepo output, printing the commands being run and a complete traceback whenever an unhandled error happens.
  • trunk-dir β€” points to the default branch of the distro, used in commands that don't have their branch or URL specified.
  • branches-dir β€” the directory inside the repository that holds all the branches of the distro. it's used to build the URL of packages referred to with the branch notation BRANCH/PACKAGE, like in mgarepo co 1/mutt.

πŸŽ€ [submit-groups] section πŸŽ€

this section holds aliases for groups of packages you want to submit all at once. so like, a line saying my-python-packages = bzr bzrtools bzr-gtk would let you just run mgarepo submit my-python-packages. iconic.

and yes, distro branches or revision numbers can be specified for each package group too. example: mgarepo submit 1/my-python-packages. ✨


πŸ’… [submit] section πŸ’…

  • host = HOST β€” sets the default host where mgarepo submit will run the submit helper.
  • default = TARGET β€” the default target used in mgarepo submit when the -t option isn't used.

🌈 [submit TARGET] sections (server-side only) 🌈

these sections describe each one of the sections available for submitting packages. their configuration options are:

  • target = PATH β€” the path where SRPMs generated by create-srpm- will be placed during the submit process.
  • allowed = URLs β€” a space-delimited list of package URLs that are allowed to be used with this target. the comparison works by checking whether the package URL used in submit starts with one of the URLs in this option.
  • scripts = PATHS β€” a space-delimited list of scripts that get run, each receiving the generated SRPM as its first argument. these scripts are usually used to make small changes to the SRPM structure, like bumping the release number for example.
  • rpm-macros = NAMES β€” points to sections in the config that will contain the RPM macros used when generating the SRPM of the package being submitted. those sections should be named in the [macros NAME] format.

πŸ¦‹ [macros NAME] sections (server-side only) πŸ¦‹

these sections contain variables that get defined as RPM macros when generating the SRPM of the package being submitted. it's usually used to define the distribution suffix that goes in package releases, like "mga1".


πŸ’œ [users] section (server-side only) πŸ’œ

this section maps the usernames found in svn to their real names and e-mails. it's used when generating the changelog based on commits in svn, and by authoremail. example: joe = Joe User <joeuser@host.com>.

you can use this section on the client side too, but ngl it will have no effect on the changelogs generated on the server side.


⭐ [helper] section ⭐

  • create-srpm = PATH β€” the path of the script that gets run through ssh on the submit host when you run mgarepo submit.
  • upload-srpm = PATH β€” (server-side only) the path of the script that gets called after the generated SRPM is copied to its target location (see the target sections above) and the target scripts are run.
  • rpmbuild = COMMAND β€” the command used to call rpmbuild. note that build options (like -bs) are supplied by mgarepo itself.

🌸 [log] section 🌸

  • oldurl = URL β€” the URL of a directory structure that will contain old changelogs of packages, which get appended to the changelog being generated by rpmlog or getsrpm -l.
  • merge-spec = yes/no β€” if enabled, changelogs generated by mgarepo will have the contents of the %changelog found in the .spec file of the package appended to them.
  • sort = yes/no β€” if enabled, the changelog gets resorted after it's generated. super useful when the changelogs found in oldurl or in the .spec's %changelog section are newer than the ones generated by SVN.
  • revision-offset = REVISION-NUMBER β€” the base revision used to generate changelogs. as in svn log -r REVISION-OFFSET:HEAD URL.
  • ignore-string = STRING β€” the mark used to hide log messages. when it appears at the beginning of the log message, the whole changeset log gets hidden. when it's found in the middle of a string, only that line won't be shown.
  • unignore-string = STRING β€” the complement of the previous option. when this token is found, only those lines containing this mark will be shown. it's meant to be used on very long log messages.

πŸŽ€ [template] section πŸŽ€

  • path = PATH β€” Obsolete. the path of the template used to generate the changelog from svn commits.
  • name = NAME β€” the name of the template used to generate the changelog from svn commits. use default or revno.

πŸ“ [srpm] section πŸ“

  • run-prep = yes/no β€” Repsys can check for the presence of a file named Makefile in the top directory of the package and run make prep-srpm so that it can generate the actual files that must be distributed in the srpm. this option enables that feature. (Note: the command is expected to run in a restricted environment, so the Makefile must use only minimal functionalities.)

✨ ENVIRONMENT VARIABLES ✨

  • REPSYS_CONF β€” sets the configuration file to be read by mgarepo.

πŸ’– FILES πŸ’–

  • ~/.mgarepo/config
  • /etc/mgarepo.conf
  • /usr/share/mgarepo/
  • /usr/share/doc/mgarepo/

πŸ’€ BUGS πŸ’€

go check the list of bugs at http://bugs.mageia.org/buglist.cgi?quicksearch=mgarepo β€” pls do report stuff bestie, it helps everyone. πŸ™ˆ


πŸ‘€ SEE ALSO πŸ‘€


πŸ‘‘ AUTHOR πŸ‘‘

repsys was originally written by Gustavo Niemeyer <gustavo@niemeyer.net> for the Conectiva Linux distribution. after that it was maintained by Mandriva contributors and employees. mgarepo is a fork of repsys maintained by Mageia contributors. the way that lineage is giving legacy, fr fr. πŸ’œ


and that's a wrap, bestie! this one's from the Mageia crew, dated 2011 Jan 11, and it's page mgarepo(8) β€” go forth and submit packages, you absolute main character. πŸ¦‹βœ¨

πŸ“¦ where this page comes from