Hello community, here is the log from the commit of package osc for openSUSE:Factory checked in at 2020-06-02 14:34:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/osc (Old) and /work/SRC/openSUSE:Factory/.osc.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "osc" Tue Jun 2 14:34:49 2020 rev:149 rq:810270 version:0.169.1 Changes: -------- --- /work/SRC/openSUSE:Factory/osc/osc.changes 2020-03-13 21:56:11.476833671 +0100 +++ /work/SRC/openSUSE:Factory/.osc.new.3606/osc.changes 2020-06-02 14:35:01.922836714 +0200 @@ -1,0 +2,20 @@ +Fri May 29 18:40:18 UTC 2020 - Marco Strigl <marco.str...@suse.com> + +- 0.169.1 + * add --ccache option to osc getbinaries + +------------------------------------------------------------------- +Wed May 27 12:54:14 UTC 2020 - Marco Strigl <marco.str...@suse.com> + +- 0.169.0 + * improve speed and usability of osc bash completion + * switch packagequery.py to return only bytes + * improved some error messages + * osc add: support git@ (private github) or git:// URLs correctly + * split dependson and whatdependson commands + * support for osc build --shell-cmd + * Fix kiwi build with --prefer-pkgs + * add pkg-ccache support for osc build + * fix security issue (bsc#1122675, CVE-2019-3681) do not allow '/' in filename + +------------------------------------------------------------------- Old: ---- osc-0.168.2.tar.gz New: ---- osc-0.169.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ osc.spec ++++++ --- /var/tmp/diff_new_pack.JX6M7L/_old 2020-06-02 14:35:05.178847017 +0200 +++ /var/tmp/diff_new_pack.JX6M7L/_new 2020-06-02 14:35:05.182847030 +0200 @@ -27,12 +27,12 @@ %define use_python python %endif -%define version_unconverted 0.168.2 +%define version_unconverted 0.169.1 %define osc_plugin_dir %{_prefix}/lib/osc-plugins %define macros_file macros.osc Name: osc -Version: 0.168.2 +Version: 0.169.1 Release: 0 Summary: Open Build Service Commander License: GPL-2.0-or-later ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.JX6M7L/_old 2020-06-02 14:35:05.210847118 +0200 +++ /var/tmp/diff_new_pack.JX6M7L/_new 2020-06-02 14:35:05.210847118 +0200 @@ -1,5 +1,5 @@ pkgname=osc -pkgver=0.168.2 +pkgver=0.169.1 pkgrel=0 pkgdesc="Open Build Service client" arch=('x86_64') ++++++ _service ++++++ --- /var/tmp/diff_new_pack.JX6M7L/_old 2020-06-02 14:35:05.230847182 +0200 +++ /var/tmp/diff_new_pack.JX6M7L/_new 2020-06-02 14:35:05.230847182 +0200 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> - <param name="version">0.168.2</param> - <param name="revision">0.168.2</param> + <param name="version">0.169.1</param> + <param name="revision">0.169.1</param> <param name="url">git://github.com/openSUSE/osc.git</param> <param name="scm">git</param> </service> ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.JX6M7L/_old 2020-06-02 14:35:05.278847334 +0200 +++ /var/tmp/diff_new_pack.JX6M7L/_new 2020-06-02 14:35:05.278847334 +0200 @@ -1,4 +1,4 @@ -osc (0.168.2) unstable; urgency=low +osc (0.169.1) unstable; urgency=low - Package for Python3 -- Nick Brown <nick.br...@att.com> Wed, 30 Jan 2020 14:49:30 +0000 ++++++ osc-0.168.2.tar.gz -> osc-0.169.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/.travis.yml new/osc-0.169.1/.travis.yml --- old/osc-0.168.2/.travis.yml 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/.travis.yml 2020-05-29 20:35:00.000000000 +0200 @@ -1,13 +1,18 @@ language: python python: -- '2.7' -- '3.6' + - '2.7' + - '3.6' + - '3.7' addons: apt: packages: - - diffstat + - diffstat sudo: false -script: cd tests; python suite.py +before_script: cd $TRAVIS_BUILD_DIR/tests +script: python suite.py +before_deploy: + - cd $TRAVIS_BUILD_DIR/ + - rm -rf $TRAVIS_BUILD_DIR/dist/* deploy: provider: pypi user: suse @@ -15,5 +20,5 @@ secure: R4+YNPW2tsiY06hibGvONYn0//1z1QdcY8VmNbYpIRly4eTAbPE9uejKpyuflUkznpEkoqCdFzi5FNFhgat9N+AkIKyX9NTkf0oxaKKbdqBM7H1V8bqLYlAO479262spRyO0ee5fV5v6g81AFjncIV+pGjtQ0Vg/sjVcvGa61bs= on: tags: true - distributions: sdist bdist_wheel + distributions: sdist repo: openSUSE/osc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/MANIFEST.in new/osc-0.169.1/MANIFEST.in --- old/osc-0.168.2/MANIFEST.in 1970-01-01 01:00:00.000000000 +0100 +++ new/osc-0.169.1/MANIFEST.in 2020-05-29 20:35:00.000000000 +0200 @@ -0,0 +1,4 @@ +include NEWS +include README +include AUTHORS +include COPYING diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/NEWS new/osc-0.169.1/NEWS --- old/osc-0.168.2/NEWS 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/NEWS 2020-05-29 20:35:00.000000000 +0200 @@ -1,3 +1,17 @@ +0.169.1 + - add --ccache option to osc getbinaries + +0.169.0 + - improve speed and usability of osc bash completion + - switch packagequery.py to return only bytes + - improved some error messages + - osc add: support git@ (private github) or git:// URLs correctly + - split dependson and whatdependson commands + - support for osc build --shell-cmd + - Fix kiwi build with --prefer-pkgs + - add pkg-ccache support for osc build + - fix security issue (bsc#1122675) do not allow '/' in filename + 0.168.2 - Use html.escape instead removed cgi.escape (boo#1166537) enables python3.8 compatibility diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/dist/osc.complete new/osc-0.169.1/dist/osc.complete --- old/osc-0.168.2/dist/osc.complete 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/dist/osc.complete 2020-05-29 20:35:00.000000000 +0200 @@ -26,6 +26,9 @@ typeset -i colon typeset -r OIFS="$IFS" +# Do not pollute the terminal session with warnings or errors +exec 2>/dev/null + if test "/proc/$PPID/exe" -ef /bin/tcsh ; then export COMP_TYPE=63 export COMP_KEY=9 @@ -132,18 +135,21 @@ command="$command -A $alias" fi -if test -s "${projects}" ; then - typeset -i ctime=$(command date -d "$(command stat -c '%z' ${projects})" +'%s') - typeset -i now=$(command date -d now +'%s') - if ((now - ctime > 86400)) ; then - if tmp=$(mktemp ${projects}.XXXXXX) ; then - command ${command} ls / >| $tmp - mv -uf $tmp ${projects} - fi +update_projects_list () +{ + if test -s "${projects}" ; then + typeset -i ctime=$(command date -d "$(command stat -c '%z' ${projects})" +'%s') + typeset -i now=$(command date -d now +'%s') + if ((now - ctime > 86400)) ; then + if tmp=$(mktemp ${projects}.XXXXXX) ; then + command ${command} ls / >| $tmp + mv -uf $tmp ${projects} + fi + fi + else + command ${command} ls / >| "${projects}" fi -else - command ${command} ls / >| "${projects}" -fi +} projects () { @@ -159,16 +165,16 @@ argv[argc++]=$arg done shift $argc + update_projects_list cur="$1" - if test -n "${cur}" ; then - list=($(command grep -E "^${cur}" ${projects})) - else - list=($(command cat ${projects})) - fi if ((colon)) ; then local colon_word colon_word=${cur%${cur##*:}} - builtin compgen -W "${list[*]}" -- "${cur}" | sed -r "s@^${colon_word}@@g" + if test -n "${cur}" ; then + builtin compgen -W '`grep -E "^${cur}" ${projects}`' -- "${cur}" | sed -r "s@^${colon_word}@@g" + else + builtin compgen -W '`cat ${projects}`' -- "${cur}" | sed -r "s@^${colon_word}@@g" + fi else builtin compgen -W "${list[*]}" -- "${cur}" fi @@ -273,6 +279,7 @@ users () { + update_projects_list if test -s ${projects} ; then command sed -rn "/^home:$1/{ s/^home:([^:]*):.*/\1/p}" ${projects}|command sort -u elif test -s ~/.oscrc; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/docs/api/modules.rst new/osc-0.169.1/docs/api/modules.rst --- old/osc-0.168.2/docs/api/modules.rst 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/docs/api/modules.rst 2020-05-29 20:35:00.000000000 +0200 @@ -8,3 +8,7 @@ osc.core osc.util + osc.credentials + osc.build + osc.conf + osc.OscConfigParser diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/docs/api/osc.OscConfigParser.rst new/osc-0.169.1/docs/api/osc.OscConfigParser.rst --- old/osc-0.168.2/docs/api/osc.OscConfigParser.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/osc-0.169.1/docs/api/osc.OscConfigParser.rst 2020-05-29 20:35:00.000000000 +0200 @@ -0,0 +1,12 @@ +.. py:module:: osc.OscConfigParser + +OscConfigParser +==== + +This is the osc config parser. + +basic structures +---------------- + +.. automodule:: osc.OscConfigParser + :members: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/docs/api/osc.build.rst new/osc-0.169.1/docs/api/osc.build.rst --- old/osc-0.168.2/docs/api/osc.build.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/osc-0.169.1/docs/api/osc.build.rst 2020-05-29 20:35:00.000000000 +0200 @@ -0,0 +1,12 @@ +.. py:module:: osc.build + +build +==== + +This is the osc build module to talk to the build script. + +basic structures +---------------- + +.. automodule:: osc.build + :members: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/docs/api/osc.conf.rst new/osc-0.169.1/docs/api/osc.conf.rst --- old/osc-0.168.2/docs/api/osc.conf.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/osc-0.169.1/docs/api/osc.conf.rst 2020-05-29 20:35:00.000000000 +0200 @@ -0,0 +1,13 @@ +.. py:module:: osc.conf + +conf +==== + +This is the osc conf module. +It handles the configuration of osc + +basic structures +---------------- + +.. automodule:: osc.conf + :members: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/docs/api/osc.core.rst new/osc-0.169.1/docs/api/osc.core.rst --- old/osc-0.168.2/docs/api/osc.core.rst 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/docs/api/osc.core.rst 2020-05-29 20:35:00.000000000 +0200 @@ -8,6 +8,9 @@ basic structures ---------------- +.. automodule:: osc.core + :members: + .. autoclass:: File :members: @@ -18,3 +21,7 @@ .. autoclass:: Linkinfo :members: + +.. autoclass:: Project + :members: + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/docs/api/osc.credentials.rst new/osc-0.169.1/docs/api/osc.credentials.rst --- old/osc-0.168.2/docs/api/osc.credentials.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/osc-0.169.1/docs/api/osc.credentials.rst 2020-05-29 20:35:00.000000000 +0200 @@ -0,0 +1,12 @@ +.. py:module:: osc.credentials + +credentials +==== + +This is the osc credentials module. + +basic structures +---------------- + +.. automodule:: osc.credentials + :members: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/docs/api/osc.util.rst new/osc-0.169.1/docs/api/osc.util.rst --- old/osc-0.168.2/docs/api/osc.util.rst 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/docs/api/osc.util.rst 2020-05-29 20:35:00.000000000 +0200 @@ -68,11 +68,10 @@ :undoc-members: :show-inheritance: +osc.util.helper module +-------------------------- -Module contents ---------------- - -.. automodule:: osc.util +.. automodule:: osc.util.helper :members: :undoc-members: :show-inheritance: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/docs/index.rst new/osc-0.169.1/docs/index.rst --- old/osc-0.168.2/docs/index.rst 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/docs/index.rst 2020-05-29 20:35:00.000000000 +0200 @@ -19,7 +19,6 @@ .. toctree:: :maxdepth: 2 - api/tutorial api/modules @@ -30,4 +29,3 @@ * :ref:`genindex` * :ref:`modindex` * :ref:`search` - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/osc/build.py new/osc-0.169.1/osc/build.py --- old/osc-0.168.2/osc/build.py 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/osc/build.py 2020-05-29 20:35:00.000000000 +0200 @@ -317,7 +317,7 @@ try: gr.urlgrab(url, filename=ifile_path_part, text='fetching image') except HTTPError as e: - print("Failed to download! ecode:%i reason:%i" % (e.code, e.reason)) + print("Failed to download! ecode:%i reason:%s" % (e.code, e.reason)) return ('', '', []) # download ok, rename partial file to final file name os.rename(ifile_path_part, ifile_path) @@ -480,7 +480,7 @@ d = p.supplements() if d: depfile.append(b's:%s%s' % (id, b' '.join(d))) - depfile.append(b'I:%s%s-%s 0-%s' % (id, p.name(), p.evr().encode(), p.arch())) + depfile.append(b'I:%s%s-%s 0-%s' % (id, p.name(), p.evr(), p.arch())) return depfile @@ -508,8 +508,7 @@ config['api_host_options'][apiurl]['trusted_prj'] = trusted conf.config_set_option(apiurl, 'trusted_prj', ' '.join(trusted)) -def get_kiwipath_from_buildinfo(apiurl, bi_filename, prj, repo): - bi = Buildinfo(bi_filename, apiurl, 'kiwi') +def get_kiwipath_from_buildinfo(bi, prj, repo): # If the project does not have a path defined we need to get the config # via the repositories in the kiwi file. Unfortunately the buildinfo # does not include a hint if this is the case, so we rely on a heuristic @@ -619,9 +618,12 @@ buildargs.append('--icecream=%s' % num) xp.append('icecream') xp.append('gcc-c++') - if opts.ccache: + if opts.ccache or config['ccache']: buildargs.append('--ccache') xp.append('ccache') + if opts.pkg_ccache: + buildargs.append('--pkg-ccache=%s' % opts.pkg_ccache) + xp.append('ccache') if opts.linksources: buildargs.append('--linksources') if opts.baselibs: @@ -725,6 +727,10 @@ if opts.shell: buildargs.append("--shell") + if opts.shell_cmd: + buildargs.append("--shell-cmd") + buildargs.append(opts.shell_cmd) + if opts.noinit: buildargs.append('--noinit') @@ -862,7 +868,8 @@ bi_file.flush() kiwipath = None if build_type == 'kiwi': - kiwipath = get_kiwipath_from_buildinfo(apiurl, bi_filename, prj, repo) + bi = Buildinfo(bi_filename, apiurl, 'kiwi', list(prefer_pkgs.keys())) + kiwipath = get_kiwipath_from_buildinfo(bi, prj, repo) bc = get_buildconfig(apiurl, prj, repo, kiwipath) bc_file.seek(0) bc_file.write(decode_it(bc)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/osc/cmdln.py new/osc-0.169.1/osc/cmdln.py --- old/osc-0.168.2/osc/cmdln.py 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/osc/cmdln.py 2020-05-29 20:35:00.000000000 +0200 @@ -97,6 +97,9 @@ _INCORRECT_NUM_ARGS_RE = re.compile( r"(takes [\w ]+ )(\d+)( arguments? \()(\d+)( given\))") +_INCORRECT_NUM_ARGS_RE_PY3 = re.compile( + r"(missing\s+\d+.*)") + # Static bits of man page MAN_HEADER = r""".TH %(ucname)s "1" "%(date)s" "%(name)s %(version)s" "User Commands" .SH NAME @@ -1246,6 +1249,7 @@ raise msg = ex.args[0] match = _INCORRECT_NUM_ARGS_RE.search(msg) + match_py3 = _INCORRECT_NUM_ARGS_RE_PY3.search(msg) if match: msg = list(match.groups()) msg[1] = int(msg[1]) - 3 @@ -1254,6 +1258,8 @@ msg[3] = int(msg[3]) - 3 msg = ''.join(map(str, msg)) raise CmdlnUserError(msg) + elif match_py3: + raise CmdlnUserError(match_py3.group(1)) else: raise else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/osc/commandline.py new/osc-0.169.1/osc/commandline.py --- old/osc-0.168.2/osc/commandline.py 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/osc/commandline.py 2020-05-29 20:35:00.000000000 +0200 @@ -4668,11 +4668,10 @@ # Do some magic here, when adding a url. We want that the server to download the tar ball and to verify it for arg in parseargs(args): - if arg.startswith('http://') or arg.startswith('https://') or arg.startswith('ftp://') or arg.startswith('git://'): - if arg.endswith('.git'): - addGitSource(arg) - else: - addDownloadUrlService(arg) + if arg.endswith('.git') or arg.startswith('git://') or arg.startswith('git@'): + addGitSource(arg) + elif arg.startswith('http://') or arg.startswith('https://') or arg.startswith('ftp://'): + addDownloadUrlService(arg) else: addFiles([arg]) @@ -5512,7 +5511,7 @@ query = { 'view': 'entry' } if opts.last: query['last'] = 1 - u = makeurl(self.get_api_url(), ['build', project, repository, arch, package, '_log'], query=query) + u = makeurl(self.get_api_url(), ['build', quote_plus(project), quote_plus(repository), quote_plus(arch), quote_plus(package), '_log'], query=query) f = http_GET(u) root = ET.parse(f).getroot() offset = int(root.find('entry').get('size')) @@ -5525,7 +5524,7 @@ elif opts.offset: offset = int(opts.offset) strip_time = opts.strip_time or conf.config['buildlog_strip_time'] - print_buildlog(apiurl, project, package, repository, arch, offset, strip_time, opts.last) + print_buildlog(apiurl, quote_plus(project), quote_plus(package), quote_plus(repository), quote_plus(arch), offset, strip_time, opts.last) def print_repos(self, repos_only=False, exc_class=oscerr.WrongArgs, exc_msg='Missing arguments', project=None): @@ -5604,7 +5603,7 @@ query = { 'view': 'entry' } if opts.last: query['last'] = 1 - u = makeurl(self.get_api_url(), ['build', project, repository, arch, package, '_log'], query=query) + u = makeurl(self.get_api_url(), ['build', quote_plus(project), quote_plus(repository), quote_plus(arch), quote_plus(package), '_log'], query=query) f = http_GET(u) root = ET.parse(f).getroot() offset = int(root.find('entry').get('size')) @@ -5617,7 +5616,7 @@ elif opts.offset: offset = int(opts.offset) strip_time = opts.strip_time or conf.config['buildlog_strip_time'] - print_buildlog(apiurl, project, package, repository, arch, offset, strip_time, opts.last, opts.lastsucceeded) + print_buildlog(apiurl, quote_plus(project), quote_plus(package), quote_plus(repository), quote_plus(arch), offset, strip_time, opts.last, opts.lastsucceeded) def _find_last_repo_arch(self, repo=None, fatal=True): import glob @@ -5765,16 +5764,15 @@ # FIXME: the new osc syntax should allow to specify multiple packages # FIXME: the command should optionally use buildinfo data to show all dependencies - @cmdln.alias('whatdependson') def do_dependson(self, subcmd, opts, *args): - """${cmd_name}: Show the build dependencies + """${cmd_name}: dependson shows the build dependencies inside of a project, valid for a + given repository and architecture. + + The command can be used to find build dependencies (wrt. a given repository and arch) + that reside in the same project. To see all build dependencies use the buildinfo command. - The command dependson and whatdependson can be used to find out what - will be triggered when a certain package changes. This is no guarantee, since the new build might have changed dependencies. - dependson shows the build dependencies inside of a project, valid for a - given repository and architecture. NOTE: to see all binary packages, which can trigger a build you need to refer the buildinfo, since this command shows only the dependencies inside of a project. @@ -5784,17 +5782,42 @@ usage in package or project directory: osc dependson REPOSITORY ARCH - osc whatdependson REPOSITORY ARCH usage: osc dependson PROJECT [PACKAGE] REPOSITORY ARCH + + ${cmd_option_list} + """ + self._dependson(False, *args) + + + def do_whatdependson(self, subcmd, opts, *args): + """${cmd_name}: Show the packages that require the specified package during the + build. + + The command whatdependson can be used to find out what will be triggered when + a certain package changes. + + This is no guarantee, since the new build might have changed dependencies. + + The arguments REPOSITORY and ARCH can be taken from the first two columns + of the 'osc repos' output. + + usage in package or project directory: + osc whatdependson REPOSITORY ARCH + + usage: osc whatdependson PROJECT [PACKAGE] REPOSITORY ARCH ${cmd_option_list} """ + self._dependson(True, *args) + + + def _dependson(self, reverse, *args): wd = os.curdir args = slash_split(args) - project = packages = repository = arch = reverse = None + project = packages = repository = arch = None if len(args) < 2 and (is_package_dir('.') or is_project_dir('.')): self.print_repos() @@ -5824,9 +5847,6 @@ repository = args[2] arch = args[3] - if subcmd == 'whatdependson': - reverse = 1 - xml = get_dependson(apiurl, project, repository, arch, packages, reverse) root = ET.fromstring(xml) @@ -6304,6 +6324,8 @@ help='use N parallel build jobs with icecream') @cmdln.option('--ccache', action='store_true', help='use ccache to speed up rebuilds') + @cmdln.option('--pkg-ccache', metavar='/path/to/_ccache.tar', + help='path to an existing uncompressed archive ccache. Using this option implies --ccache') @cmdln.option('--with', metavar='X', dest='_with', action='append', help='enable feature X for build') @cmdln.option('--without', metavar='X', action='append', @@ -6407,10 +6429,14 @@ osc shell [OPTS] REPOSITORY ARCH + Run a single command inside of the build environment: + osc shell --shell-cmd=COMMAND [OPTS] REPOSITORY ARCH + OPTS may be --noinit # for faster run --shell-cmd=COMMAND + --extra-pkgs=PACKAGE # install additional packages To clean up the build environment run @@ -7224,6 +7250,8 @@ help='also fetch source packages') @cmdln.option('--debug', action="store_true", help='also fetch debug packages') + @cmdln.option('--ccache', action="store_true", + help='allow fetching ccache archive') def do_getbinaries(self, subcmd, opts, *args): """${cmd_name}: Download binaries to a local directory @@ -7304,7 +7332,7 @@ for arch in arches: for pac in package: binaries = get_binarylist(apiurl, project, repository, arch, - package=pac, verbose=True) + package=pac, verbose=True, withccache=opts.ccache) if not binaries: print('no binaries found: Either the package %s ' \ 'does not exist or no binaries have been built.' % pac, file=sys.stderr) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/osc/conf.py new/osc-0.169.1/osc/conf.py --- old/osc-0.168.2/osc/conf.py 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/osc/conf.py 2020-05-29 20:35:00.000000000 +0200 @@ -119,6 +119,7 @@ 'build-jobs': str(_get_processors()), 'builtin_signature_check': '1', # by default use builtin check for verify pkgs 'icecream': '0', + 'ccache': '0', 'buildlog_strip_time': '0', # strips the build time from the build log @@ -200,7 +201,7 @@ 'checkout_no_colon', 'checkout_rooted', 'check_for_request_on_action', 'linkcontrol', 'show_download_progress', 'request_show_interactive', 'request_show_source_buildstatus', 'review_inherit_group', 'use_keyring', 'gnome_keyring', 'no_verify', 'builtin_signature_check', 'http_full_debug', 'include_request_from_project', 'local_service_run', 'buildlog_strip_time', 'no_preinstallimage', - 'status_mtime_heuristic', 'print_web_links'] + 'status_mtime_heuristic', 'print_web_links', 'ccache'] integer_opts = ['build-jobs'] api_host_options = ['user', 'pass', 'passx', 'aliases', 'http_headers', 'realname', 'email', 'sslcertck', 'cafile', 'capath', 'trusted_prj'] @@ -277,6 +278,9 @@ # strip leading build time information from the build log # buildlog_strip_time = 1 +# Enable ccache in build roots. +# ccache = 1 + # extra packages to install when building packages locally (osc build) # this corresponds to osc build's -x option and can be overridden with that # -x '' can also be given on the command line to override this setting, or diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/osc/core.py new/osc-0.169.1/osc/core.py --- old/osc-0.168.2/osc/core.py 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/osc/core.py 2020-05-29 20:35:00.000000000 +0200 @@ -5,7 +5,7 @@ from __future__ import print_function -__version__ = '0.168.2' +__version__ = '0.169.1' # __store_version__ is to be incremented when the format of the working copy # "store" changes in an incompatible way. Please add any needed migration @@ -5654,9 +5654,12 @@ for node2 in node.findall('arch'): yield Repo(node.get('name'), node2.text) -def get_binarylist(apiurl, prj, repo, arch, package=None, verbose=False): +def get_binarylist(apiurl, prj, repo, arch, package=None, verbose=False, withccache=False): what = package or '_repository' - u = makeurl(apiurl, ['build', prj, repo, arch, what]) + query = {} + if withccache: + query['withccache'] = 1 + u = makeurl(apiurl, ['build', prj, repo, arch, what], query=query) f = http_GET(u) tree = ET.parse(f) if not verbose: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/osc/fetch.py new/osc-0.169.1/osc/fetch.py --- old/osc-0.168.2/osc/fetch.py 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/osc/fetch.py 2020-05-29 20:35:00.000000000 +0200 @@ -179,8 +179,11 @@ print('Unsupported file type: ', tmpfile, file=sys.stderr) sys.exit(1) canonname = pac_obj.binary + decoded_canonname = decode_it(canonname) + if b'/' in canonname or '/' in decoded_canonname: + raise oscerr.OscIOError(None, 'canonname contains a slash') - fullfilename = os.path.join(destdir, decode_it(canonname)) + fullfilename = os.path.join(destdir, decoded_canonname) if pac_obj is not None: pac_obj.canonname = canonname pac_obj.fullfilename = fullfilename diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/osc/util/packagequery.py new/osc-0.169.1/osc/util/packagequery.py --- old/osc-0.168.2/osc/util/packagequery.py 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/osc/util/packagequery.py 2020-05-29 20:35:00.000000000 +0200 @@ -151,14 +151,14 @@ raise NotImplementedError def evr(self): - evr = decode_it(self.version()) + evr = self.version() if self.release(): - evr += "-" + decode_it(self.release()) + evr += b"-" + self.release() epoch = self.epoch() if epoch is not None and epoch != 0: - evr = epoch + ":" + evr + evr = epoch + b":" + evr return evr diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/osc/util/repodata.py new/osc-0.169.1/osc/util/repodata.py --- old/osc-0.168.2/osc/util/repodata.py 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/osc/util/repodata.py 2020-05-29 20:35:00.000000000 +0200 @@ -71,6 +71,25 @@ return packageQueries + +def _to_bytes_or_None(method): + def _method(self, *args, **kwargs): + res = method(self, *args, **kwargs) + if res is None: + return None + return res.encode() + + return _method + + +def _to_bytes_list(method): + def _method(self, *args, **kwargs): + res = method(self, *args, **kwargs) + return [data.encode() for data in res] + + return _method + + class RepoDataQueryResult(osc.util.packagequery.PackageQueryResult): """PackageQueryResult that reads in data from the repodata directory files.""" @@ -119,18 +138,22 @@ def __versionElement(self): return self.__element.find(namespace("common") + "version") + @_to_bytes_or_None def arch(self): return self.__element.find(namespace("common") + "arch").text + @_to_bytes_or_None def description(self): return self.__element.find(namespace("common") + "description").text def distribution(self): return None + @_to_bytes_or_None def epoch(self): return self.__versionElement().get("epoch") + @_to_bytes_or_None def name(self): return self.__element.find(namespace("common") + "name").text @@ -141,30 +164,39 @@ return absolutePath + @_to_bytes_list def provides(self): return self.__parseEntryCollection("provides") + @_to_bytes_or_None def release(self): return self.__versionElement().get("rel") + @_to_bytes_list def requires(self): return self.__parseEntryCollection("requires") + @_to_bytes_list def conflicts(self): return self.__parseEntryCollection('conflicts') + @_to_bytes_list def obsoletes(self): return self.__parseEntryCollection('obsoletes') + @_to_bytes_list def recommends(self): return self.__parseEntryCollection('recommends') + @_to_bytes_list def suggests(self): return self.__parseEntryCollection('suggests') + @_to_bytes_list def supplements(self): return self.__parseEntryCollection('supplements') + @_to_bytes_list def enhances(self): return self.__parseEntryCollection('enhances') @@ -172,23 +204,27 @@ if self.release() is None: release = None else: - release = self.release().encode() - return osc.util.rpmquery.RpmQuery.filename(self.name().encode(), None, - self.version().encode(), release, self.arch().encode()) + release = self.release() + return osc.util.rpmquery.RpmQuery.filename(self.name(), None, + self.version(), release, self.arch()) def gettag(self, tag): # implement me, if needed return None def vercmp(self, other): + # if either self.epoch() or other.epoch() is None, the vercmp will do + # the correct thing because one is transformed into b'None' and the + # other one into b"b'<epoch>'" (and 'b' is greater than 'N') res = osc.util.rpmquery.RpmQuery.rpmvercmp(str(self.epoch()).encode(), str(other.epoch()).encode()) if res != 0: return res - res = osc.util.rpmquery.RpmQuery.rpmvercmp(self.version().encode(), other.version().encode()) + res = osc.util.rpmquery.RpmQuery.rpmvercmp(self.version(), other.version()) if res != 0: return res - res = osc.util.rpmquery.RpmQuery.rpmvercmp(self.release().encode(), other.release().encode()) + res = osc.util.rpmquery.RpmQuery.rpmvercmp(self.release(), other.release()) return res + @_to_bytes_or_None def version(self): return self.__versionElement().get("ver") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.168.2/setup.py new/osc-0.169.1/setup.py --- old/osc-0.168.2/setup.py 2020-03-13 07:44:34.000000000 +0100 +++ new/osc-0.169.1/setup.py 2020-05-29 20:35:00.000000000 +0200 @@ -3,17 +3,19 @@ from distutils.core import setup import distutils.core from distutils.command import build, install_data +import gzip import os.path -import osc.core import sys import setuptools +import osc.core from osc import commandline -from osc import babysitter + # optional support for py2exe try: import py2exe + HAVE_PY2EXE = True except: HAVE_PY2EXE = False @@ -27,14 +29,13 @@ def build_man_page(self): """ """ - import gzip man_path = os.path.join(self.build_base, 'osc.1.gz') distutils.log.info('generating %s' % man_path) outfile = gzip.open(man_path, 'wt') osccli = commandline.Osc(stdout=outfile) # FIXME: we cannot call the main method because osc expects an ~/.oscrc # file (this would break builds in environments like the obs) - #osccli.main(argv = ['osc','man']) + # osccli.main(argv = ['osc','man']) osccli.optparser = osccli.get_optparser() osccli.do_man(None) outfile.close() @@ -60,11 +61,11 @@ metadata = self.distribution.metadata # package_dir may be None, in that case use the current directory. src_dir = (self.distribution.package_dir or {'': ''})[''] - src_dir = os.path.join(os.getcwd(), src_dir) + src_dir = os.path.join(os.getcwd(), src_dir) import sphinx sphinx.main(['runme', - '-D', 'version=%s' % metadata.get_version(), - os.path.join('docs',), os.path.join(self.built_docs, 'docs')]) + '-D', 'version=%s' % metadata.get_version(), + os.path.join('docs', ), os.path.join(self.built_docs, 'docs')]) # take a potential build-base option into account (for instance, if osc is @@ -91,34 +92,62 @@ addparams = {} if HAVE_PY2EXE: - addparams['console'] = [{'script': 'osc-wrapper.py', 'dest_base': 'osc', 'icon_resources': [(1, 'osc.ico')]}] + addparams['console'] = [ + {'script': 'osc-wrapper.py', 'dest_base': 'osc', 'icon_resources': [(1, 'osc.ico')]}] addparams['zipfile'] = 'shared.lib' - addparams['options'] = {'py2exe': {'optimize': 0, 'compressed': True, 'packages': ['xml.etree', 'StringIO', 'gzip']}} + addparams['options'] = {'py2exe': {'optimize': 0, 'compressed': True, + 'packages': ['xml.etree', 'StringIO', 'gzip']}} data_files = [] if sys.platform[:3] != 'win': data_files.append((os.path.join('share', 'man', 'man1'), ['osc.1.gz'])) -setuptools.setup(name='osc', - version = osc.core.__version__, - description = 'openSUSE commander', - long_description = 'Command-line client for the openSUSE Build Service, which allows to access repositories in the openSUSE Build Service in similar way as Subversion repositories.', - author = 'openSUSE project', - author_email = 'opensuse-buildserv...@opensuse.org', - license = 'GPL', - platforms = ['Linux', 'Mac OSX', 'Windows XP/2000/NT', 'Windows 95/98/ME', 'FreeBSD'], - keywords = ['openSUSE', 'SUSE', 'RPM', 'build', 'buildservice'], - url = 'http://en.opensuse.org/openSUSE:OSC', - download_url = 'https://github.com/openSUSE/osc', - packages = ['osc', 'osc.util'], - scripts = ['osc-wrapper.py'], - data_files = data_files, +with open("README") as fh: + long_description = fh.read() + +setuptools.setup( + name='osc', + version=osc.core.__version__, + description='openSUSE commander', + long_description=long_description, + long_description_content_type="text/plain", + author='openSUSE project', + author_email='opensuse-buildserv...@opensuse.org', + license='GPL', + platforms=['Linux', 'Mac OSX', 'Windows XP/2000/NT', 'Windows 95/98/ME', 'FreeBSD'], + keywords=['openSUSE', 'SUSE', 'RPM', 'build', 'buildservice'], + url='http://en.opensuse.org/openSUSE:OSC', + download_url='https://github.com/openSUSE/osc', + packages=['osc', 'osc.util'], + scripts=['osc-wrapper.py'], + data_files=data_files, + install_requires=['M2Crypto', 'chardet'], + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Topic :: Software Development :: Build Tools", + "Topic :: System :: Archiving :: Packaging", + ], + - # Override certain command classes with our own ones - cmdclass = { + # Override certain command classes with our own ones + cmdclass={ 'build': build_osc, - 'build_docs' : build_docs, + 'build_docs': build_docs, 'install_data': install_data - }, - **addparams - ) + }, + **addparams +) ++++++ osc.dsc ++++++ --- /var/tmp/diff_new_pack.JX6M7L/_old 2020-06-02 14:35:05.622848422 +0200 +++ /var/tmp/diff_new_pack.JX6M7L/_new 2020-06-02 14:35:05.622848422 +0200 @@ -1,6 +1,6 @@ Format: 1.0 Source: osc -Version: 0.168.2 +Version: 0.169.1 Binary: osc Maintainer: Adrian Schroeter <adr...@suse.de> Architecture: any