mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-09 20:45:47 +01:00
Merge branch 'master' of git://gitorious.org/opensuse/osc
This commit is contained in:
commit
8e7a171cf2
44
NEWS
44
NEWS
@ -63,7 +63,7 @@
|
|||||||
- search: allow to limit results via existing attibutes
|
- search: allow to limit results via existing attibutes
|
||||||
- added "osc meta attribute" for basic attribute creation, deletion, showing and value setting
|
- added "osc meta attribute" for basic attribute creation, deletion, showing and value setting
|
||||||
- implement "osc mbranch" call to create projects with multiple source package (instances)
|
- implement "osc mbranch" call to create projects with multiple source package (instances)
|
||||||
- new "osc patchinfo" command: basic patchinfo generation and modification support
|
- new "osc patchinfo" command: basic patchinfo generation and modification support
|
||||||
- add support for _patchinfo package submissions in "osc sr" on project level
|
- add support for _patchinfo package submissions in "osc sr" on project level
|
||||||
- support review handling of requests (new "osc review accept/decline $REQUEST_ID" command
|
- support review handling of requests (new "osc review accept/decline $REQUEST_ID" command
|
||||||
|
|
||||||
@ -98,7 +98,7 @@
|
|||||||
- rename old "platform/s" names to "repository/ies" (internal cleanup only)
|
- rename old "platform/s" names to "repository/ies" (internal cleanup only)
|
||||||
- fixed osc diff -c N, it failed with int and string concatenation
|
- fixed osc diff -c N, it failed with int and string concatenation
|
||||||
- made osc diff and rdiff more similar: added -p, -c to rdiff, removed -u from rdiff.
|
- made osc diff and rdiff more similar: added -p, -c to rdiff, removed -u from rdiff.
|
||||||
made -u default for both, renamed --pretty to --plain as it is the opposite of -u
|
made -u default for both, renamed --pretty to --plain as it is the opposite of -u
|
||||||
#
|
#
|
||||||
# Features which require OBS 1.7
|
# Features which require OBS 1.7
|
||||||
#
|
#
|
||||||
@ -167,7 +167,7 @@
|
|||||||
0.119:
|
0.119:
|
||||||
- Support new request types
|
- Support new request types
|
||||||
- "submitreq" command has a new syntax (incompatible !)
|
- "submitreq" command has a new syntax (incompatible !)
|
||||||
- new "deleterequest" command
|
- new "deleterequest" command
|
||||||
- new "changedevelrequest" command
|
- new "changedevelrequest" command
|
||||||
- new "request" command for showing/modifing requests
|
- new "request" command for showing/modifing requests
|
||||||
- Multiple actions in one request is not yet supported by osc
|
- Multiple actions in one request is not yet supported by osc
|
||||||
@ -231,7 +231,7 @@
|
|||||||
- fixed support for accessing download repositories (worked only for download.o.o so far)
|
- fixed support for accessing download repositories (worked only for download.o.o so far)
|
||||||
|
|
||||||
0.114:
|
0.114:
|
||||||
- the .oscrc config handling has been cleaned up:
|
- the .oscrc config handling has been cleaned up:
|
||||||
* use "apiurl" for everything now (== <protocol>://<host>)
|
* use "apiurl" for everything now (== <protocol>://<host>)
|
||||||
* added aliases support for [apiurl] sections in the ~/.oscrc.
|
* added aliases support for [apiurl] sections in the ~/.oscrc.
|
||||||
Example:
|
Example:
|
||||||
@ -243,14 +243,14 @@
|
|||||||
* when writing a new ~/.oscrc, store the apiurl in the conffile (bnc#478054)
|
* when writing a new ~/.oscrc, store the apiurl in the conffile (bnc#478054)
|
||||||
* fixed bug that made osc ask for credentials when -A was used (bnc#478054)
|
* fixed bug that made osc ask for credentials when -A was used (bnc#478054)
|
||||||
* fixed crash upon password entry (first startup) (bnc#478052)
|
* fixed crash upon password entry (first startup) (bnc#478052)
|
||||||
- osc build:
|
- osc build:
|
||||||
* make product builds work
|
* make product builds work
|
||||||
* speed up by using a cookie when fetching the binaries (bnc#477690)
|
* speed up by using a cookie when fetching the binaries (bnc#477690)
|
||||||
* support for VM (kvm or xen) builds
|
* support for VM (kvm or xen) builds
|
||||||
* obsolete the need to configure download server, get it from the build
|
* obsolete the need to configure download server, get it from the build
|
||||||
service instance instead.
|
service instance instead.
|
||||||
* be a bit more verbose if the linked package isn't expanded (bnc#470948)
|
* be a bit more verbose if the linked package isn't expanded (bnc#470948)
|
||||||
- osc branch:
|
- osc branch:
|
||||||
* --develproject option fixed (the API calls it 'ignoredevel' instead of 'nodevelproject')
|
* --develproject option fixed (the API calls it 'ignoredevel' instead of 'nodevelproject')
|
||||||
* --revision option added
|
* --revision option added
|
||||||
- osc jobhistory: new command to see build job history of a project or a package
|
- osc jobhistory: new command to see build job history of a project or a package
|
||||||
@ -277,14 +277,14 @@
|
|||||||
- don't use a hardcoded path for the rpm binary otherwise it fails on
|
- don't use a hardcoded path for the rpm binary otherwise it fails on
|
||||||
distributions like debian
|
distributions like debian
|
||||||
- osc meta: be more verbose in case of failure (bnc#459292)
|
- osc meta: be more verbose in case of failure (bnc#459292)
|
||||||
- osc mkpac: add info how to enable the package tracking feature (bnc#459288)
|
- osc mkpac: add info how to enable the package tracking feature (bnc#459288)
|
||||||
|
|
||||||
0.112:
|
0.112:
|
||||||
important bugfix:
|
important bugfix:
|
||||||
- osc deletepac: prevent recursive deletion of a whole project [bnc#458535]
|
- osc deletepac: prevent recursive deletion of a whole project [bnc#458535]
|
||||||
- osc build: support more options: --icecream, --ccache, --with, --without
|
- osc build: support more options: --icecream, --ccache, --with, --without
|
||||||
- osc build: --keep-pkgs also saves the src.rpm now
|
- osc build: --keep-pkgs also saves the src.rpm now
|
||||||
- osc build: small fix in debuginfo handling
|
- osc build: small fix in debuginfo handling
|
||||||
- osc build: new armv7el arch for all binaries for up to ARMv7 EABI with VFP
|
- osc build: new armv7el arch for all binaries for up to ARMv7 EABI with VFP
|
||||||
|
|
||||||
|
|
||||||
@ -331,7 +331,7 @@ Changes were from Marcus_H, poeml, dmueller, tpatzig.
|
|||||||
- osc sr show: show the current state's comment
|
- osc sr show: show the current state's comment
|
||||||
- osc sr log: new command to show the history of a given id
|
- osc sr log: new command to show the history of a given id
|
||||||
- osc sr: enable requests for submitting new packages
|
- osc sr: enable requests for submitting new packages
|
||||||
- osc build: implement --no-checks
|
- osc build: implement --no-checks
|
||||||
- osc build: be less strict on the arguments, and guess what's needed. For instance:
|
- osc build: be less strict on the arguments, and guess what's needed. For instance:
|
||||||
* osc build PLATFORM ARCH BUILD_DESCR
|
* osc build PLATFORM ARCH BUILD_DESCR
|
||||||
* osc build PLATFORM (ARCH = hostarch, BUILD_DESCR guessed)
|
* osc build PLATFORM (ARCH = hostarch, BUILD_DESCR guessed)
|
||||||
@ -339,7 +339,7 @@ Changes were from Marcus_H, poeml, dmueller, tpatzig.
|
|||||||
* osc build BUILD_DESCR (PLATFORM = build_platform (config option), ARCH = hostarch)
|
* osc build BUILD_DESCR (PLATFORM = build_platform (config option), ARCH = hostarch)
|
||||||
* osc build (PLATFORM = build_platform (config option), ARCH = hostarch, BUILD_DESCR guessed)
|
* osc build (PLATFORM = build_platform (config option), ARCH = hostarch, BUILD_DESCR guessed)
|
||||||
- osc build: download after the target architecture check
|
- osc build: download after the target architecture check
|
||||||
- osc addremove: bugfixes, --recursive option
|
- osc addremove: bugfixes, --recursive option
|
||||||
- osc init: added support to initialize a project dir
|
- osc init: added support to initialize a project dir
|
||||||
- osc metafromspec: new alias for 'updatepacmetafromspec' which is hard to remember
|
- osc metafromspec: new alias for 'updatepacmetafromspec' which is hard to remember
|
||||||
- osc updatepacmetafromspec: also update URL
|
- osc updatepacmetafromspec: also update URL
|
||||||
@ -356,20 +356,20 @@ Changes were from Marcus_H, poeml, dmueller, tpatzig.
|
|||||||
- osc build: the --extra-pkgs option is now a configurable setting in .oscrc.
|
- osc build: the --extra-pkgs option is now a configurable setting in .oscrc.
|
||||||
Default is "extra-pkgs = vim gdb strace"
|
Default is "extra-pkgs = vim gdb strace"
|
||||||
- .oscrc: make tilde expansion work on the packagecachedir setting
|
- .oscrc: make tilde expansion work on the packagecachedir setting
|
||||||
- osc update / checkout: don't check out a working copy, or update an existing
|
- osc update / checkout: don't check out a working copy, or update an existing
|
||||||
one, when a source link cannot be applied [bnc#409373]
|
one, when a source link cannot be applied [bnc#409373]
|
||||||
|
|
||||||
|
|
||||||
0.106:
|
0.106:
|
||||||
|
|
||||||
- osc rdiff / osc submitreq show: diff the _expanded_ sources [bnc#408267]
|
- osc rdiff / osc submitreq show: diff the _expanded_ sources [bnc#408267]
|
||||||
- osc submitreq list: show author's name
|
- osc submitreq list: show author's name
|
||||||
- osc submitreq: shortcut alias 'sr' added
|
- osc submitreq: shortcut alias 'sr' added
|
||||||
|
|
||||||
|
|
||||||
0.105:
|
0.105:
|
||||||
|
|
||||||
- osc submitreq list:
|
- osc submitreq list:
|
||||||
- can now be called without parameters, applying to the working copy then.
|
- can now be called without parameters, applying to the working copy then.
|
||||||
- calling it in a project directory is also possible now.
|
- calling it in a project directory is also possible now.
|
||||||
- output was improved. Newest requests are listed first.
|
- output was improved. Newest requests are listed first.
|
||||||
@ -411,7 +411,7 @@ Changes were from Marcus_H, poeml, dmueller, tpatzig.
|
|||||||
|
|
||||||
0.103:
|
0.103:
|
||||||
|
|
||||||
- osc submitreq create: simplify by make osc guess needed parameters, if
|
- osc submitreq create: simplify by make osc guess needed parameters, if
|
||||||
there is a working copy and it is a source link.
|
there is a working copy and it is a source link.
|
||||||
- osc submitreq create: don't stop on packages that have a devel project
|
- osc submitreq create: don't stop on packages that have a devel project
|
||||||
defined, if the submit actually comes from that project.
|
defined, if the submit actually comes from that project.
|
||||||
@ -459,7 +459,7 @@ Changes were from Marcus_H, poeml, dmueller, tpatzig.
|
|||||||
- osc maintainer: new -D/--devel-project switch
|
- osc maintainer: new -D/--devel-project switch
|
||||||
- BUILD_DIST environment variable will be ignored (bnc#359846)
|
- BUILD_DIST environment variable will be ignored (bnc#359846)
|
||||||
The following environment variables can still be used:
|
The following environment variables can still be used:
|
||||||
* OSC_SU_WRAPPER overrides the setting of su-wrapper.
|
* OSC_SU_WRAPPER overrides the setting of su-wrapper.
|
||||||
* OSC_BUILD_ROOT overrides the setting of build-root.
|
* OSC_BUILD_ROOT overrides the setting of build-root.
|
||||||
* OSC_PACKAGECACHEDIR overrides the setting of packagecachedir.
|
* OSC_PACKAGECACHEDIR overrides the setting of packagecachedir.
|
||||||
|
|
||||||
@ -560,7 +560,7 @@ Changes were from Marcus_H, poeml, dmueller, tpatzig.
|
|||||||
0.96:
|
0.96:
|
||||||
- following suggestions by Christian Boltz and Michal Marek, osc now memorizes
|
- following suggestions by Christian Boltz and Michal Marek, osc now memorizes
|
||||||
where a working copy was checked out from, saving the api server url to
|
where a working copy was checked out from, saving the api server url to
|
||||||
.osc/_apiurl.
|
.osc/_apiurl.
|
||||||
- implement 'info' subcommand
|
- implement 'info' subcommand
|
||||||
- use new api routes in all places
|
- use new api routes in all places
|
||||||
- buildhistory works again
|
- buildhistory works again
|
||||||
@ -571,7 +571,7 @@ Changes were from Marcus_H, poeml, dmueller, tpatzig.
|
|||||||
- applied patch from Michael Marek, fixing all places where error
|
- applied patch from Michael Marek, fixing all places where error
|
||||||
messages were printed to stdout instead of stderr. [#239404]
|
messages were printed to stdout instead of stderr. [#239404]
|
||||||
- osc is now easier to work with when using alternative API servers. The
|
- osc is now easier to work with when using alternative API servers. The
|
||||||
configured server can be overriden with -A <url> on the commandline.
|
configured server can be overriden with -A <url> on the commandline.
|
||||||
"apisrv" in the config takes a URL now, so the variable "scheme" which was
|
"apisrv" in the config takes a URL now, so the variable "scheme" which was
|
||||||
needed in addition before becomes obsolete. For backward compatibility, a
|
needed in addition before becomes obsolete. For backward compatibility, a
|
||||||
hostname (and scheme variable) are accepted like before. Likewise, the auth
|
hostname (and scheme variable) are accepted like before. Likewise, the auth
|
||||||
@ -588,7 +588,7 @@ Changes were from Marcus_H, poeml, dmueller, tpatzig.
|
|||||||
5 times in an iChain setup
|
5 times in an iChain setup
|
||||||
- adding http_GET/POST/PUT/DELETE() functions, which dispatch to
|
- adding http_GET/POST/PUT/DELETE() functions, which dispatch to
|
||||||
http_request(), and use them everywhere
|
http_request(), and use them everywhere
|
||||||
- removing othermethods.py
|
- removing othermethods.py
|
||||||
- keeping urlopen(), in case it is used from externally, but have it print out
|
- keeping urlopen(), in case it is used from externally, but have it print out
|
||||||
a "depracated" message
|
a "depracated" message
|
||||||
- finally, global option -H enables HTTP traffic debugging
|
- finally, global option -H enables HTTP traffic debugging
|
||||||
@ -598,7 +598,7 @@ Changes were from Marcus_H, poeml, dmueller, tpatzig.
|
|||||||
- suppress the legend in prjresults by default (show with -l)
|
- suppress the legend in prjresults by default (show with -l)
|
||||||
- --version shows the program version number
|
- --version shows the program version number
|
||||||
- fix the commit subcommand's argument handling. The following works correctly
|
- fix the commit subcommand's argument handling. The following works correctly
|
||||||
now: osc ci ../test/onlyinwc `pwd` fstab ../test/f2
|
now: osc ci ../test/onlyinwc `pwd` fstab ../test/f2
|
||||||
- fix the download progress meter to work with small terminals [#266989]
|
- fix the download progress meter to work with small terminals [#266989]
|
||||||
- update: when updating multiple packages, print each package name
|
- update: when updating multiple packages, print each package name
|
||||||
- make 'results' subcommand many times faster, by making only a single request
|
- make 'results' subcommand many times faster, by making only a single request
|
||||||
@ -643,7 +643,7 @@ Changes were from Marcus_H, poeml, dmueller, tpatzig.
|
|||||||
|
|
||||||
0.8:
|
0.8:
|
||||||
- build: use configuration from *local* specfile (e.g. BuildRequires)
|
- build: use configuration from *local* specfile (e.g. BuildRequires)
|
||||||
- build: let envvars OSC_SU_WRAPPER and OSC_BUILD_ROOT override config
|
- build: let envvars OSC_SU_WRAPPER and OSC_BUILD_ROOT override config
|
||||||
- build: allow 'dynamical' build-root setting by using %(repo)s and %(arch)s
|
- build: allow 'dynamical' build-root setting by using %(repo)s and %(arch)s
|
||||||
- add 'createpac/editpac' and 'createprj/editprj' subcommands which
|
- add 'createpac/editpac' and 'createprj/editprj' subcommands which
|
||||||
are similar to 'editmeta' but should be more logical to find
|
are similar to 'editmeta' but should be more logical to find
|
||||||
@ -672,7 +672,7 @@ Changes were from Marcus_H, poeml, dmueller, tpatzig.
|
|||||||
metadata from a specfile
|
metadata from a specfile
|
||||||
- fix profiling wrapper
|
- fix profiling wrapper
|
||||||
- set User-agent
|
- set User-agent
|
||||||
- bugfixes:
|
- bugfixes:
|
||||||
- fix handling of filenames with '+' signs
|
- fix handling of filenames with '+' signs
|
||||||
- make 'resolved' more robust
|
- make 'resolved' more robust
|
||||||
- fix merge on 'update' if called from another directory
|
- fix merge on 'update' if called from another directory
|
||||||
@ -703,7 +703,7 @@ Changes were from Marcus_H, poeml, dmueller, tpatzig.
|
|||||||
|
|
||||||
0.4:
|
0.4:
|
||||||
- allow 'up' inside a project directory (will automatically pull in all new
|
- allow 'up' inside a project directory (will automatically pull in all new
|
||||||
packages). (For past checkouts, you may need to put the project name into
|
packages). (For past checkouts, you may need to put the project name into
|
||||||
$prjdir/.osc/_project yourself).
|
$prjdir/.osc/_project yourself).
|
||||||
- checkout: preserve mtimes
|
- checkout: preserve mtimes
|
||||||
- add diff3 merge support. Locally modified files are merged with upstream changes
|
- add diff3 merge support. Locally modified files are merged with upstream changes
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
jw, Tue Oct 20 22:09:16 CEST 2009
|
jw, Tue Oct 20 22:09:16 CEST 2009
|
||||||
|
|
||||||
This is a feature suggestion for easier osc commandline handling.
|
This is a feature suggestion for easier osc commandline handling.
|
||||||
Many commands require specifying Project and/or Package names.
|
Many commands require specifying Project and/or Package names.
|
||||||
|
|
||||||
The current situation is not satisfying for the following reasons:
|
The current situation is not satisfying for the following reasons:
|
||||||
- inconsistent defaults. Some osc subcommands can take project
|
- inconsistent defaults. Some osc subcommands can take project
|
||||||
and/or package names from the current directory, if run inside a checkout
|
and/or package names from the current directory, if run inside a checkout
|
||||||
tree. If both project and package can use this default or only one, and if
|
tree. If both project and package can use this default or only one, and if
|
||||||
one, which, depends on the command. Users have a hard time memorizing
|
one, which, depends on the command. Users have a hard time memorizing
|
||||||
@ -12,22 +12,22 @@ The current situation is not satisfying for the following reasons:
|
|||||||
Examples as of osc version 0.123:
|
Examples as of osc version 0.123:
|
||||||
osc maintainer PRJ [PKG]
|
osc maintainer PRJ [PKG]
|
||||||
- does not look in the current directory.
|
- does not look in the current directory.
|
||||||
- need at least PRJ.
|
- need at least PRJ.
|
||||||
osc list [PRJ [PKG]]
|
osc list [PRJ [PKG]]
|
||||||
- Never looks at the current directory.
|
- Never looks at the current directory.
|
||||||
- lists all projects, if run without parameters.
|
- lists all projects, if run without parameters.
|
||||||
osc checkout [PRJ] PKG
|
osc checkout [PRJ] PKG
|
||||||
osc checkout PRJ
|
osc checkout PRJ
|
||||||
- takes project from current directory, if inside a checkout tree
|
- takes project from current directory, if inside a checkout tree
|
||||||
- else operates on an entire project.
|
- else operates on an entire project.
|
||||||
osc checkin [ARG]
|
osc checkin [ARG]
|
||||||
- defaults to current project and package,
|
- defaults to current project and package,
|
||||||
- if arg is a subdirectory, project is taken from current directory
|
- if arg is a subdirectory, project is taken from current directory
|
||||||
- if arg is a file, both project and package are taken from current
|
- if arg is a file, both project and package are taken from current
|
||||||
directory.
|
directory.
|
||||||
osc results [PRJ PKG]
|
osc results [PRJ PKG]
|
||||||
- takes either both or none from current directory.
|
- takes either both or none from current directory.
|
||||||
- many commands do not look into the current directory,
|
- many commands do not look into the current directory,
|
||||||
they are cumbersome to use.
|
they are cumbersome to use.
|
||||||
- sometimes PRJ/PKG can be used instead of PRJ PKG
|
- sometimes PRJ/PKG can be used instead of PRJ PKG
|
||||||
|
|
||||||
@ -50,25 +50,25 @@ used in parallel.
|
|||||||
--pkg, --pack, --package are synonyms.
|
--pkg, --pack, --package are synonyms.
|
||||||
|
|
||||||
osc shall support aliases, to save typing. Some implicit aliases exist,
|
osc shall support aliases, to save typing. Some implicit aliases exist,
|
||||||
with well defined magic effects. Aliases substitution is literal.
|
with well defined magic effects. Aliases substitution is literal.
|
||||||
They can replace options including their parameters, or just the option, or
|
They can replace options including their parameters, or just the option, or
|
||||||
just the parameters.
|
just the parameters.
|
||||||
- (a dash) expands to --prj openSUSE:Factory
|
- (a dash) expands to --prj openSUSE:Factory
|
||||||
(or --prj followed by any other project as defined in
|
(or --prj followed by any other project as defined in
|
||||||
~/.oscrc:default_project )
|
~/.oscrc:default_project )
|
||||||
--prj - is synonymous to just -, for consistency.
|
--prj - is synonymous to just -, for consistency.
|
||||||
|
|
||||||
. (a dot) evaluates the current working directory, searching for
|
. (a dot) evaluates the current working directory, searching for
|
||||||
.osc/_apiurl, .osc/_project, and .osc/_package
|
.osc/_apiurl, .osc/_project, and .osc/_package
|
||||||
Implicit --apiurl, --prj, or --pkg options are constructed as far
|
Implicit --apiurl, --prj, or --pkg options are constructed as far
|
||||||
as available from the current directory and as far as not already
|
as available from the current directory and as far as not already
|
||||||
present in the command line.
|
present in the command line.
|
||||||
If a dot is used as parameter to an option, it has a more
|
If a dot is used as parameter to an option, it has a more
|
||||||
deterministic meaning.
|
deterministic meaning.
|
||||||
--apiurl . Substitute only the current apiurl,
|
--apiurl . Substitute only the current apiurl,
|
||||||
--prj . Substitute the current project name, and provides
|
--prj . Substitute the current project name, and provides
|
||||||
a default for --apiurl unless given.
|
a default for --apiurl unless given.
|
||||||
--pkg . Substitures current package name likewise.
|
--pkg . Substitures current package name likewise.
|
||||||
|
|
||||||
./. expands to --prj . --pkg .
|
./. expands to --prj . --pkg .
|
||||||
./PKG expands to --prj . --pkg PKG
|
./PKG expands to --prj . --pkg PKG
|
||||||
@ -83,10 +83,10 @@ printed as debug output.
|
|||||||
|
|
||||||
online help of osc commands shall refer to the above syntax like this:
|
online help of osc commands shall refer to the above syntax like this:
|
||||||
|
|
||||||
osc CMD ... PROJ/PACK
|
osc CMD ... PROJ/PACK
|
||||||
|
|
||||||
An additional help entry
|
An additional help entry
|
||||||
|
|
||||||
osc help 'PROJ/PACK'
|
osc help 'PROJ/PACK'
|
||||||
|
|
||||||
shall explain the relevant details as presented herein.
|
shall explain the relevant details as presented herein.
|
||||||
|
37
README
37
README
@ -14,17 +14,18 @@ RPM packages are here (rpm-md repository):
|
|||||||
http://download.opensuse.org/repositories/openSUSE:/Tools/
|
http://download.opensuse.org/repositories/openSUSE:/Tools/
|
||||||
|
|
||||||
To install from svn, do
|
To install from svn, do
|
||||||
python setup.py build
|
|
||||||
python setup.py install
|
python setup.py build
|
||||||
# create a symlink 'osc' in your path pointing to osc.py.
|
python setup.py install
|
||||||
ln -s osc-wrapper.py /usr/bin/osc
|
# create a symlink 'osc' in your path pointing to osc.py.
|
||||||
|
ln -s osc-wrapper.py /usr/bin/osc
|
||||||
|
|
||||||
Alternatively, you can directly use osc-wrapper.py from the source dir
|
Alternatively, you can directly use osc-wrapper.py from the source dir
|
||||||
(which is easier if you develop on osc).
|
(which is easier if you develop on osc).
|
||||||
|
|
||||||
|
|
||||||
The program needs the cElementTree python module installed. On SUSE, the
|
The program needs the cElementTree python module installed. On SUSE, the
|
||||||
respective package is called python-elementtree (before 10.2: python-xml).
|
respective package is called python-elementtree (before 10.2: python-xml).
|
||||||
For local building, you will need python-urlgrabber in addition. Those are
|
For local building, you will need python-urlgrabber in addition. Those are
|
||||||
standard package on SUSE Linux since a while. If your version is too old, you
|
standard package on SUSE Linux since a while. If your version is too old, you
|
||||||
can find python-elementtree and python-urlgrabber here:
|
can find python-elementtree and python-urlgrabber here:
|
||||||
@ -132,29 +133,29 @@ USAGE EXAMPLES:
|
|||||||
(online at http://en.opensuse.org/Build_Service/CLI )
|
(online at http://en.opensuse.org/Build_Service/CLI )
|
||||||
|
|
||||||
To list existing content on the server
|
To list existing content on the server
|
||||||
osc ls # list projects
|
osc ls # list projects
|
||||||
osc ls Apache # list packages in a project
|
osc ls Apache # list packages in a project
|
||||||
osc ls Apache subversion # list files of package of a project
|
osc ls Apache subversion # list files of package of a project
|
||||||
|
|
||||||
Check out content
|
Check out content
|
||||||
osc co Apache # entire project
|
osc co Apache # entire project
|
||||||
osc co Apache subversion # a package
|
osc co Apache subversion # a package
|
||||||
osc co Apache subversion foo # single file
|
osc co Apache subversion foo # single file
|
||||||
|
|
||||||
Update a working copy
|
Update a working copy
|
||||||
osc up
|
osc up
|
||||||
osc up [pac_dir] # update a single package by its path
|
osc up [pac_dir] # update a single package by its path
|
||||||
osc up * # from within a project dir, update all packages
|
osc up * # from within a project dir, update all packages
|
||||||
osc up # from within a project dir, update all packages
|
osc up # from within a project dir, update all packages
|
||||||
AND check out all newly added packages
|
# AND check out all newly added packages
|
||||||
|
|
||||||
If an update can't be merged automatically, a file is in 'C' (conflict)
|
If an update can't be merged automatically, a file is in 'C' (conflict)
|
||||||
state, and conflicts are marked with special <<<<<<< and >>>>>>> lines.
|
state, and conflicts are marked with special <<<<<<< and >>>>>>> lines.
|
||||||
After manually resolving the problem, use
|
After manually resolving the problem, use
|
||||||
osc resolved foo
|
osc resolved foo
|
||||||
|
|
||||||
Upload change content
|
Upload change content
|
||||||
osc ci # current dir
|
osc ci # current dir
|
||||||
osc ci <dir>
|
osc ci <dir>
|
||||||
osc ci file1 file2 ...
|
osc ci file1 file2 ...
|
||||||
|
|
||||||
@ -171,7 +172,7 @@ Adds all new files in local copy and removes all disappeared files.
|
|||||||
osc addremove
|
osc addremove
|
||||||
|
|
||||||
Generates a diff, to view the changes
|
Generates a diff, to view the changes
|
||||||
osc diff # current dir
|
osc diff # current dir
|
||||||
osc diff file1 file2 ...
|
osc diff file1 file2 ...
|
||||||
|
|
||||||
Shows the build results of the package
|
Shows the build results of the package
|
||||||
|
8
TODO
8
TODO
@ -10,7 +10,7 @@ CRITICAL:
|
|||||||
-A apiurl prj/pkg
|
-A apiurl prj/pkg
|
||||||
-A apiurl prj:pkg
|
-A apiurl prj:pkg
|
||||||
apiurl/source/prj/pkg
|
apiurl/source/prj/pkg
|
||||||
The current working directory or its descendants should provide defaults
|
The current working directory or its descendants should provide defaults
|
||||||
for apiurl, prj and/or pkg.
|
for apiurl, prj and/or pkg.
|
||||||
|
|
||||||
MAJOR:
|
MAJOR:
|
||||||
@ -24,13 +24,13 @@ NORMAL:
|
|||||||
- implement (svn-like) switch command
|
- implement (svn-like) switch command
|
||||||
- implement 'mv' command
|
- implement 'mv' command
|
||||||
- commit: check if errors during PUT are handled sensibly, so the change is
|
- commit: check if errors during PUT are handled sensibly, so the change is
|
||||||
not committed to localmeta
|
not committed to localmeta
|
||||||
- add switch to commit to change repository options, like to e.g. disable publishing?
|
- add switch to commit to change repository options, like to e.g. disable publishing?
|
||||||
- implement optional logging to .osc/log, which could be useful for debugging bugs like
|
- implement optional logging to .osc/log, which could be useful for debugging bugs like
|
||||||
the one where api.opensuse.org sends empty replies (a hard-to-catch one)
|
the one where api.opensuse.org sends empty replies (a hard-to-catch one)
|
||||||
|
|
||||||
|
|
||||||
MINOR:
|
MINOR:
|
||||||
|
|
||||||
- osc checkout should display file download progress (bnc#442115)
|
- osc checkout should display file download progress (bnc#442115)
|
||||||
- adjust zsh completion to work with cmdln.py implementation
|
- adjust zsh completion to work with cmdln.py implementation
|
||||||
@ -42,7 +42,7 @@ MINOR:
|
|||||||
JW:
|
JW:
|
||||||
FIXME: osc co overwrites local changes without warning.
|
FIXME: osc co overwrites local changes without warning.
|
||||||
FIXME: when branching, the user should be added to bugowner, for the branch project.
|
FIXME: when branching, the user should be added to bugowner, for the branch project.
|
||||||
FIXME: 'osc rq' shall default to 'osc rq list -M -B -s all',
|
FIXME: 'osc rq' shall default to 'osc rq list -M -B -s all',
|
||||||
where -B shows requests related to packages where I am the bugowner.
|
where -B shows requests related to packages where I am the bugowner.
|
||||||
FIXME: 'osc log openSUSE:Factory PKG' should also point to the bsdevelproject
|
FIXME: 'osc log openSUSE:Factory PKG' should also point to the bsdevelproject
|
||||||
|
|
||||||
|
2
dist/osc.complete
vendored
2
dist/osc.complete
vendored
@ -162,7 +162,7 @@ rq|request)
|
|||||||
show)
|
show)
|
||||||
if ((count == 3)) ; then
|
if ((count == 3)) ; then
|
||||||
builtin compgen -W '--diff' -- "${cmdline[3]}"
|
builtin compgen -W '--diff' -- "${cmdline[3]}"
|
||||||
else
|
else
|
||||||
builtin echo -n 'ID'
|
builtin echo -n 'ID'
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -96,8 +96,8 @@ def run(prg):
|
|||||||
body = e.read()
|
body = e.read()
|
||||||
if getattr(prg.options, 'debug', None) or \
|
if getattr(prg.options, 'debug', None) or \
|
||||||
getattr(prg.conf, 'config', {}).get('debug', None):
|
getattr(prg.conf, 'config', {}).get('debug', None):
|
||||||
print >>sys.stderr, e.hdrs
|
print >>sys.stderr, e.hdrs
|
||||||
print >>sys.stderr, body
|
print >>sys.stderr, body
|
||||||
|
|
||||||
if e.code in [ 400, 403, 404, 500 ]:
|
if e.code in [ 400, 403, 404, 500 ]:
|
||||||
if '<summary>' in body:
|
if '<summary>' in body:
|
||||||
@ -119,7 +119,7 @@ def run(prg):
|
|||||||
print >>sys.stderr, e.msg
|
print >>sys.stderr, e.msg
|
||||||
if getattr(prg.options, 'debug', None) or \
|
if getattr(prg.options, 'debug', None) or \
|
||||||
getattr(prg.conf, 'config', {}).get('debug', None):
|
getattr(prg.conf, 'config', {}).get('debug', None):
|
||||||
print >>sys.stderr, e.e
|
print >>sys.stderr, e.e
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
except (oscerr.WrongOptions, oscerr.WrongArgs), e:
|
except (oscerr.WrongOptions, oscerr.WrongArgs), e:
|
||||||
|
34
osc/build.py
34
osc/build.py
@ -231,27 +231,27 @@ def get_built_files(pacdir, pactype):
|
|||||||
|
|
||||||
def get_repo(path):
|
def get_repo(path):
|
||||||
"""Walks up path looking for any repodata directories.
|
"""Walks up path looking for any repodata directories.
|
||||||
|
|
||||||
@param path path to a directory
|
@param path path to a directory
|
||||||
@return str path to repository directory containing repodata directory
|
@return str path to repository directory containing repodata directory
|
||||||
"""
|
"""
|
||||||
oldDirectory = None
|
oldDirectory = None
|
||||||
currentDirectory = os.path.abspath(path)
|
currentDirectory = os.path.abspath(path)
|
||||||
repositoryDirectory = None
|
repositoryDirectory = None
|
||||||
|
|
||||||
# while there are still parent directories
|
# while there are still parent directories
|
||||||
while currentDirectory != oldDirectory:
|
while currentDirectory != oldDirectory:
|
||||||
children = os.listdir(currentDirectory)
|
children = os.listdir(currentDirectory)
|
||||||
|
|
||||||
if "repodata" in children:
|
if "repodata" in children:
|
||||||
repositoryDirectory = currentDirectory
|
repositoryDirectory = currentDirectory
|
||||||
break
|
break
|
||||||
|
|
||||||
# ascend
|
# ascend
|
||||||
oldDirectory = currentDirectory
|
oldDirectory = currentDirectory
|
||||||
currentDirectory = os.path.abspath(os.path.join(oldDirectory,
|
currentDirectory = os.path.abspath(os.path.join(oldDirectory,
|
||||||
os.pardir))
|
os.pardir))
|
||||||
|
|
||||||
return repositoryDirectory
|
return repositoryDirectory
|
||||||
|
|
||||||
def get_prefer_pkgs(dirs, wanted_arch, type):
|
def get_prefer_pkgs(dirs, wanted_arch, type):
|
||||||
@ -259,11 +259,11 @@ def get_prefer_pkgs(dirs, wanted_arch, type):
|
|||||||
from util import repodata, packagequery, cpio
|
from util import repodata, packagequery, cpio
|
||||||
paths = []
|
paths = []
|
||||||
repositories = []
|
repositories = []
|
||||||
|
|
||||||
suffix = '*.rpm'
|
suffix = '*.rpm'
|
||||||
if type == 'dsc':
|
if type == 'dsc':
|
||||||
suffix = '*.deb'
|
suffix = '*.deb'
|
||||||
|
|
||||||
for dir in dirs:
|
for dir in dirs:
|
||||||
# check for repodata
|
# check for repodata
|
||||||
repository = get_repo(dir)
|
repository = get_repo(dir)
|
||||||
@ -271,15 +271,15 @@ def get_prefer_pkgs(dirs, wanted_arch, type):
|
|||||||
paths += glob.glob(os.path.join(os.path.abspath(dir), suffix))
|
paths += glob.glob(os.path.join(os.path.abspath(dir), suffix))
|
||||||
else:
|
else:
|
||||||
repositories.append(repository)
|
repositories.append(repository)
|
||||||
|
|
||||||
packageQueries = packagequery.PackageQueries(wanted_arch)
|
packageQueries = packagequery.PackageQueries(wanted_arch)
|
||||||
|
|
||||||
for repository in repositories:
|
for repository in repositories:
|
||||||
repodataPackageQueries = repodata.queries(repository)
|
repodataPackageQueries = repodata.queries(repository)
|
||||||
|
|
||||||
for packageQuery in repodataPackageQueries:
|
for packageQuery in repodataPackageQueries:
|
||||||
packageQueries.add(packageQuery)
|
packageQueries.add(packageQuery)
|
||||||
|
|
||||||
for path in paths:
|
for path in paths:
|
||||||
if path.endswith('src.rpm'):
|
if path.endswith('src.rpm'):
|
||||||
continue
|
continue
|
||||||
@ -287,10 +287,10 @@ def get_prefer_pkgs(dirs, wanted_arch, type):
|
|||||||
continue
|
continue
|
||||||
packageQuery = packagequery.PackageQuery.query(path)
|
packageQuery = packagequery.PackageQuery.query(path)
|
||||||
packageQueries.add(packageQuery)
|
packageQueries.add(packageQuery)
|
||||||
|
|
||||||
prefer_pkgs = dict((name, packageQuery.path())
|
prefer_pkgs = dict((name, packageQuery.path())
|
||||||
for name, packageQuery in packageQueries.iteritems())
|
for name, packageQuery in packageQueries.iteritems())
|
||||||
|
|
||||||
depfile = create_deps(packageQueries.values())
|
depfile = create_deps(packageQueries.values())
|
||||||
cpio = cpio.CpioWrite()
|
cpio = cpio.CpioWrite()
|
||||||
cpio.add('deps', '\n'.join(depfile))
|
cpio.add('deps', '\n'.join(depfile))
|
||||||
@ -582,7 +582,7 @@ def main(opts, argv):
|
|||||||
# OBS 1.5 and before has no downloadurl defined in buildinfo
|
# OBS 1.5 and before has no downloadurl defined in buildinfo
|
||||||
if bi.downloadurl:
|
if bi.downloadurl:
|
||||||
urllist.append(bi.downloadurl + '/%(extproject)s/%(extrepository)s/%(arch)s/%(filename)s')
|
urllist.append(bi.downloadurl + '/%(extproject)s/%(extrepository)s/%(arch)s/%(filename)s')
|
||||||
if not opts.cpio_bulk_download:
|
if not opts.cpio_bulk_download:
|
||||||
urllist.append( '%(apiurl)s/build/%(project)s/%(repository)s/%(repoarch)s/%(repopackage)s/%(repofilename)s' )
|
urllist.append( '%(apiurl)s/build/%(project)s/%(repository)s/%(repoarch)s/%(repopackage)s/%(repofilename)s' )
|
||||||
|
|
||||||
fetcher = Fetcher(cachedir = config['packagecachedir'],
|
fetcher = Fetcher(cachedir = config['packagecachedir'],
|
||||||
@ -623,9 +623,9 @@ def main(opts, argv):
|
|||||||
os.makedirs(os.path.join(pradir))
|
os.makedirs(os.path.join(pradir))
|
||||||
if not os.path.exists(tffn):
|
if not os.path.exists(tffn):
|
||||||
if opts.linksources:
|
if opts.linksources:
|
||||||
os.link(sffn, tffn)
|
os.link(sffn, tffn)
|
||||||
else:
|
else:
|
||||||
os.symlink(sffn, tffn)
|
os.symlink(sffn, tffn)
|
||||||
|
|
||||||
if bi.pacsuffix == 'rpm':
|
if bi.pacsuffix == 'rpm':
|
||||||
if opts.no_verify or opts.noinit:
|
if opts.no_verify or opts.noinit:
|
||||||
@ -654,7 +654,7 @@ def main(opts, argv):
|
|||||||
else:
|
else:
|
||||||
print 'WARNING: deb packages get not verified, they can compromise your system !'
|
print 'WARNING: deb packages get not verified, they can compromise your system !'
|
||||||
else:
|
else:
|
||||||
print 'WARNING: unknown packages get not verified, they can compromise your system !'
|
print 'WARNING: unknown packages get not verified, they can compromise your system !'
|
||||||
|
|
||||||
print 'Writing build configuration'
|
print 'Writing build configuration'
|
||||||
|
|
||||||
|
151
osc/checker.py
151
osc/checker.py
@ -7,96 +7,95 @@ import rpm
|
|||||||
import base64
|
import base64
|
||||||
|
|
||||||
class KeyError(Exception):
|
class KeyError(Exception):
|
||||||
def __init__(self, key, *args):
|
def __init__(self, key, *args):
|
||||||
Exception.__init__(self)
|
Exception.__init__(self)
|
||||||
self.args = args
|
self.args = args
|
||||||
self.key = key
|
self.key = key
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return ''+self.key+' :'+' '.join(self.args)
|
return ''+self.key+' :'+' '.join(self.args)
|
||||||
|
|
||||||
class Checker:
|
class Checker:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.dbdir = mkdtemp(prefix='oscrpmdb')
|
self.dbdir = mkdtemp(prefix='oscrpmdb')
|
||||||
self.imported = {}
|
self.imported = {}
|
||||||
rpm.addMacro('_dbpath', self.dbdir)
|
rpm.addMacro('_dbpath', self.dbdir)
|
||||||
self.ts = rpm.TransactionSet()
|
self.ts = rpm.TransactionSet()
|
||||||
self.ts.initDB()
|
self.ts.initDB()
|
||||||
self.ts.openDB()
|
self.ts.openDB()
|
||||||
self.ts.setVSFlags(0)
|
self.ts.setVSFlags(0)
|
||||||
#self.ts.Debug(1)
|
#self.ts.Debug(1)
|
||||||
|
|
||||||
def readkeys(self, keys=[]):
|
def readkeys(self, keys=[]):
|
||||||
rpm.addMacro('_dbpath', self.dbdir)
|
rpm.addMacro('_dbpath', self.dbdir)
|
||||||
for key in keys:
|
for key in keys:
|
||||||
self.readkey(key)
|
self.readkey(key)
|
||||||
|
|
||||||
rpm.delMacro("_dbpath")
|
rpm.delMacro("_dbpath")
|
||||||
|
|
||||||
# python is an idiot
|
# python is an idiot
|
||||||
# def __del__(self):
|
# def __del__(self):
|
||||||
# self.cleanup()
|
# self.cleanup()
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
self.ts.closeDB()
|
self.ts.closeDB()
|
||||||
rmtree(self.dbdir)
|
rmtree(self.dbdir)
|
||||||
|
|
||||||
def readkey(self, file):
|
def readkey(self, file):
|
||||||
if file in self.imported:
|
if file in self.imported:
|
||||||
return
|
return
|
||||||
|
|
||||||
fd = open(file, "r")
|
fd = open(file, "r")
|
||||||
line = fd.readline()
|
line = fd.readline()
|
||||||
if line and line[0:14] == "-----BEGIN PGP":
|
if line and line[0:14] == "-----BEGIN PGP":
|
||||||
line = fd.readline()
|
line = fd.readline()
|
||||||
while line and line != "\n":
|
while line and line != "\n":
|
||||||
line = fd.readline()
|
line = fd.readline()
|
||||||
if not line:
|
if not line:
|
||||||
raise KeyError(file, "not a pgp public key")
|
raise KeyError(file, "not a pgp public key")
|
||||||
else:
|
else:
|
||||||
raise KeyError(file, "not a pgp public key")
|
raise KeyError(file, "not a pgp public key")
|
||||||
|
|
||||||
key = ''
|
|
||||||
line = fd.readline()
|
|
||||||
while line:
|
|
||||||
if line[0:12] == "-----END PGP":
|
|
||||||
break
|
|
||||||
line = line.rstrip()
|
|
||||||
key += line
|
|
||||||
line = fd.readline()
|
|
||||||
fd.close()
|
|
||||||
if not line or line[0:12] != "-----END PGP":
|
|
||||||
raise KeyError(file, "not a pgp public key")
|
|
||||||
|
|
||||||
bkey = base64.b64decode(key)
|
key = ''
|
||||||
|
line = fd.readline()
|
||||||
|
while line:
|
||||||
|
if line[0:12] == "-----END PGP":
|
||||||
|
break
|
||||||
|
line = line.rstrip()
|
||||||
|
key += line
|
||||||
|
line = fd.readline()
|
||||||
|
fd.close()
|
||||||
|
if not line or line[0:12] != "-----END PGP":
|
||||||
|
raise KeyError(file, "not a pgp public key")
|
||||||
|
|
||||||
r = self.ts.pgpImportPubkey(bkey)
|
bkey = base64.b64decode(key)
|
||||||
if r != 0:
|
|
||||||
raise KeyError(file, "failed to import pubkey")
|
|
||||||
self.imported[file] = 1
|
|
||||||
|
|
||||||
def check(self, pkg):
|
r = self.ts.pgpImportPubkey(bkey)
|
||||||
fd = os.open(pkg, os.O_RDONLY)
|
if r != 0:
|
||||||
hdr = self.ts.hdrFromFdno(fd)
|
raise KeyError(file, "failed to import pubkey")
|
||||||
os.close(fd)
|
self.imported[file] = 1
|
||||||
|
|
||||||
|
def check(self, pkg):
|
||||||
|
fd = os.open(pkg, os.O_RDONLY)
|
||||||
|
hdr = self.ts.hdrFromFdno(fd)
|
||||||
|
os.close(fd)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import sys
|
import sys
|
||||||
keyfiles = []
|
keyfiles = []
|
||||||
pkgs = []
|
pkgs = []
|
||||||
for arg in sys.argv[1:]:
|
for arg in sys.argv[1:]:
|
||||||
if arg[-4:] == '.rpm':
|
if arg[-4:] == '.rpm':
|
||||||
pkgs.append(arg)
|
pkgs.append(arg)
|
||||||
else:
|
else:
|
||||||
keyfiles.append(arg)
|
keyfiles.append(arg)
|
||||||
|
|
||||||
checker = Checker()
|
|
||||||
try:
|
|
||||||
checker.readkeys(keyfiles)
|
|
||||||
for pkg in pkgs:
|
|
||||||
checker.check(pkg)
|
|
||||||
except Exception, e:
|
|
||||||
checker.cleanup()
|
|
||||||
raise e
|
|
||||||
|
|
||||||
|
checker = Checker()
|
||||||
|
try:
|
||||||
|
checker.readkeys(keyfiles)
|
||||||
|
for pkg in pkgs:
|
||||||
|
checker.check(pkg)
|
||||||
|
except Exception, e:
|
||||||
|
checker.cleanup()
|
||||||
|
raise e
|
||||||
|
|
||||||
# vim: sw=4 et
|
# vim: sw=4 et
|
||||||
|
@ -28,11 +28,11 @@ MAN_FOOTER = r"""
|
|||||||
Type 'osc help <subcommand>' for more detailed help on a specific subcommand.
|
Type 'osc help <subcommand>' for more detailed help on a specific subcommand.
|
||||||
.PP
|
.PP
|
||||||
For additional information, see
|
For additional information, see
|
||||||
* http://www.opensuse.org/Build_Service_Tutorial
|
* http://en.opensuse.org/Build_Service_Tutorial
|
||||||
* http://www.opensuse.org/Build_Service/CLI
|
* http://en.opensuse.org/Build_Service/CLI
|
||||||
.PP
|
.PP
|
||||||
You can modify osc commands, or roll you own, via the plugin API:
|
You can modify osc commands, or roll you own, via the plugin API:
|
||||||
* http://www.opensuse.org/Build_Service/osc_plugins
|
* http://en.opensuse.org/Build_Service/osc_plugins
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
osc was written by several authors. This man page is automatically generated.
|
osc was written by several authors. This man page is automatically generated.
|
||||||
"""
|
"""
|
||||||
@ -48,11 +48,11 @@ class Osc(cmdln.Cmdln):
|
|||||||
${help_list}
|
${help_list}
|
||||||
global ${option_list}
|
global ${option_list}
|
||||||
For additional information, see
|
For additional information, see
|
||||||
* http://www.opensuse.org/Build_Service_Tutorial
|
* http://en.opensuse.org/Build_Service_Tutorial
|
||||||
* http://www.opensuse.org/Build_Service/CLI
|
* http://en.opensuse.org/Build_Service/CLI
|
||||||
|
|
||||||
You can modify osc commands, or roll you own, via the plugin API:
|
You can modify osc commands, or roll you own, via the plugin API:
|
||||||
* http://www.opensuse.org/Build_Service/osc_plugins
|
* http://en.opensuse.org/Build_Service/osc_plugins
|
||||||
"""
|
"""
|
||||||
name = 'osc'
|
name = 'osc'
|
||||||
conf = None
|
conf = None
|
||||||
@ -388,12 +388,12 @@ class Osc(cmdln.Cmdln):
|
|||||||
for p in meta_get_packagelist(apiurl, project):
|
for p in meta_get_packagelist(apiurl, project):
|
||||||
if p.startswith("_patchinfo:"):
|
if p.startswith("_patchinfo:"):
|
||||||
patchinfo = p
|
patchinfo = p
|
||||||
|
|
||||||
if opts.force or not patchinfo:
|
if opts.force or not patchinfo:
|
||||||
print "Creating initial patchinfo..."
|
print "Creating initial patchinfo..."
|
||||||
query='cmd=createpatchinfo'
|
query='cmd=createpatchinfo'
|
||||||
if args and args[0]:
|
if args and args[0]:
|
||||||
query += "&name=" + args[0]
|
query += "&name=" + args[0]
|
||||||
url = makeurl(apiurl, ['source', project], query=query)
|
url = makeurl(apiurl, ['source', project], query=query)
|
||||||
f = http_POST(url)
|
f = http_POST(url)
|
||||||
for p in meta_get_packagelist(apiurl, project):
|
for p in meta_get_packagelist(apiurl, project):
|
||||||
@ -777,8 +777,8 @@ class Osc(cmdln.Cmdln):
|
|||||||
for p in pac:
|
for p in pac:
|
||||||
result = create_submit_request(apiurl, project, p)
|
result = create_submit_request(apiurl, project, p)
|
||||||
if not result:
|
if not result:
|
||||||
# sys.exit(result)
|
# sys.exit(result)
|
||||||
sys.exit("submit request creation failed")
|
sys.exit("submit request creation failed")
|
||||||
sr_ids.append(result)
|
sr_ids.append(result)
|
||||||
|
|
||||||
# create submit requests for all found patchinfos
|
# create submit requests for all found patchinfos
|
||||||
@ -798,13 +798,13 @@ class Osc(cmdln.Cmdln):
|
|||||||
(actionxml, cgi.escape(opts.message or ""))
|
(actionxml, cgi.escape(opts.message or ""))
|
||||||
u = makeurl(apiurl, ['request'], query='cmd=create')
|
u = makeurl(apiurl, ['request'], query='cmd=create')
|
||||||
f = http_POST(u, data=xml)
|
f = http_POST(u, data=xml)
|
||||||
|
|
||||||
root = ET.parse(f).getroot()
|
root = ET.parse(f).getroot()
|
||||||
sr_ids.append(root.get('id'))
|
sr_ids.append(root.get('id'))
|
||||||
|
|
||||||
print "Requests created: ",
|
print "Requests created: ",
|
||||||
for i in sr_ids:
|
for i in sr_ids:
|
||||||
print i,
|
print i,
|
||||||
sys.exit('Successfull finished')
|
sys.exit('Successfull finished')
|
||||||
|
|
||||||
elif len(args) <= 2:
|
elif len(args) <= 2:
|
||||||
@ -1589,7 +1589,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
package, tproject)
|
package, tproject)
|
||||||
|
|
||||||
if r is None:
|
if r is None:
|
||||||
print >>sys.stderr, 'ERROR: Attribute branch call came not back with a project.'
|
print >>sys.stderr, 'ERROR: Attribute branch call came not back with a project.'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
print "Project " + r + " created."
|
print "Project " + r + " created."
|
||||||
@ -1942,9 +1942,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
args = slash_split(args)
|
args = slash_split(args)
|
||||||
args = expand_proj_pack(args)
|
args = expand_proj_pack(args)
|
||||||
|
|
||||||
## FIXME:
|
## FIXME:
|
||||||
## if there is only one argument, and it ends in .ymp
|
## if there is only one argument, and it ends in .ymp
|
||||||
## then fetch it, Parse XML to get the first
|
## then fetch it, Parse XML to get the first
|
||||||
## metapackage.group.repositories.repository.url
|
## metapackage.group.repositories.repository.url
|
||||||
## and construct zypper cmd's for all
|
## and construct zypper cmd's for all
|
||||||
## metapackage.group.software.item.name
|
## metapackage.group.software.item.name
|
||||||
@ -2698,7 +2698,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
opts.name_filter = None
|
opts.name_filter = None
|
||||||
opts.status_filter = None
|
opts.status_filter = None
|
||||||
opts.vertical = None
|
opts.vertical = None
|
||||||
self.do_prjresults('prjresults', opts, *args);
|
self.do_prjresults('prjresults', opts, *args)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
project = store_read_project(wd)
|
project = store_read_project(wd)
|
||||||
@ -2819,21 +2819,21 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
|
|
||||||
def print_repos(self):
|
def print_repos(self):
|
||||||
wd = os.curdir
|
wd = os.curdir
|
||||||
doprint = False
|
doprint = False
|
||||||
if is_package_dir(wd):
|
if is_package_dir(wd):
|
||||||
str = "package"
|
str = "package"
|
||||||
doprint = True
|
doprint = True
|
||||||
elif is_project_dir(wd):
|
elif is_project_dir(wd):
|
||||||
str = "project"
|
str = "project"
|
||||||
doprint = True
|
doprint = True
|
||||||
|
|
||||||
if doprint:
|
if doprint:
|
||||||
print 'Valid arguments for this %s are:' % str
|
print 'Valid arguments for this %s are:' % str
|
||||||
print
|
print
|
||||||
self.do_repos(None, None)
|
self.do_repos(None, None)
|
||||||
print
|
print
|
||||||
raise oscerr.WrongArgs('Missing arguments')
|
raise oscerr.WrongArgs('Missing arguments')
|
||||||
|
|
||||||
@cmdln.alias('rbl')
|
@cmdln.alias('rbl')
|
||||||
@cmdln.alias('rbuildlog')
|
@cmdln.alias('rbuildlog')
|
||||||
@ -2864,7 +2864,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
raise oscerr.WrongArgs('Too many arguments.')
|
raise oscerr.WrongArgs('Too many arguments.')
|
||||||
else:
|
else:
|
||||||
project, package, repository, arch = args
|
project, package, repository, arch = args
|
||||||
|
|
||||||
offset=0
|
offset=0
|
||||||
if opts.start:
|
if opts.start:
|
||||||
offset = int(opts.start)
|
offset = int(opts.start)
|
||||||
@ -2954,15 +2954,15 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
wd = os.curdir
|
wd = os.curdir
|
||||||
args = slash_split(args)
|
args = slash_split(args)
|
||||||
project = package = repository = arch = None
|
project = package = repository = arch = None
|
||||||
|
|
||||||
if len(args) < 2:
|
if len(args) < 2:
|
||||||
self.print_repos()
|
self.print_repos()
|
||||||
|
|
||||||
if len(args) == 2: # 2
|
if len(args) == 2: # 2
|
||||||
if is_package_dir('.'):
|
if is_package_dir('.'):
|
||||||
package = store_read_package(wd)
|
package = store_read_package(wd)
|
||||||
else:
|
else:
|
||||||
raise oscerr.WrongArgs('package is not specified.')
|
raise oscerr.WrongArgs('package is not specified.')
|
||||||
project = store_read_project(wd)
|
project = store_read_project(wd)
|
||||||
apiurl = store_read_apiurl(wd)
|
apiurl = store_read_apiurl(wd)
|
||||||
repository = args[0]
|
repository = args[0]
|
||||||
@ -2982,9 +2982,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
reason = root.find('explain').text
|
reason = root.find('explain').text
|
||||||
print reason
|
print reason
|
||||||
if reason == "meta change":
|
if reason == "meta change":
|
||||||
print "changed keys:"
|
print "changed keys:"
|
||||||
for package in root.findall('packagechange'):
|
for package in root.findall('packagechange'):
|
||||||
print " ", package.get('change'), package.get('key')
|
print " ", package.get('change'), package.get('key')
|
||||||
|
|
||||||
|
|
||||||
# FIXME: the new osc syntax should allow to specify multiple packages
|
# FIXME: the new osc syntax should allow to specify multiple packages
|
||||||
@ -2997,9 +2997,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
will be triggered when a certain package changes.
|
will be triggered when a certain package changes.
|
||||||
This is no guarantee, since the new build might have changed dependencies.
|
This is no guarantee, since the new build might have changed dependencies.
|
||||||
|
|
||||||
dependson shows the build dependencies inside of a project, valid for a
|
dependson shows the build dependencies inside of a project, valid for a
|
||||||
given repository and architecture.
|
given repository and architecture.
|
||||||
NOTE: to see all binary packages, which can trigger a build you need to
|
NOTE: to see all binary packages, which can trigger a build you need to
|
||||||
refer the buildinfo, since this command shows only the dependencies
|
refer the buildinfo, since this command shows only the dependencies
|
||||||
inside of a project.
|
inside of a project.
|
||||||
|
|
||||||
@ -3019,7 +3019,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
wd = os.curdir
|
wd = os.curdir
|
||||||
args = slash_split(args)
|
args = slash_split(args)
|
||||||
project = packages = repository = arch = reverse = None
|
project = packages = repository = arch = reverse = None
|
||||||
|
|
||||||
if len(args) < 2 and (is_package_dir('.') or is_project_dir('.')):
|
if len(args) < 2 and (is_package_dir('.') or is_project_dir('.')):
|
||||||
self.print_repos()
|
self.print_repos()
|
||||||
|
|
||||||
@ -3028,9 +3028,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
if len(args) < 3: # 2
|
if len(args) < 3: # 2
|
||||||
if is_package_dir('.'):
|
if is_package_dir('.'):
|
||||||
packages = [store_read_package(wd)]
|
packages = [store_read_package(wd)]
|
||||||
elif not is_project_dir('.'):
|
elif not is_project_dir('.'):
|
||||||
raise oscerr.WrongArgs('Project and package is not specified.')
|
raise oscerr.WrongArgs('Project and package is not specified.')
|
||||||
project = store_read_project(wd)
|
project = store_read_project(wd)
|
||||||
apiurl = store_read_apiurl(wd)
|
apiurl = store_read_apiurl(wd)
|
||||||
repository = args[0]
|
repository = args[0]
|
||||||
@ -3058,7 +3058,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
for package in root.findall('package'):
|
for package in root.findall('package'):
|
||||||
print package.get('name'), ":"
|
print package.get('name'), ":"
|
||||||
for dep in package.findall('pkgdep'):
|
for dep in package.findall('pkgdep'):
|
||||||
print " ", dep.text
|
print " ", dep.text
|
||||||
|
|
||||||
|
|
||||||
@cmdln.option('-x', '--extra-pkgs', metavar='PAC', action='append',
|
@cmdln.option('-x', '--extra-pkgs', metavar='PAC', action='append',
|
||||||
@ -3090,7 +3090,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
"""
|
"""
|
||||||
wd = os.curdir
|
wd = os.curdir
|
||||||
args = slash_split(args)
|
args = slash_split(args)
|
||||||
|
|
||||||
if len(args) < 2 and is_package_dir('.'):
|
if len(args) < 2 and is_package_dir('.'):
|
||||||
self.print_repos()
|
self.print_repos()
|
||||||
|
|
||||||
@ -3151,7 +3151,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
wd = os.curdir
|
wd = os.curdir
|
||||||
args = slash_split(args)
|
args = slash_split(args)
|
||||||
|
|
||||||
if len(args) < 2 and is_package_dir('.'):
|
if len(args) < 2 and is_package_dir('.'):
|
||||||
self.print_repos()
|
self.print_repos()
|
||||||
|
|
||||||
@ -4123,7 +4123,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
extra_limiter='attribute/@name="%s"' % (opts.limit_to_attribute)
|
extra_limiter='attribute/@name="%s"' % (opts.limit_to_attribute)
|
||||||
if not opts.substring:
|
if not opts.substring:
|
||||||
opts.exact = True
|
opts.exact = True
|
||||||
|
|
||||||
|
|
||||||
role_filter=None
|
role_filter=None
|
||||||
if for_user:
|
if for_user:
|
||||||
@ -4376,7 +4376,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
def do_bugowner(self, subcmd, opts, *args):
|
def do_bugowner(self, subcmd, opts, *args):
|
||||||
"""${cmd_name}: Show bugowners of a project/package
|
"""${cmd_name}: Show bugowners of a project/package
|
||||||
|
|
||||||
osc bugowner PRJ
|
osc bugowner PRJ
|
||||||
osc bugowner PRJ PKG
|
osc bugowner PRJ PKG
|
||||||
|
|
||||||
Shortcut for osc maintainer -B [PRJ] PKG
|
Shortcut for osc maintainer -B [PRJ] PKG
|
||||||
@ -4819,7 +4819,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
dir_oldpatched = { 'apiurl': p.apiurl, 'project': p.prjname, 'package': p.name, 'srcmd5': p.srcmd5 }
|
dir_oldpatched = { 'apiurl': p.apiurl, 'project': p.prjname, 'package': p.name, 'srcmd5': p.srcmd5 }
|
||||||
dir_oldpatched['entries'] = [[f.name, f.md5] for f in p.filelist]
|
dir_oldpatched['entries'] = [[f.name, f.md5] for f in p.filelist]
|
||||||
|
|
||||||
query = { 'rev': linkinfo.srcmd5 }
|
query = { 'rev': linkinfo.srcmd5 }
|
||||||
u = makeurl(p.apiurl, ['source', linkinfo.project, linkinfo.package], query=query)
|
u = makeurl(p.apiurl, ['source', linkinfo.project, linkinfo.package], query=query)
|
||||||
f = http_GET(u)
|
f = http_GET(u)
|
||||||
|
14
osc/conf.py
14
osc/conf.py
@ -156,7 +156,7 @@ apiurl = %(apiurl)s
|
|||||||
# This is convenient when sharing the buildroot with ordinary userids
|
# This is convenient when sharing the buildroot with ordinary userids
|
||||||
# on the host.
|
# on the host.
|
||||||
# This should not be 0
|
# This should not be 0
|
||||||
# build-uid =
|
# build-uid =
|
||||||
|
|
||||||
# extra packages to install when building packages locally (osc build)
|
# extra packages to install when building packages locally (osc build)
|
||||||
# this corresponds to osc build's -x option and can be overridden with that
|
# this corresponds to osc build's -x option and can be overridden with that
|
||||||
@ -325,12 +325,12 @@ def init_basicauth(config):
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
if sys.version_info < (2, 6):
|
if sys.version_info < (2, 6):
|
||||||
# HTTPS proxy is not supported in old urllib2. It only leads to an error
|
# HTTPS proxy is not supported in old urllib2. It only leads to an error
|
||||||
# or, at best, a warning.
|
# or, at best, a warning.
|
||||||
if 'https_proxy' in os.environ:
|
if 'https_proxy' in os.environ:
|
||||||
del os.environ['https_proxy']
|
del os.environ['https_proxy']
|
||||||
if 'HTTPS_PROXY' in os.environ:
|
if 'HTTPS_PROXY' in os.environ:
|
||||||
del os.environ['HTTPS_PROXY']
|
del os.environ['HTTPS_PROXY']
|
||||||
|
|
||||||
if config['http_debug']:
|
if config['http_debug']:
|
||||||
# brute force
|
# brute force
|
||||||
|
26
osc/core.py
26
osc/core.py
@ -1727,7 +1727,7 @@ def parse_buildlogurl(buildlogurl):
|
|||||||
m = BUILDLOGURL_RE.match(buildlogurl)
|
m = BUILDLOGURL_RE.match(buildlogurl)
|
||||||
if not m:
|
if not m:
|
||||||
raise oscerr.WrongArgs('\'%s\' does not look like url with a build log' % buildlogurl)
|
raise oscerr.WrongArgs('\'%s\' does not look like url with a build log' % buildlogurl)
|
||||||
|
|
||||||
return (m.group('apiurl'), m.group('project'), m.group('package'), m.group('repository'), m.group('arch'))
|
return (m.group('apiurl'), m.group('project'), m.group('package'), m.group('repository'), m.group('arch'))
|
||||||
|
|
||||||
def slash_split(l):
|
def slash_split(l):
|
||||||
@ -2139,17 +2139,17 @@ def show_attribute_meta(apiurl, prj, pac, subpac, attribute, with_defaults, with
|
|||||||
path.append('source')
|
path.append('source')
|
||||||
path.append(prj)
|
path.append(prj)
|
||||||
if pac:
|
if pac:
|
||||||
path.append(pac)
|
path.append(pac)
|
||||||
if pac and subpac:
|
if pac and subpac:
|
||||||
path.append(subpac)
|
path.append(subpac)
|
||||||
path.append('_attribute')
|
path.append('_attribute')
|
||||||
if attribute:
|
if attribute:
|
||||||
path.append(attribute)
|
path.append(attribute)
|
||||||
query=[]
|
query=[]
|
||||||
if with_defaults:
|
if with_defaults:
|
||||||
query.append("with_default=1")
|
query.append("with_default=1")
|
||||||
if with_project:
|
if with_project:
|
||||||
query.append("with_project=1")
|
query.append("with_project=1")
|
||||||
url = makeurl(apiurl, path, query)
|
url = makeurl(apiurl, path, query)
|
||||||
try:
|
try:
|
||||||
f = http_GET(url)
|
f = http_GET(url)
|
||||||
@ -2547,10 +2547,10 @@ def create_submit_request(apiurl,
|
|||||||
# Yes, this kind of xml construction is horrible
|
# Yes, this kind of xml construction is horrible
|
||||||
targetxml = ""
|
targetxml = ""
|
||||||
if dst_project:
|
if dst_project:
|
||||||
packagexml = ""
|
packagexml = ""
|
||||||
if dst_package:
|
if dst_package:
|
||||||
packagexml = """package="%s" """ %( dst_package )
|
packagexml = """package="%s" """ %( dst_package )
|
||||||
targetxml = """<target project="%s" %s /> """ %( dst_project, packagexml )
|
targetxml = """<target project="%s" %s /> """ %( dst_project, packagexml )
|
||||||
# XXX: keep the old template for now in order to work with old obs instances
|
# XXX: keep the old template for now in order to work with old obs instances
|
||||||
xml = """\
|
xml = """\
|
||||||
<request type="submit">
|
<request type="submit">
|
||||||
@ -3496,7 +3496,9 @@ def get_results(apiurl, prj, package, lastbuild=None, repository=[], arch=[]):
|
|||||||
rmap['status'] = ''
|
rmap['status'] = ''
|
||||||
|
|
||||||
if rmap['status'] in ['expansion error', 'broken', 'blocked', 'finished']:
|
if rmap['status'] in ['expansion error', 'broken', 'blocked', 'finished']:
|
||||||
rmap['status'] += ': ' + statusnode.find('details').text
|
details = statusnode.find('details')
|
||||||
|
if details != None:
|
||||||
|
rmap['status'] += ': ' + details.text
|
||||||
|
|
||||||
if rmap['dirty'] == 'true':
|
if rmap['dirty'] == 'true':
|
||||||
rmap['status'] = 'state is outdated (was: %s)' % rmap['status']
|
rmap['status'] = 'state is outdated (was: %s)' % rmap['status']
|
||||||
@ -3644,7 +3646,7 @@ def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=Non
|
|||||||
for i in range(0, len(targets)):
|
for i in range(0, len(targets)):
|
||||||
line.append(str(i%10))
|
line.append(str(i%10))
|
||||||
r.append(' '.join(line))
|
r.append(' '.join(line))
|
||||||
|
|
||||||
r.append('')
|
r.append('')
|
||||||
|
|
||||||
if not hide_legend and len(pacs):
|
if not hide_legend and len(pacs):
|
||||||
|
@ -114,9 +114,9 @@ class Fetcher:
|
|||||||
pkgq = packagequery.PackageQuery.query(tmpfile, extra_rpmtags=(1044, 1051, 1052))
|
pkgq = packagequery.PackageQuery.query(tmpfile, extra_rpmtags=(1044, 1051, 1052))
|
||||||
arch = pkgq.arch()
|
arch = pkgq.arch()
|
||||||
# SOURCERPM = 1044
|
# SOURCERPM = 1044
|
||||||
if pkgq.filename_suffix == 'rpm' and not pkgq.getTag(1044):
|
if pkgq.filename_suffix == 'rpm' and not pkgq.gettag(1044):
|
||||||
# NOSOURCE = 1051, NOPATCH = 1052
|
# NOSOURCE = 1051, NOPATCH = 1052
|
||||||
if pkgq.getTag(1051) or pkgq.getTag(1052):
|
if pkgq.gettag(1051) or pkgq.gettag(1052):
|
||||||
arch = "nosrc"
|
arch = "nosrc"
|
||||||
else:
|
else:
|
||||||
arch = "src"
|
arch = "src"
|
||||||
|
@ -176,7 +176,7 @@ class myHTTPSHandler(M2Crypto.m2urllib2.HTTPSHandler):
|
|||||||
|
|
||||||
# Our change: Check to see if we're using a proxy.
|
# Our change: Check to see if we're using a proxy.
|
||||||
# Then create an appropriate ssl-aware connection.
|
# Then create an appropriate ssl-aware connection.
|
||||||
full_url = req.get_full_url()
|
full_url = req.get_full_url()
|
||||||
target_host = urlparse.urlparse(full_url)[1]
|
target_host = urlparse.urlparse(full_url)[1]
|
||||||
|
|
||||||
if (target_host != host):
|
if (target_host != host):
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
class NoSecureSSLError(Exception):
|
class NoSecureSSLError(Exception):
|
||||||
def __init__(self, msg):
|
def __init__(self, msg):
|
||||||
|
Exception.__init__(self)
|
||||||
self.msg = msg
|
self.msg = msg
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.msg
|
return self.msg
|
||||||
|
@ -104,7 +104,7 @@ class DebQuery(packagequery.PackageQuery):
|
|||||||
def requires(self):
|
def requires(self):
|
||||||
return self.fields['depends']
|
return self.fields['depends']
|
||||||
|
|
||||||
def getTag(self, num):
|
def gettag(self, num):
|
||||||
return self.fields.get(num, None)
|
return self.fields.get(num, None)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -9,36 +9,36 @@ class PackageQueries(dict):
|
|||||||
package query, to a name, the package is evaluated to see if it matches the
|
package query, to a name, the package is evaluated to see if it matches the
|
||||||
wanted architecture and if it has a greater version than the current value.
|
wanted architecture and if it has a greater version than the current value.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# map debian arches to common obs arches
|
# map debian arches to common obs arches
|
||||||
architectureMap = {'i386': ['i586', 'i686'], 'amd64': ['x86_64']}
|
architectureMap = {'i386': ['i586', 'i686'], 'amd64': ['x86_64']}
|
||||||
|
|
||||||
def __init__(self, wantedArchitecture):
|
def __init__(self, wanted_architecture):
|
||||||
self.wantedArchitecture = wantedArchitecture
|
self.wanted_architecture = wanted_architecture
|
||||||
super(PackageQueries, self).__init__()
|
super(PackageQueries, self).__init__()
|
||||||
|
|
||||||
def add(self, query):
|
def add(self, query):
|
||||||
"""Adds package query to dict if it is of the correct architecture and
|
"""Adds package query to dict if it is of the correct architecture and
|
||||||
is newer (has a greater version) than the currently assigned package.
|
is newer (has a greater version) than the currently assigned package.
|
||||||
|
|
||||||
@param a PackageQuery
|
@param a PackageQuery
|
||||||
"""
|
"""
|
||||||
self.__setitem__(query.name(), query)
|
self.__setitem__(query.name(), query)
|
||||||
|
|
||||||
def __setitem__(self, name, query):
|
def __setitem__(self, name, query):
|
||||||
if name != query.name():
|
if name != query.name():
|
||||||
raise ValueError("key '%s' does not match "
|
raise ValueError("key '%s' does not match "
|
||||||
"package query name '%s'" % (name, query.name()))
|
"package query name '%s'" % (name, query.name()))
|
||||||
|
|
||||||
architecture = query.arch()
|
architecture = query.arch()
|
||||||
|
|
||||||
if (architecture in [self.wantedArchitecture, 'noarch', 'all'] or
|
if (architecture in [self.wanted_architecture, 'noarch', 'all'] or
|
||||||
self.wantedArchitecture in self.architectureMap.get(architecture,
|
self.wanted_architecture in self.architectureMap.get(architecture,
|
||||||
[])):
|
[])):
|
||||||
currentQuery = self.get(name)
|
current_query = self.get(name)
|
||||||
|
|
||||||
# if current query does not exist or is older than this new query
|
# if current query does not exist or is older than this new query
|
||||||
if currentQuery is None or currentQuery.vercmp(query) <= 0:
|
if current_query is None or current_query.vercmp(query) <= 0:
|
||||||
super(PackageQueries, self).__setitem__(name, query)
|
super(PackageQueries, self).__setitem__(name, query)
|
||||||
|
|
||||||
class PackageQuery:
|
class PackageQuery:
|
||||||
@ -63,20 +63,20 @@ class PackageQuery:
|
|||||||
|
|
||||||
def description(self):
|
def description(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def path(self):
|
def path(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def provides(self):
|
def provides(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def requires(self):
|
def requires(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def getTag(self):
|
def gettag(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def vercmp(self, pkgq):
|
def vercmp(self, pkgquery):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -85,20 +85,20 @@ class PackageQuery:
|
|||||||
magic = f.read(7)
|
magic = f.read(7)
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
extra_tags = ()
|
extra_tags = ()
|
||||||
pkgq = None
|
pkgquery = None
|
||||||
if magic[:4] == '\xed\xab\xee\xdb':
|
if magic[:4] == '\xed\xab\xee\xdb':
|
||||||
import rpmquery
|
import rpmquery
|
||||||
pkgq = rpmquery.RpmQuery(f)
|
pkgquery = rpmquery.RpmQuery(f)
|
||||||
extra_tags = extra_rpmtags
|
extra_tags = extra_rpmtags
|
||||||
elif magic == '!<arch>':
|
elif magic == '!<arch>':
|
||||||
import debquery
|
import debquery
|
||||||
pkgq = debquery.DebQuery(f)
|
pkgquery = debquery.DebQuery(f)
|
||||||
extra_tags = extra_debtags
|
extra_tags = extra_debtags
|
||||||
else:
|
else:
|
||||||
raise PackageError('unsupported package type. magic: \'%s\' (%s)' % (magic, filename))
|
raise PackageError('unsupported package type. magic: \'%s\' (%s)' % (magic, filename))
|
||||||
pkgq.read(all_tags, *extra_tags)
|
pkgquery.read(all_tags, *extra_tags)
|
||||||
f.close()
|
f.close()
|
||||||
return pkgq
|
return pkgquery
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import sys
|
import sys
|
||||||
|
@ -25,7 +25,7 @@ OPERATOR_BY_FLAGS = {
|
|||||||
|
|
||||||
def primaryPath(directory):
|
def primaryPath(directory):
|
||||||
"""Returns path to the primary repository data file.
|
"""Returns path to the primary repository data file.
|
||||||
|
|
||||||
@param directory repository directory that contains the repodata subdirectory
|
@param directory repository directory that contains the repodata subdirectory
|
||||||
@return str path to primary repository data file
|
@return str path to primary repository data file
|
||||||
@raise IOError if repomd.xml contains no primary location
|
@raise IOError if repomd.xml contains no primary location
|
||||||
@ -33,7 +33,7 @@ def primaryPath(directory):
|
|||||||
metaDataPath = os.path.join(directory, "repodata", "repomd.xml")
|
metaDataPath = os.path.join(directory, "repodata", "repomd.xml")
|
||||||
elementTree = ET.parse(metaDataPath)
|
elementTree = ET.parse(metaDataPath)
|
||||||
root = elementTree.getroot()
|
root = elementTree.getroot()
|
||||||
|
|
||||||
for dataElement in root:
|
for dataElement in root:
|
||||||
if dataElement.get("type") == "primary":
|
if dataElement.get("type") == "primary":
|
||||||
locationElement = dataElement.find(namespace("repo") + "location")
|
locationElement = dataElement.find(namespace("repo") + "location")
|
||||||
@ -43,110 +43,110 @@ def primaryPath(directory):
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise IOError("'%s' contains no primary location" % metaDataPath)
|
raise IOError("'%s' contains no primary location" % metaDataPath)
|
||||||
|
|
||||||
return primaryPath
|
return primaryPath
|
||||||
|
|
||||||
def queries(directory):
|
def queries(directory):
|
||||||
"""Returns a list of RepoDataQueries constructed from the repodata under
|
"""Returns a list of RepoDataQueries constructed from the repodata under
|
||||||
the directory.
|
the directory.
|
||||||
|
|
||||||
@param directory path to a repository directory (parent directory of
|
@param directory path to a repository directory (parent directory of
|
||||||
repodata directory)
|
repodata directory)
|
||||||
@return list of RepoDataQuery instances
|
@return list of RepoDataQuery instances
|
||||||
@raise IOError if repomd.xml contains no primary location
|
@raise IOError if repomd.xml contains no primary location
|
||||||
"""
|
"""
|
||||||
path = primaryPath(directory)
|
path = primaryPath(directory)
|
||||||
|
|
||||||
gunzippedPrimary = gzip.GzipFile(path)
|
gunzippedPrimary = gzip.GzipFile(path)
|
||||||
elementTree = ET.parse(gunzippedPrimary)
|
elementTree = ET.parse(gunzippedPrimary)
|
||||||
root = elementTree.getroot()
|
root = elementTree.getroot()
|
||||||
|
|
||||||
packageQueries = []
|
packageQueries = []
|
||||||
for packageElement in root:
|
for packageElement in root:
|
||||||
packageQuery = RepoDataQuery(directory, packageElement)
|
packageQuery = RepoDataQuery(directory, packageElement)
|
||||||
packageQueries.append(packageQuery)
|
packageQueries.append(packageQuery)
|
||||||
|
|
||||||
return packageQueries
|
return packageQueries
|
||||||
|
|
||||||
class RepoDataQuery(object):
|
class RepoDataQuery(object):
|
||||||
"""PackageQuery that reads in data from the repodata directory files."""
|
"""PackageQuery that reads in data from the repodata directory files."""
|
||||||
|
|
||||||
def __init__(self, directory, element):
|
def __init__(self, directory, element):
|
||||||
"""Creates a RepoDataQuery from the a package Element under a metadata
|
"""Creates a RepoDataQuery from the a package Element under a metadata
|
||||||
Element in a primary.xml file.
|
Element in a primary.xml file.
|
||||||
|
|
||||||
@param directory repository directory path. Used to convert relative
|
@param directory repository directory path. Used to convert relative
|
||||||
paths to full paths.
|
paths to full paths.
|
||||||
@param element package Element
|
@param element package Element
|
||||||
"""
|
"""
|
||||||
self.__directory = os.path.abspath(directory)
|
self.__directory = os.path.abspath(directory)
|
||||||
self.__element = element
|
self.__element = element
|
||||||
|
|
||||||
def __formatElement(self):
|
def __formatElement(self):
|
||||||
return self.__element.find(namespace("common") + "format")
|
return self.__element.find(namespace("common") + "format")
|
||||||
|
|
||||||
def __parseEntry(self, element):
|
def __parseEntry(self, element):
|
||||||
entry = element.get("name")
|
entry = element.get("name")
|
||||||
flags = element.get("flags")
|
flags = element.get("flags")
|
||||||
|
|
||||||
if flags is not None:
|
if flags is not None:
|
||||||
version = element.get("ver")
|
version = element.get("ver")
|
||||||
operator = OPERATOR_BY_FLAGS[flags]
|
operator = OPERATOR_BY_FLAGS[flags]
|
||||||
entry += " %s %s" % (operator, version)
|
entry += " %s %s" % (operator, version)
|
||||||
|
|
||||||
release = element.get("rel")
|
release = element.get("rel")
|
||||||
if release is not None:
|
if release is not None:
|
||||||
entry += "-%s" % release
|
entry += "-%s" % release
|
||||||
|
|
||||||
return entry
|
return entry
|
||||||
|
|
||||||
def __parseEntryCollection(self, collection):
|
def __parseEntryCollection(self, collection):
|
||||||
formatElement = self.__formatElement()
|
formatElement = self.__formatElement()
|
||||||
collectionElement = formatElement.find(namespace("rpm") + collection)
|
collectionElement = formatElement.find(namespace("rpm") + collection)
|
||||||
|
|
||||||
entries = []
|
entries = []
|
||||||
if collectionElement is not None:
|
if collectionElement is not None:
|
||||||
for entryElement in collectionElement.findall(namespace("rpm") +
|
for entryElement in collectionElement.findall(namespace("rpm") +
|
||||||
"entry"):
|
"entry"):
|
||||||
entry = self.__parseEntry(entryElement)
|
entry = self.__parseEntry(entryElement)
|
||||||
entries.append(entry)
|
entries.append(entry)
|
||||||
|
|
||||||
return entries
|
return entries
|
||||||
|
|
||||||
def __versionElement(self):
|
def __versionElement(self):
|
||||||
return self.__element.find(namespace("common") + "version")
|
return self.__element.find(namespace("common") + "version")
|
||||||
|
|
||||||
def arch(self):
|
def arch(self):
|
||||||
return self.__element.find(namespace("common") + "arch").text
|
return self.__element.find(namespace("common") + "arch").text
|
||||||
|
|
||||||
def description(self):
|
def description(self):
|
||||||
return self.__element.find(namespace("common") + "description").text
|
return self.__element.find(namespace("common") + "description").text
|
||||||
|
|
||||||
def distribution(self):
|
def distribution(self):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def epoch(self):
|
def epoch(self):
|
||||||
return self.__versionElement().get("epoch")
|
return self.__versionElement().get("epoch")
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
return self.__element.find(namespace("common") + "name").text
|
return self.__element.find(namespace("common") + "name").text
|
||||||
|
|
||||||
def path(self):
|
def path(self):
|
||||||
locationElement = self.__element.find(namespace("common") + "location")
|
locationElement = self.__element.find(namespace("common") + "location")
|
||||||
relativePath = locationElement.get("href")
|
relativePath = locationElement.get("href")
|
||||||
absolutePath = os.path.join(self.__directory, relativePath)
|
absolutePath = os.path.join(self.__directory, relativePath)
|
||||||
|
|
||||||
return absolutePath
|
return absolutePath
|
||||||
|
|
||||||
def provides(self):
|
def provides(self):
|
||||||
return self.__parseEntryCollection("provides")
|
return self.__parseEntryCollection("provides")
|
||||||
|
|
||||||
def release(self):
|
def release(self):
|
||||||
return self.__versionElement().get("rel")
|
return self.__versionElement().get("rel")
|
||||||
|
|
||||||
def requires(self):
|
def requires(self):
|
||||||
return self.__parseEntryCollection("requires")
|
return self.__parseEntryCollection("requires")
|
||||||
|
|
||||||
def vercmp(self, other):
|
def vercmp(self, other):
|
||||||
res = osc.util.rpmquery.RpmQuery.rpmvercmp(str(self.epoch()), str(other.epoch()))
|
res = osc.util.rpmquery.RpmQuery.rpmvercmp(str(self.epoch()), str(other.epoch()))
|
||||||
if res != 0:
|
if res != 0:
|
||||||
@ -156,6 +156,6 @@ class RepoDataQuery(object):
|
|||||||
return res
|
return res
|
||||||
res = osc.util.rpmquery.RpmQuery.rpmvercmp(self.release(), other.release())
|
res = osc.util.rpmquery.RpmQuery.rpmvercmp(self.release(), other.release())
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def version(self):
|
def version(self):
|
||||||
return self.__versionElement().get("ver")
|
return self.__versionElement().get("ver")
|
||||||
|
@ -20,7 +20,7 @@ class RpmHeader:
|
|||||||
def append(self, entry):
|
def append(self, entry):
|
||||||
self.entries.append(entry)
|
self.entries.append(entry)
|
||||||
|
|
||||||
def getTag(self, tag):
|
def gettag(self, tag):
|
||||||
for i in self.entries:
|
for i in self.entries:
|
||||||
if i.tag == tag:
|
if i.tag == tag:
|
||||||
return i
|
return i
|
||||||
@ -131,7 +131,7 @@ class RpmQuery(packagequery.PackageQuery):
|
|||||||
entry.data = entry.data[0]
|
entry.data = entry.data[0]
|
||||||
return
|
return
|
||||||
# get private i18n table
|
# get private i18n table
|
||||||
table = self.header.getTag(100)
|
table = self.header.gettag(100)
|
||||||
# just care about the country code
|
# just care about the country code
|
||||||
lang = lang.split('_', 1)[0]
|
lang = lang.split('_', 1)[0]
|
||||||
cnt = 0
|
cnt = 0
|
||||||
@ -147,9 +147,9 @@ class RpmQuery(packagequery.PackageQuery):
|
|||||||
raise RpmHeaderError('unsupported tag type \'%d\' (tag: \'%s\'' % (entry.type, entry.tag))
|
raise RpmHeaderError('unsupported tag type \'%d\' (tag: \'%s\'' % (entry.type, entry.tag))
|
||||||
|
|
||||||
def __reqprov(self, tag, flags, version):
|
def __reqprov(self, tag, flags, version):
|
||||||
pnames = self.header.getTag(tag).data
|
pnames = self.header.gettag(tag).data
|
||||||
pflags = self.header.getTag(flags).data
|
pflags = self.header.gettag(flags).data
|
||||||
pvers = self.header.getTag(version).data
|
pvers = self.header.gettag(version).data
|
||||||
if not (pnames and pflags and pvers):
|
if not (pnames and pflags and pvers):
|
||||||
raise RpmError('cannot get provides/requires, tags are missing')
|
raise RpmError('cannot get provides/requires, tags are missing')
|
||||||
res = []
|
res = []
|
||||||
@ -179,46 +179,46 @@ class RpmQuery(packagequery.PackageQuery):
|
|||||||
|
|
||||||
# XXX: create dict for the tag => number mapping?!
|
# XXX: create dict for the tag => number mapping?!
|
||||||
def name(self):
|
def name(self):
|
||||||
return self.header.getTag(1000).data
|
return self.header.gettag(1000).data
|
||||||
|
|
||||||
def version(self):
|
def version(self):
|
||||||
return self.header.getTag(1001).data
|
return self.header.gettag(1001).data
|
||||||
|
|
||||||
def release(self):
|
def release(self):
|
||||||
return self.header.getTag(1002).data
|
return self.header.gettag(1002).data
|
||||||
|
|
||||||
def epoch(self):
|
def epoch(self):
|
||||||
epoch = self.header.getTag(1003)
|
epoch = self.header.gettag(1003)
|
||||||
if epoch is None:
|
if epoch is None:
|
||||||
return 0
|
return 0
|
||||||
return epoch.data[0]
|
return epoch.data[0]
|
||||||
|
|
||||||
def arch(self):
|
def arch(self):
|
||||||
return self.header.getTag(1022).data
|
return self.header.gettag(1022).data
|
||||||
|
|
||||||
def summary(self):
|
def summary(self):
|
||||||
return self.header.getTag(1004).data
|
return self.header.gettag(1004).data
|
||||||
|
|
||||||
def description(self):
|
def description(self):
|
||||||
return self.header.getTag(1005).data
|
return self.header.gettag(1005).data
|
||||||
|
|
||||||
def url(self):
|
def url(self):
|
||||||
entry = self.header.getTag(1020)
|
entry = self.header.gettag(1020)
|
||||||
if entry is None:
|
if entry is None:
|
||||||
return None
|
return None
|
||||||
return entry.data
|
return entry.data
|
||||||
|
|
||||||
def path(self):
|
def path(self):
|
||||||
return self.__path
|
return self.__path
|
||||||
|
|
||||||
def provides(self):
|
def provides(self):
|
||||||
return self.__reqprov(1047, 1112, 1113)
|
return self.__reqprov(1047, 1112, 1113)
|
||||||
|
|
||||||
def requires(self):
|
def requires(self):
|
||||||
return self.__reqprov(1049, 1048, 1050)
|
return self.__reqprov(1049, 1048, 1050)
|
||||||
|
|
||||||
def getTag(self, num):
|
def gettag(self, num):
|
||||||
return self.header.getTag(num)
|
return self.header.gettag(num)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def query(filename):
|
def query(filename):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user