Hello community,
here is the log from the commit of package osc
checked in at Wed Jul 11 13:33:20 CEST 2007.
--------
--- osc/osc.changes 2007-06-28 16:20:05.000000000 +0200
+++ /mounts/work_src_done/STABLE/osc/osc.changes 2007-07-11 11:25:01.000000000 +0200
@@ -1,0 +2,31 @@
+Wed Jul 11 11:20:24 CEST 2007 - poeml@suse.de
+
+- update to r1825:
+ - version 0.97
+ - added initial revision handling:
+ - extended "osc co prj pac" to checkout a specific revision of pac
+ - extended "osc up" to update to a specific revision
+ - extended "osc diff" to diff the working copy against a
+ specific revision on the server. NOTE: comparing two
+ server-side revisions (osc diff -r 11:12) is currently
+ not supported!
+ - addremove: ignore foo.rXX, foo.mine for files which are in 'C' state
+ - wipebinaries: allow to wipe all binaries of packages for which
+ the build is disabled
+ - updatepacmetafromspec scans for spec files automatically; also,
+ added a --specfile option.
+ - load subcommands from /var/lib/osc-plugins/ or ~/.osc-plugins/
+
+-------------------------------------------------------------------
+Fri Jun 29 16:05:45 CEST 2007 - poeml@suse.de
+
+- add /var/lib/osc-plugins to the filelist
+
+-------------------------------------------------------------------
+Fri Jun 29 14:05:00 CEST 2007 - poeml@suse.de
+
+- update to r1794:
+ - rm: don't allow to mark files as deleted which are not under
+ version control
+
+-------------------------------------------------------------------
Old:
----
osc-0.96.tar.gz
New:
----
osc-0.97.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ osc.spec ++++++
--- /var/tmp/diff_new_pack.u17697/_old 2007-07-11 13:33:01.000000000 +0200
+++ /var/tmp/diff_new_pack.u17697/_new 2007-07-11 13:33:01.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package osc (Version 0.96)
+# spec file for package osc (Version 0.97)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,13 +12,13 @@
Name: osc
BuildRequires: python-devel
-Version: 0.96
-Release: 27
+Version: 0.97
+Release: 1
Group: Development/Tools/Other
-License: GNU General Public License (GPL)
+License: GPL v2 or later
BuildRoot: %{_tmppath}/%{name}-%{version}-build
URL: https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/p...
-# v=0.96; svn export https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/p... osc-$v; tar czf osc-$v.tar.gz osc-$v
+# v=0.97; svn export https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/p... osc-$v; tar czf osc-$v.tar.gz osc-$v
Source: osc-%{version}.tar.gz
Summary: openSUSE (build service) commander
Requires: python-urlgrabber
@@ -62,6 +62,7 @@
%install
%{__python} setup.py install --prefix=%{_prefix} --root %{buildroot}
ln -s osc-wrapper.py %{buildroot}/%{_bindir}/osc
+mkdir -p %{buildroot}/var/lib/osc-plugins
%clean
%{__rm} -rf %{buildroot}
@@ -70,9 +71,32 @@
%defattr(-,root,root)
%{_bindir}/osc*
%{python_sitelib}/*
+%dir /var/lib/osc-plugins
%doc README TODO NEWS
%changelog
+* Wed Jul 11 2007 - poeml@suse.de
+- update to r1825:
+ - version 0.97
+ - added initial revision handling:
+ - extended "osc co prj pac" to checkout a specific revision of pac
+ - extended "osc up" to update to a specific revision
+ - extended "osc diff" to diff the working copy against a
+ specific revision on the server. NOTE: comparing two
+ server-side revisions (osc diff -r 11:12) is currently
+ not supported!
+ - addremove: ignore foo.rXX, foo.mine for files which are in 'C' state
+ - wipebinaries: allow to wipe all binaries of packages for which
+ the build is disabled
+ - updatepacmetafromspec scans for spec files automatically; also,
+ added a --specfile option.
+ - load subcommands from /var/lib/osc-plugins/ or ~/.osc-plugins/
+* Fri Jun 29 2007 - poeml@suse.de
+- add /var/lib/osc-plugins to the filelist
+* Fri Jun 29 2007 - poeml@suse.de
+- update to r1794:
+ - rm: don't allow to mark files as deleted which are not under
+ version control
* Thu Jun 28 2007 - poeml@suse.de
- update to r1792:
- linkpac: make this osc subcommand work again: sync metadata if
++++++ debian.changelog ++++++
--- osc/debian.changelog 2007-06-28 16:21:52.000000000 +0200
+++ /mounts/work_src_done/STABLE/osc/debian.changelog 2007-07-11 11:25:56.000000000 +0200
@@ -1,3 +1,31 @@
+osc (0.97-1) unstable; urgency=high
+
+ * update to r1825:
+ - version 0.97
+ - added initial revision handling:
+ - extended "osc co prj pac" to checkout a specific revision of pac
+ - extended "osc up" to update to a specific revision
+ - extended "osc diff" to diff the working copy against a
+ specific revision on the server. NOTE: comparing two
+ server-side revisions (osc diff -r 11:12) is currently
+ not supported!
+ - addremove: ignore foo.rXX, foo.mine for files which are in 'C' state
+ - wipebinaries: allow to wipe all binaries of packages for which
+ the build is disabled
+ - updatepacmetafromspec scans for spec files automatically; also,
+ added a --specfile option.
+ - load subcommands from /var/lib/osc-plugins/ or ~/.osc-plugins/
+
+ -- Peter Poeml Wed, 11 Jul 2007 00:00:00 +0200
+
+osc (0.96-10) unstable; urgency=high
+
+ * update to r1794:
+ - rm: don't allow to mark files as deleted which are not under
+ version control
+
+ -- Peter Poeml Fri, 29 May 2007 00:00:00 +0200
+
osc (0.96-9) unstable; urgency=high
* update to r1792:
++++++ osc-0.96.tar.gz -> osc-0.97.tar.gz ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.96/NEWS new/osc-0.97/NEWS
--- old/osc-0.96/NEWS 2007-06-26 15:21:09.000000000 +0200
+++ new/osc-0.97/NEWS 2007-07-11 11:19:06.000000000 +0200
@@ -1,4 +1,19 @@
-since 0.96:
+since 0.97:
+[...]
+
+
+0.97:
+- added initial revision handling:
+ - extended "osc co prj pac" to checkout a specific revision of pac
+ - extended "osc up" to update to a specific revision
+ - extended "osc diff" to diff the working copy against a
+ specific revision on the server. NOTE: comparing two
+ server-side revisions (osc diff -r 11:12) is currently
+ not supported!
+- load subcommands from /var/lib/osc-plugins/ or ~/.osc-plugins/
+- updatepacmetafromspec scans for spec files automatically. Added --specfile option to updatepacmetafromspec.
+- wipebinaries: allow to wipe all binaries of packages for which the build is disabled
+- addremove: ignore foo.rXX, foo.mine for files which are in 'C' state
- ls: add verbose option to print extra information for packages
- for all server-side commands, allow arguments "foo/bar" instead of "foo bar"
- new wipebinaries and abortbuild commands, by courtesy of Marcus Huewe
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.96/osc/commandline.py new/osc-0.97/osc/commandline.py
--- old/osc-0.96/osc/commandline.py 2007-06-26 16:22:23.000000000 +0200
+++ new/osc-0.97/osc/commandline.py 2007-07-07 19:13:37.000000000 +0200
@@ -351,6 +351,8 @@
print >>sys.stderr, 'or admin@opensuse.org.'
+ @cmdln.option('', '--specfile', metavar='FILE',
+ help='Path to specfile. (if you pass more than working copy this option is ignored)')
def do_updatepacmetafromspec(self, subcmd, opts, *args):
"""${cmd_name}: Update package meta information from a specfile
@@ -361,15 +363,24 @@
"""
args = parseargs(args)
+ if opts.specfile and (len(args) == 1):
+ specfile = opts.specfile
+ else:
+ specfile = None
pacs = findpacs(args)
-
for p in pacs:
- p.read_meta_from_spec()
+ p.read_meta_from_spec(specfile)
p.update_pac_meta()
@cmdln.alias('di')
+ @cmdln.option('-r', '--revision', metavar='rev1[:rev2]',
+ help='If rev1 is specified it will compare your working copy against '
+ 'the revision (rev1) on the server. '
+ 'If rev1 and rev2 are specified it will compare rev1 against rev2'
+ '(changes in your working copy are ignored in this case).\n'
+ 'NOTE: if more than 1 package is specified --revision will be ignored!')
def do_diff(self, subcmd, opts, *args):
"""${cmd_name}: Generates a diff
@@ -384,28 +395,98 @@
args = parseargs(args)
pacs = findpacs(args)
-
+
difference_found = False
- for p in pacs:
- if p.todo == []:
- for i in p.filenamelist:
- s = p.status(i)
- if s == 'M' or s == 'C':
- p.todo.append(i)
+ d = []
+
+ rev1, rev2 = parseRevisionOption(opts.revision)
+ pac = pacs[0]
+
+ if rev1 and rev2 and (len(pacs) == 1):
+ # this is currently not implemented
+ print >>sys.stderr, 'this feature isn\'t implemented yet'
+ sys.exit(1)
+ elif rev1 and (pac.rev != rev1) and (len(pacs) == 1):
+ if not checkRevision(pac.prjname, pac.name, rev1):
+ print >>sys.stderr, 'Revision \'%s\' does not exist' % rev1
+ sys.exit(1)
+ # make a temp dir for checking out the project
+ import tempfile
+ tmpdir = tempfile.mkdtemp(rev1, pac.name, '/tmp')
+ curdir = os.getcwd()
+ os.chdir(tmpdir)
+ init_package_dir(conf.config['apiurl'], pac.prjname, pac.name, tmpdir, rev1)
+ os.chdir(curdir)
+ tmppac = Package(tmpdir)
+
+ changed_files = []
+ added_files = []
+ removed_files = []
+ if pac.todo:
+ for file in pac.todo:
+ if file in tmppac.filenamelist:
+ if dgst(os.path.join(pac.dir, file)) != tmppac.findfilebyname(file).md5:
+ changed_files.append(file)
+ else:
+ added_files.append(file)
+ else:
+ changed_files, added_files, removed_files = pac.comparePac(tmppac)
+
+ for file in changed_files:
+ tmppac.updatefile(file, rev1)
+ d.append('Index: %s\n' % file)
+ d.append('===================================================================\n')
+ d.append(get_source_file_diff(pac.dir, file, rev1, file, tmppac.dir))
+ tmppac.delete_localfile(file)
+ tmppac.delete_storefile(file)
- d = []
- for filename in p.todo:
- d.append('Index: %s\n' % filename)
+ # this tempfile is used as a dummy file for difflib
+ (fd, filename) = tempfile.mkstemp(dir=tmppac.storedir)
+
+ for file in added_files:
+ d.append('Index: %s\n' % file)
d.append('===================================================================\n')
- d.append(get_source_file_diff(p.dir, filename, p.rev))
- if d:
- print ''.join(d)
- difference_found = True
+ d.append(get_source_file_diff(pac.dir, file, rev1, \
+ os.path.basename(filename), \
+ tmppac.storedir, file))
+
+ for file in removed_files:
+ tmppac.updatefile(file, rev1)
+ d.append('Index: %s\n' % file)
+ d.append('===================================================================\n')
+ d.append(get_source_file_diff(tmppac.storedir, \
+ os.path.basename(filename), \
+ rev1, file, tmppac.dir, file))
+ tmppac.delete_localfile(file)
+ tmppac.delete_storefile(file)
+
+ # clean up
+ os.unlink(filename)
+ for dir, dirnames, files in os.walk(tmppac.storedir):
+ for file in files:
+ os.unlink(os.path.join(dir, file))
+ os.rmdir(tmppac.storedir)
+ os.rmdir(tmppac.dir)
+ else:
+ for p in pacs:
+ if p.todo == []:
+ for i in p.filenamelist:
+ s = p.status(i)
+ if s == 'M' or s == 'C':
+ p.todo.append(i)
+
+ for filename in p.todo:
+ d.append('Index: %s\n' % filename)
+ d.append('===================================================================\n')
+ d.append(get_source_file_diff(p.dir, filename, p.rev))
+
+
+ if d:
+ print ''.join(d)
+ difference_found = True
if difference_found:
return 1
-
-
def do_repourls(self, subcmd, opts, *args):
"""${cmd_name}: shows URLs of .repo files
@@ -429,7 +510,11 @@
print url_tmpl % (p.prjname.replace(':', ':/'), platform, p.prjname)
-
+
+ @cmdln.option('-r', '--revision', metavar='rev',
+ help='checkout the specified revision. '
+ 'NOTE: if you checkout the complete project '
+ 'this option is ignored!')
@cmdln.alias('co')
def do_checkout(self, subcmd, opts, *args):
"""${cmd_name}: check out content from the repository
@@ -456,11 +541,17 @@
except:
pass
+ rev, dummy = parseRevisionOption(opts.revision)
+
+ if rev and not checkRevision(project, package, rev):
+ print >>sys.stderr, 'Revision \'%s\' does not exist' % rev
+ sys.exit(1)
+
if filename:
- get_source_file(conf.config['apiurl'], project, package, filename)
+ get_source_file(conf.config['apiurl'], project, package, filename, revision=rev)
elif package:
- checkout_package(conf.config['apiurl'], project, package)
+ checkout_package(conf.config['apiurl'], project, package, rev)
elif project:
# all packages
@@ -600,6 +691,9 @@
for filename in p.todo:
if os.path.isdir(filename):
continue
+ # ignore foo.rXX, foo.mine for files which are in 'C' state
+ if os.path.splitext(filename)[0] in p.in_conflict:
+ continue
state = p.status(filename)
if state == '?':
p.addfile(filename)
@@ -673,6 +767,10 @@
print
+ @cmdln.option('-r', '--revision', metavar='rev',
+ help='update to specified revision (this option will be ignored '
+ 'if you are going to update the complete project or more than '
+ 'one package)')
@cmdln.alias('up')
def do_update(self, subcmd, opts, *args):
"""${cmd_name}: Update a working copy
@@ -714,6 +812,14 @@
pacs = findpacs(args)
+ if opts.revision and ( len(args) == 1):
+ rev, dummy = parseRevisionOption(opts.revision)
+ if not checkRevision(pacs[0].prjname, pacs[0].name, rev):
+ print >>sys.stderr, 'Revision \'%s\' does not exist' % rev
+ sys.exit(1)
+ else:
+ rev = None
+
for p in pacs:
if len(pacs) > 1:
@@ -723,7 +829,7 @@
saved_modifiedfiles = [ f for f in p.filenamelist if p.status(f) == 'M' ]
oldp = p
- p.update_filesmeta()
+ p.update_filesmeta(rev)
p = Package(p.dir)
# which files do no longer exist upstream?
@@ -749,13 +855,13 @@
status_after_merge = p.mergefile(filename)
print statfrmt(status_after_merge, filename)
elif state == 'M':
- p.updatefile(filename)
+ p.updatefile(filename, rev)
print statfrmt('U', filename)
elif state == '!':
- p.updatefile(filename)
+ p.updatefile(filename, rev)
print 'Restored \'%s\'' % filename
elif state == 'F':
- p.updatefile(filename)
+ p.updatefile(filename, rev)
print statfrmt('A', filename)
elif state == ' ':
pass
@@ -791,6 +897,8 @@
for p in pacs:
for filename in p.todo:
+ if filename not in p.filenamelist:
+ sys.exit('\'%s\' is not under version control' % filename)
p.put_on_deletelist(filename)
p.write_deletelist()
try:
@@ -1290,9 +1398,11 @@
@cmdln.option('-a', '--arch', metavar='ARCH',
- help='Delete all binary package for a specific architecture')
+ help='Delete all binary packages for a specific architecture')
@cmdln.option('-r', '--repo', metavar='REPO',
help='Delete all binary packages for a specific repository')
+ @cmdln.option('--build-disabled', action='store_true',
+ help='Delete all binaries of packages for which the build is disabled')
def do_wipebinaries(self, subcmd, opts, *args):
"""${cmd_name}: Delete all binary packages of a certain project/package
@@ -1315,10 +1425,17 @@
else:
package = None
- print wipebinaries(conf.config['apiurl'], args[0], package, opts.arch, opts.repo)
+ print wipebinaries(conf.config['apiurl'], args[0], package, opts.arch, opts.repo, opts.build_disabled)
-if __name__ == '__main__':
- osc = Osc()
- sys.exit(osc.main())
+
+ # load subcommands plugged-in locally
+ plugin_dirs = ['/var/lib/osc-plugins', os.path.expanduser('~/.osc-plugins')]
+ for plugin_dir in plugin_dirs:
+ if os.path.isdir(plugin_dir):
+ for extfile in os.listdir(plugin_dir):
+ if not extfile.endswith('.py'):
+ continue
+ exec open(os.path.join(plugin_dir, extfile))
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.96/osc/core.py new/osc-0.97/osc/core.py
--- old/osc-0.96/osc/core.py 2007-06-28 16:17:13.000000000 +0200
+++ new/osc-0.97/osc/core.py 2007-07-11 11:19:06.000000000 +0200
@@ -5,7 +5,7 @@
# and distributed under the terms of the GNU General Public Licence,
# either version 2, or (at your option) any later version.
-__version__ = '0.96'
+__version__ = '0.97'
import os
import sys
@@ -39,10 +39,26 @@
<person role="maintainer" userid="%s" />
+<!-- remove this block to publish your packages on the mirrors -->
+ <publish>
+ <disable />
+ </publish>
+ <build>
+ <enable />
+ </build>
+ <debuginfo>
+ <disable />
+ </debuginfo>
+
Reply