Fvennetier (Talk | contribs) (→Requirement) |
Fvennetier (Talk | contribs) (→obs2obscopy) |
||
| Line 90: | Line 90: | ||
Packages copied = 8 | Packages copied = 8 | ||
Packages in error = 2 | Packages in error = 2 | ||
| + | |||
| + | ===Known issues=== | ||
| + | * when making a copy whithout a link (example 3), packages which are links to other packages won't be copied | ||
==Examples== | ==Examples== | ||
Contents |
When creating project, its important to be able to build on a known status of each constituents. It is also important to be able to copy only what has changed when synching up with a newer version. obstag and obs2obscopy commands add support for this requirement to any OBS. obscreategroups complement these two utilities for the image creation.
The latest version can be downloaded from our GIT tree here
OBS does not provide a Tagging concept but offers a concept of version control with a revision which is associated to each package of a project. The revision of a package is expressed by a sequence number (representing the number of commits done on that package) and a MD5 checksum which provides a direct access to a specific version of a package.
Note that the revision number is local to each OBS instance while the MD5 is transportable from one OBS instance to an other.
obstag utilities create a tag file for a given project. That Tag file can be used later to copy that specific version of the project into another target project.
Warning When obstag is used on a remote OBS via a link on a local OBS, obstag will create a package list but without any version tag information. With such a reduced information, obs2obscopy will always copy the latest version of the packages.
Launching obstag without any parameter or --help will display the on line help. There is no man page.
$ obstag --help
HELP
Function : Tag a project in an OBS (remote obs are managed via a linked project)
It will create a tag file which constains the MD5 to represent the package revision
The Tag file can be used as direct input for obs2obsCopy
Usage: /usr/local/bin/obstag obs-alias project-name md5_file-name
Example: /usr/local/bin/obstag http://myObs.mynetwork:81 meego.com:MeeGo:1.2:oss my_revision_tag.md5
meego.com can be a local projet which is a link to a remote OBS public API
Public API do NOT provide log info and in that case revision info will be empty
obs2obscopy will then copy the current release
Version 3.0 Licence GLPv2
OBS does not provide by default a method to copy a full project. obs2obscopy provides that facility using an obstag file as input.
All the packages which are listed in the Tag file will be copied. Any line starting with a # will be ignored (comment-out facility). Only the MD5 is used to identify a package version, other information present in the tag file are for information only.
As a package will only be copied if it does not already exist on the target OBS, the command obs2obscopy can be rerun as many times as required to get the copy done without error (network errors are not uncommon) or to upgrade a project.
A report is printed at the end of the copy which will tell you if errors have occurred. The name of the log file is printed as well.
$ obs2obscopy --help
HELP
Function : Copy a project from an OBS to an OBS, using as input a package list
with the desired MD5 to represent the package revision.
If target package is already at the correct revision, its copy
is ignored. Running the script several times is possible until zero
errors is achieved.
A log file named <MD5_FILE>.log is created for every run.
Usage: obs2obscopy obs-alias source_prj target_prj md5_file
or obs2obscopy obs-alias source_prj other-obs-alias target_prj md5_file
md5_file is created by the script obstag
Example1: Local copy
obs2obscopy http://myObs.mynetwork:81 MyMeeGo:1.2:oss myTest:MeeGo:1.2:oss my_revision_tag.md5
Example2: Remote copy (by link)
obs2obscopy http://myObs.mynetwork:81 meego.com:MeeGo:1.2:oss myobs:MeeGo:1.2:oss my_revision_tag.md5
where meego.com is a local project which is a link to a remote OBS public API
Example3: Remote copy
obs2obscopy http://api.pub.meego.com/public Project:MINT:Testing http://myObs.mynetwork:81 myTest:MINT:Testing my_revision_tag.md5
Return code:
0 success
1 some packages not copied
2 wrong number of arguments
3 problem reading MD5 file or writing log file
4 network error
5 interrupted by user
Version 3.1 Licence GLPv2
A final report is printed at the end of each copy. Packages in error can be created by a lock on that package at the time of copy or a network error (in that case rerunning the command will wipe the problem out) or the deletion of a package in the source project (then the error will never go and commenting out the line in the the Tag file is your best option).
Final reports
Total packages requested = 1385
Packages existing on target = 1375
Packages needed copying = 10
Packages copied = 8
Packages in error = 2
Simply use the same process as for the initial delivery. obs2obscopy will only copy the packages which are not already presented on the target
If for any motive some packages should not be copied, a simple # at the beginning of any line will comment out that line.
Creating a remote target project is very simple.
<project name="LinkToMeego.com"> <title>build.MeeGo.com</title> <description>This project allows access to all resources on build.meego.com instance.</description> <remoteurl>https://api.meego.com/public</remoteurl> <person role="maintainer" userid="Admin"/> <person role="bugowner" userid="Admin"/> </project>
obsextractgroups as it name tells, simply extract packages groups from a published repo and provides them as files ready for used by mic2 as an include file in a .ks via the macro %include. It can read packages groups from local or remote repositories. A full URL allows to specify the source of the group information. The groups are extracted in files in a format which is compatible with the macro %include of a kick start file (.ks) as used by Mic2.
/obsextractgroups.py --help
HELP obsextractgroups
Function : Parse the group.xml file (even it's a .gz file), in a Meego's repos,
and save the lists of rpm for each group into files,
with the name of the group for name.
Usage: obsextractgroups [option] URL-to-published-repo [target-dir-includes-files]
[option]:
-s silent mode
-d debug mode, copy the group.xml in the target-dir-includes-files.
-v verbose mode.
URL-to-published-repo: must be a valid repository
target-dir-includes-files: is optional, by default the value is the current directory
Example1: Remote
./obsextractgroups.py -v -d http://repo.meego.com/MeeGo/releases/1.2.0/repos/oss/ia32/ ./result/
Example2: Remote (note: here the port is 82)
./obsextractgroups.py http://128.124.118.140:82/home%3a/ronan%3a/MeeGo%3a/1.2/
Example3: Local
./obsextractgroups.py -s ./repos/
version:0.1 License:+GLPv2
A final report is printed at the end of the copy.
Number of Groups: 47 Group name Numbers of packages Basic Hardware Support 1 MeeGo SDK Base 17 MeeGo Tablet Applications 17 MeeGo Handset Desktop 35 MeeGo Compliance 78 Virtual Machine Support 4 Minimal MeeGo X Window System 7 MeeGo Handset Applications 19 MeeGo TV 16 MeeGo Core 121 ... ...