openSUSE Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
November 2007
- 1 participants
- 858 discussions
Hello community,
here is the log from the commit of package osc
checked in at Fri Nov 30 02:28:10 CET 2007.
--------
--- osc/osc.changes 2007-09-03 14:32:12.000000000 +0200
+++ /mounts/work_src_done/STABLE/osc/osc.changes 2007-11-30 02:02:16.000000000 +0100
@@ -1,0 +2,40 @@
+Fri Nov 30 01:50:24 CET 2007 - poeml(a)suse.de
+
+- update to r2685:
+ - rdiff: new command for server-side diffs between arbitrary
+ packages
+ - cat: new command to print a file on the standard output
+ - diff: reworked functionality to show newly added files, and
+ behaving more like svn when doing diff against a certain
+ revision
+ - bugfix in {link,aggregate,copy}_pac (<person> elements). Patch
+ from Michal Marek.
+ - checkout an empty project instead of doing nothing
+ - fix prjresults for newly added packages, where build status is
+ missing
+ - internal changes:
+ - copied init_project_dir() method from the
+ osc-package-tracking branch (just removed the
+ do_package_tracking stuff)
+ - changed the storedir attribut of the Package() class to an
+ absolute filename - normally this shouldn't have any impact
+ on existing methods, functionality etc.
+
+-------------------------------------------------------------------
+Tue Oct 30 12:47:13 CET 2007 - poeml(a)suse.de
+
+- update to r2467. Most work done by Marcus Huewe.
+ - version 0.99
+ - aggregatepac: new command, similar to linkpac. Patch from Pavol
+ Rusnak.
+ - wipebinaries: added --build-failed and --broken [#335498]
+ - deleteprj: enabled this command, as the backend now supports it
+ - maintainer:
+ - added --verbose option
+ - added functionality to add/remove users from a project/package
+ - print the list of URL to try, when in HTTP debug mode
+ - build: allow to use lbuild, a compatible replacement for build
+ - do not create dirs for non-existing packages during checkout
+ [#259711]
+
+-------------------------------------------------------------------
Old:
----
osc-0.98.tar.gz
New:
----
osc-0.99.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ osc.spec ++++++
--- /var/tmp/diff_new_pack.DA5603/_old 2007-11-30 02:27:28.000000000 +0100
+++ /var/tmp/diff_new_pack.DA5603/_new 2007-11-30 02:27:28.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package osc (Version 0.98)
+# spec file for package osc (Version 0.99)
#
# 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.98
+Version: 0.99
Release: 1
Group: Development/Tools/Other
License: GPL v2 or later
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-URL: https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/…
-# v=0.98; svn export https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/… osc-$v; tar czf osc-$v.tar.gz osc-$v
+Url: https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/…
+# v=0.99; svn export https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/… osc-$v; tar czf osc-$v.tar.gz osc-$v
Source: osc-%{version}.tar.gz
Summary: openSUSE (build service) commander
Requires: python-urlgrabber
@@ -78,6 +78,40 @@
%doc README TODO NEWS
%changelog
+* Fri Nov 30 2007 - poeml(a)suse.de
+- update to r2685:
+ - rdiff: new command for server-side diffs between arbitrary
+ packages
+ - cat: new command to print a file on the standard output
+ - diff: reworked functionality to show newly added files, and
+ behaving more like svn when doing diff against a certain
+ revision
+ - bugfix in {link,aggregate,copy}_pac (<person> elements). Patch
+ from Michal Marek.
+ - checkout an empty project instead of doing nothing
+ - fix prjresults for newly added packages, where build status is
+ missing
+ - internal changes:
+ - copied init_project_dir() method from the
+ osc-package-tracking branch (just removed the
+ do_package_tracking stuff)
+ - changed the storedir attribut of the Package() class to an
+ absolute filename - normally this shouldn't have any impact
+ on existing methods, functionality etc.
+* Tue Oct 30 2007 - poeml(a)suse.de
+- update to r2467. Most work done by Marcus Huewe.
+ - version 0.99
+ - aggregatepac: new command, similar to linkpac. Patch from Pavol
+ Rusnak.
+ - wipebinaries: added --build-failed and --broken [#335498]
+ - deleteprj: enabled this command, as the backend now supports it
+ - maintainer:
+ - added --verbose option
+ - added functionality to add/remove users from a project/package
+ - print the list of URL to try, when in HTTP debug mode
+ - build: allow to use lbuild, a compatible replacement for build
+ - do not create dirs for non-existing packages during checkout
+ [#259711]
* Mon Sep 03 2007 - poeml(a)suse.de
- update to r2075:
- new 'maintainer' command, to list the maintainers of a project
++++++ debian.changelog ++++++
--- osc/debian.changelog 2007-09-03 12:50:23.000000000 +0200
+++ /mounts/work_src_done/STABLE/osc/debian.changelog 2007-11-30 02:03:02.000000000 +0100
@@ -1,3 +1,43 @@
+osc (0.99-2) unstable; urgency=high
+
+ - update to r2685:
+ - rdiff: new command for server-side diffs between arbitrary
+ packages
+ - cat: new command to print a file on the standard output
+ - diff: reworked functionality to show newly added files, and
+ behaving more like svn when doing diff against a certain
+ revision
+ - bugfix in {link,aggregate,copy}_pac (<person> elements). Patch
+ from Michal Marek.
+ - checkout an empty project instead of doing nothing
+ - fix prjresults for newly added packages, where build status is
+ missing
+ - internal changes:
+ - copied init_project_dir() method from the
+ osc-package-tracking branch (just removed the
+ do_package_tracking stuff)
+ - changed the storedir attribut of the Package() class to an
+ absolute filename - normally this shouldn't have any impact
+ on existing methods, functionality etc.
+
+ -- Peter Poeml <poeml(a)suse.de> Fri, 30 Nov 2007 00:00:00 +0200
+
+osc (0.99-1) unstable; urgency=high
+
+ - update to r2467. Most work done by Marcus Huewe.
+ - version 0.99
+ - wipebinaries: added --build-failed and --broken [#335498]
+ - deleteprj: enabled this command, as the backend now supports it
+ - maintainer:
+ - added --verbose option
+ - added functionality to add/remove users from a project/package
+ - print the list of URL to try, when in HTTP debug mode
+ - build: allow to use lbuild, a compatible replacement for build
+ - do not create dirs for non-existing packages during checkout
+ [#259711]
+
+ -- Peter Poeml <poeml(a)suse.de> Tue, 30 Oct 2007 00:00:00 +0200
+
osc (0.98-3) unstable; urgency=high
- update to r2075:
++++++ osc-0.98.tar.gz -> osc-0.99.tar.gz ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.98/NEWS new/osc-0.99/NEWS
--- old/osc-0.98/NEWS 2007-09-03 12:50:02.000000000 +0200
+++ new/osc-0.99/NEWS 2007-11-30 02:00:14.000000000 +0100
@@ -1,3 +1,27 @@
+since 0.99:
+
+- rdiff: new command for server-side diffs between arbitrary packages
+- cat: new command to print a file on the standard output
+- diff: reworked functionality to show newly added files, and behaving more
+ like svn when doing diff against a certain revision
+- bugfix in {link,aggregate,copy}_pac (<person> elements)
+- checkout an empty project instead of doing nothing
+- fix prjresults for newly added packages, where build status is missing
+
+
+0.99:
+
+- aggregatepac: new command, similar to linkpac. Patch from Pavol Rusnak.
+- wipebinaries: added --build-failed and --broken [#335498]
+- deleteprj: enabled this command, as the backend now supports it
+- maintainer:
+ - added --verbose option
+ - added functionality to add/remove users from a project/package
+- print the list of URL to try, when in HTTP debug mode
+- build: allow to use lbuild, a compatible replacement for build
+- do not create dirs for non-existing packages during checkout [#259711]
+
+
0.98:
- new maintainer command, to list the maintainers of a project or package
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.98/osc/build.py new/osc-0.99/osc/build.py
--- old/osc-0.98/osc/build.py 2007-09-03 12:25:18.000000000 +0200
+++ new/osc-0.99/osc/build.py 2007-09-10 14:22:13.000000000 +0200
@@ -281,7 +281,8 @@
print 'Updating cache of required packages'
fetcher = Fetcher(cachedir = config['packagecachedir'],
urllist = config['urllist'],
- auth_dict = config['auth_dict'])
+ auth_dict = config['auth_dict'],
+ http_debug = config['http_debug'])
# now update the package cache
fetcher.run(bi)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.98/osc/commandline.py new/osc-0.99/osc/commandline.py
--- old/osc-0.98/osc/commandline.py 2007-09-03 12:25:18.000000000 +0200
+++ new/osc-0.99/osc/commandline.py 2007-11-29 18:32:52.000000000 +0100
@@ -436,6 +436,36 @@
return 1
link_pac(src_project, src_package, dst_project, dst_package)
+ def do_aggregatepac(self, subcmd, opts, *args):
+ """${cmd_name}: "Aggregate" a package to another package
+
+ The DESTPAC name is optional; the source packages' name will be used if
+ DESTPAC is omitted.
+
+ usage:
+ osc aggregatepac SOURCEPRJ SOURCEPAC DESTPRJ [DESTPAC]
+ ${cmd_option_list}
+ """
+
+ args = slash_split(args)
+
+ if not args or len(args) < 3:
+ print >>sys.stderr, 'Incorrect number of argument.'
+ self.do_help([None, 'aggregatepac'])
+ return 2
+
+ src_project = args[0]
+ src_package = args[1]
+ dst_project = args[2]
+ if len(args) > 3:
+ dst_package = args[3]
+ else:
+ dst_package = src_package
+
+ if src_project == dst_project and src_package == dst_package:
+ print >>sys.stderr, 'Error: source and destination are the same.'
+ return 1
+ aggregate_pac(src_project, src_package, dst_project, dst_package)
@cmdln.option('-t', '--to-apiurl', metavar='URL',
help='URL of destination api server. Default is the source api server.')
@@ -493,27 +523,27 @@
delete_package(conf.config['apiurl'], project, package)
+ @cmdln.option('-f', '--force', action='store_true',
+ help='deletes a project and its packages')
def do_deleteprj(self, subcmd, opts, project):
"""${cmd_name}: Delete a project on the repository server
- As a safety measure, project must be empty (i.e., you first need to delete all
- packages first).
+ As a safety measure, project must be empty (i.e., you need to delete all
+ packages first). If you are sure that you want to remove this project and all
+ its packages use \'--force\' switch.
- NOTE: This command is not implemented yet. Please mail
- admin(a)opensuse.org in order to get projects deleted.
${cmd_usage}
${cmd_option_list}
"""
- if meta_get_packagelist(conf.config['apiurl'], project) != []:
- print >>sys.stderr, 'Project contains packages. It must be empty before deleting it.'
- return 1
-
- #delete_project(conf.config['apiurl'], project)
- print >>sys.stderr, 'Deleting projects is not yet implemented.'
- print >>sys.stderr, 'Please send a request to opensuse-buildservice(a)opensuse.org'
- print >>sys.stderr, 'or admin(a)opensuse.org.'
+ if len(meta_get_packagelist(conf.config['apiurl'], project)) >= 1 and not opts.force:
+ print >>sys.stderr, 'Project contains packages. It must be empty before deleting it. ' \
+ 'If you are sure that you want to remove this project and all its ' \
+ 'packages use the \'--force\' switch'
+ sys.exit(1)
+ else:
+ delete_project(conf.config['apiurl'], project)
@cmdln.option('', '--specfile', metavar='FILE',
@@ -561,98 +591,47 @@
args = parseargs(args)
pacs = findpacs(args)
- difference_found = False
- 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)
-
- # 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(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)
+ diff = ''
+ for pac in pacs:
+ diff += ''.join(make_diff(pac, rev1))
+ if len(diff) > 0:
+ print diff
- # 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
+ @cmdln.option('--oldprj', metavar='OLDPRJ',
+ help='project to compare against')
+ @cmdln.option('--oldpkg', metavar='OLDPKG',
+ help='package to compare against')
+ @cmdln.option('-r', '--revision', metavar='N[:M]',
+ help='revision id, where N = old revision and M = new revision')
+ def do_rdiff(self, subcmd, opts, new_project, new_package):
+ """${cmd_name}: server-side "pretty" diff of two packages
+
+ If neither OLDPRJ nor OLDPKG are specified, the diff is against the
+ last revision, thus showing the latest change.
+
+ Note that this command doesn't reply a "normal" diff which can be
+ applied as patch, but a pretty diff, which also compares the content of
+ tarballs.
+
+
+ ${cmd_usage}
+ ${cmd_option_list}
+ """
+
+ old_revision = None
+ new_revision = None
+ if opts.revision:
+ old_revision, new_revision = parseRevisionOption(opts.revision)
+
+ rdiff = pretty_diff(conf.config['apiurl'],
+ opts.oldprj, opts.oldpkg, old_revision,
+ new_project, new_package, new_revision)
+
+ print rdiff
+
- if difference_found:
- return 1
-
def do_repourls(self, subcmd, opts, *args):
"""${cmd_name}: shows URLs of .repo files
@@ -719,6 +698,12 @@
checkout_package(conf.config['apiurl'], project, package, rev)
elif project:
+ if not os.path.exists(project):
+ init_project_dir(conf.config['apiurl'], project, project)
+ print statfrmt('A', project)
+ else:
+ print >>sys.stderr, 'osc: project \'%s\' already exists' % project
+ sys.exit(1)
# all packages
for package in meta_get_packagelist(conf.config['apiurl'], project):
checkout_package(conf.config['apiurl'], project, package)
@@ -1363,7 +1348,8 @@
import osc.build
- if not os.path.exists('/usr/lib/build/debtransform'):
+ if not os.path.exists('/usr/lib/build/debtransform') \
+ and not os.path.exists('/usr/lib/lbuild/debtransform'):
sys.stderr.write('Error: you need build.rpm with version 2007.3.12 or newer.\n')
sys.stderr.write('See http://download.opensuse.org/repositories/openSUSE:/Tools/\n')
return 1
@@ -1557,6 +1543,10 @@
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')
+ @cmdln.option('--build-failed', action='store_true',
+ help='Delete all binaries of packages for which the build failed')
+ @cmdln.option('--broken', action='store_true',
+ help='Delete all binaries of packages for which the package source is bad')
def do_wipebinaries(self, subcmd, opts, *args):
"""${cmd_name}: Delete all binary packages of a certain project/package
@@ -1578,8 +1568,21 @@
package = args[1]
else:
package = None
-
- print wipebinaries(conf.config['apiurl'], args[0], package, opts.arch, opts.repo, opts.build_disabled)
+
+ codes = []
+ if opts.build_disabled:
+ codes.append('disabled')
+ if opts.build_failed:
+ codes.append('failed')
+ if opts.broken:
+ codes.append('broken')
+
+ if len(codes) == 0:
+ codes.append(None)
+
+ # make a new request for each code= parameter
+ for code in codes:
+ print wipebinaries(conf.config['apiurl'], args[0], package, opts.arch, opts.repo, code)
@cmdln.option('--repos-baseurl', action='store_true',
@@ -1832,23 +1835,33 @@
@cmdln.option('-e', '--email', action='store_true',
help='show email addresses instead of user names')
+ @cmdln.option('-v', '--verbose', action='store_true',
+ help='show more information')
+ @cmdln.option('-a', '--add', metavar='user',
+ help='add a new maintainer')
+ @cmdln.option('-d', '--delete', metavar='user',
+ help='delete a maintainer from a project or package')
def do_maintainer(self, subcmd, opts, *args):
"""${cmd_name}: Show maintainers of a project/package
To be used like this:
- osc maintainer PRJ
+ osc maintainer PRJ <options>
or
- osc maintainer PRJ PKG
+ osc maintainer PRJ PKG <options>
${cmd_usage}
${cmd_option_list}
"""
+ pac = None
if len(args) == 1:
m = show_project_meta(conf.config['apiurl'], args[0])
+ prj = args[0]
elif len(args) == 2:
m = show_package_meta(conf.config['apiurl'], args[0], args[1])
+ prj = args[0]
+ pac = args[1]
else:
sys.exit('wrong argument count')
@@ -1858,16 +1871,64 @@
for person in tree.findall('person'):
maintainers.append(person.get('userid'))
- if not opts.email:
- print ', '.join(maintainers)
- else:
+ if opts.email:
emails = []
for maintainer in maintainers:
- emails.append(get_user_email(conf.config['apiurl'], maintainer))
+ user = get_user_data(conf.config['apiurl'], maintainer, 'email')
+ if user != None:
+ emails.append(''.join(user))
print ', '.join(emails)
+ elif opts.verbose:
+ userdata = []
+ for maintainer in maintainers:
+ user = get_user_data(conf.config['apiurl'], maintainer, 'realname', 'login', 'email')
+ if user != None:
+ for itm in user:
+ userdata.append(itm)
+ for row in build_table(3, userdata, ['realname', 'userid', 'email\n']):
+ print row
+ elif opts.add:
+ addMaintainer(conf.config['apiurl'], prj, pac, opts.add)
+ elif opts.delete:
+ delMaintainer(conf.config['apiurl'], prj, pac, opts.delete)
+ else:
+ print ', '.join(maintainers)
+
+
+ def do_cat(self, subcmd, opts, *args):
+ """${cmd_name}: print file on the standard output
+ Examples:
+ osc cat project package file
+ osc cat project/package/file
+ ${cmd_usage}
+ ${cmd_option_list}
+ """
+ args = slash_split(args)
+ if len(args) != 3:
+ print >>sys.stderr, 'error - incorrect number of arguments'
+ sys.exit(1)
+ import tempfile
+ (fd, filename) = tempfile.mkstemp(prefix = 'osc_%s.' % args[2], dir = '/tmp')
+ get_source_file(conf.config['apiurl'], args[0], args[1], args[2], targetfilename=filename)
+ if binary(os.read(fd, 4098)):
+ print >>sys.stderr, 'error - cannot display binary file \'%s\'' % args[2]
+ else:
+ print '### Beginning of file: \'%s\' ###' % filename
+ while True:
+ buf = os.read(fd, BUFSIZE)
+ if not buf:
+ break
+ else:
+ print buf
+ print '### End of file ###'
+ try:
+ os.close(fd)
+ os.unlink(filename)
+ except:
+ pass
# fini!
###############################################################################
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.98/osc/core.py new/osc-0.99/osc/core.py
--- old/osc-0.98/osc/core.py 2007-09-03 12:17:04.000000000 +0200
+++ new/osc-0.99/osc/core.py 2007-11-29 18:22:57.000000000 +0100
@@ -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.98'
+__version__ = '0.99'
import os
import sys
@@ -201,7 +201,7 @@
def __init__(self, workingdir):
self.dir = workingdir
self.absdir = os.path.abspath(self.dir)
- self.storedir = os.path.join(self.dir, store)
+ self.storedir = os.path.join(self.absdir, store)
check_store_version(self.dir)
@@ -498,7 +498,7 @@
exists_in_store = False
if n in self.filenamelist:
known_by_meta = True
- if os.path.exists(os.path.join(self.dir, n)):
+ if os.path.exists(os.path.join(self.absdir, n)):
exists = True
if os.path.exists(os.path.join(self.storedir, n)):
exists_in_store = True
@@ -512,7 +512,7 @@
state = 'C'
elif exists and exists_in_store and known_by_meta:
#print self.findfilebyname(n)
- if dgst(os.path.join(self.dir, n)) != self.findfilebyname(n).md5:
+ if dgst(os.path.join(self.absdir, n)) != self.findfilebyname(n).md5:
state = 'M'
else:
state = ' '
@@ -829,6 +829,13 @@
return fd
+def init_project_dir(apiurl, dir, project):
+ if not os.path.exists(dir):
+ os.mkdir(dir)
+ os.mkdir(os.path.join(dir, store))
+
+ store_write_project(dir, project)
+ store_write_apiurl(dir, apiurl)
def init_package_dir(apiurl, project, package, dir, revision=None):
if not os.path.isdir(store):
@@ -867,7 +874,7 @@
sys.exit(1)
if v != __version__:
- if v in ['0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '0.95', '0.96', '0.97']:
+ if v in ['0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '0.95', '0.96', '0.97', '0.98']:
# version is fine, no migration needed
f = open(versionfile, 'w')
f.write(__version__ + '\n')
@@ -1182,14 +1189,25 @@
return None
-def get_user_email(apiurl, user):
- u = makeurl(apiurl, ['person', quote_plus(user)])
- try:
- f = http_GET(u)
- root = ET.parse(f).getroot()
- return root.find('email').text
- except urllib2.HTTPError:
- print 'user \'%s\' not found' % user
+def get_user_data(apiurl, user, *tags):
+ """get specified tags from the user meta"""
+ meta = get_user_meta(apiurl, user)
+ data = []
+ if meta != None:
+ root = ET.fromstring(meta)
+ for tag in tags:
+ try:
+ if root.find(tag).text != None:
+ data.append(root.find(tag).text)
+ else:
+ # tag is empty
+ data.append('-')
+ except AttributeError:
+ # this part is reached if the tags tuple contains an invalid tag
+ print 'The xml file for user \'%s\' seems to be broken' % user
+ return None
+ return data
+ else:
return None
@@ -1295,7 +1313,7 @@
if not origfilename:
origfilename = filename
-
+
file1 = os.path.join(olddir, oldfilename) # old/stored original
file2 = os.path.join(dir, filename) # working copy
@@ -1327,16 +1345,128 @@
return ''.join(d)
+def make_diff(wc, revision):
+ import tempfile
+ changed_files = []
+ added_files = []
+ removed_files = []
+ cmp_pac = None
+ diff_hdr = 'Index: %s\n'
+ diff_hdr += '===================================================================\n'
+ if not revision:
+ # normal diff
+ for file in wc.filenamelist+wc.filenamelist_unvers:
+ state = wc.status(file)
+ if state == 'M' or state == 'C':
+ changed_files.append(file)
+ elif state == 'A':
+ added_files.append(file)
+ elif state == 'D':
+ removed_files.append(file)
+ else:
+ olddir = os.getcwd()
+ tmpdir = tempfile.mkdtemp(revision, wc.name, '/tmp')
+ os.chdir(tmpdir)
+ init_package_dir(conf.config['apiurl'], wc.prjname, wc.name, tmpdir, revision)
+ cmp_pac = Package(tmpdir)
+ if wc.todo:
+ for file in wc.todo:
+ if file in cmp_pac.filenamelist:
+ changed_files.append(file)
+ # behave like svn
+ #else:
+ # added_files.append(file)
+ else:
+ for file in wc.filenamelist+wc.filenamelist_unvers:
+ state = wc.status(file)
+ if wc.status(file) == 'A' and (not file in cmp_pac.filenamelist):
+ added_files.append(file)
+ elif file in cmp_pac.filenamelist and wc.status(file) == 'D':
+ removed_files.append(file)
+ elif wc.status(file) == ' ' and not file in cmp_pac.filenamelist:
+ added_files.append(file)
+ elif file in cmp_pac.filenamelist and state != 'A' and state != '?':
+ if dgst(os.path.join(wc.absdir, file)) != cmp_pac.findfilebyname(file).md5:
+ changed_files.append(file)
+ for file in cmp_pac.filenamelist:
+ if not file in wc.filenamelist:
+ removed_files.append(file)
+
+ diff = []
+ for file in changed_files:
+ diff.append(diff_hdr % file)
+ if cmp_pac == None:
+ diff.append(get_source_file_diff(wc.absdir, file, wc.rev))
+ else:
+ cmp_pac.updatefile(file, revision)
+ diff.append(get_source_file_diff(wc.absdir, file, revision, file,
+ cmp_pac.absdir, file))
+ (fd, tmpfile) = tempfile.mkstemp(dir='/tmp')
+ for file in added_files:
+ diff.append(diff_hdr % file)
+ if cmp_pac == None:
+ diff.append(get_source_file_diff(wc.absdir, file, wc.rev, os.path.basename(tmpfile),
+ os.path.dirname(tmpfile), file))
+ else:
+ diff.append(get_source_file_diff(wc.absdir, file, revision, os.path.basename(tmpfile),
+ os.path.dirname(tmpfile), file))
+
+ # FIXME: this is ugly but it cannot be avoided atm
+ # if a file is deleted via "osc rm file" we should keep the storefile.
+ tmp_pac = None
+ if cmp_pac == None:
+ olddir = os.getcwd()
+ tmpdir = tempfile.mkdtemp(dir='/tmp')
+ os.chdir(tmpdir)
+ init_package_dir(conf.config['apiurl'], wc.prjname, wc.name, tmpdir, wc.rev)
+ tmp_pac = Package(tmpdir)
+ os.chdir(olddir)
+
+ for file in removed_files:
+ diff.append(diff_hdr % file)
+ if cmp_pac == None:
+ tmp_pac.updatefile(file, tmp_pac.rev)
+ diff.append(get_source_file_diff(os.path.dirname(tmpfile), os.path.basename(tmpfile),
+ wc.rev, file, tmp_pac.storedir, file))
+ else:
+ cmp_pac.updatefile(file, revision)
+ diff.append(get_source_file_diff(os.path.dirname(tmpfile), os.path.basename(tmpfile),
+ revision, file, cmp_pac.storedir, file))
+
+ os.chdir(olddir)
+ if cmp_pac != None:
+ delete_tmpdir(cmp_pac.absdir)
+ if tmp_pac != None:
+ delete_tmpdir(tmp_pac.absdir)
+ return diff
+
+
+def pretty_diff(apiurl,
+ old_project, old_package, old_revision,
+ new_project, new_package, new_revision):
+
+ query = []
+ query.append('cmd=diff')
+ if old_project:
+ query.append('oproject=%s' % quote_plus(old_project))
+ if old_package:
+ query.append('opackage=%s' % quote_plus(old_package))
+ if old_revision:
+ query.append('orev=%s' % quote_plus(old_revision))
+ if new_revision:
+ query.append('rev=%s' % quote_plus(new_revision))
+
+ u = makeurl(apiurl, ['source', new_project, new_package], query=query)
+
+ f = http_POST(u)
+ return f.read()
+
def make_dir(apiurl, project, package):
#print "creating directory '%s'" % project
if not os.path.exists(project):
print statfrmt('A', project)
- os.mkdir(project)
- os.mkdir(os.path.join(project, store))
-
- store_write_project(project, project)
- store_write_apiurl(project, apiurl)
+ init_project_dir(apiurl, project, project)
#print "creating directory '%s/%s'" % (project, package)
if not os.path.exists(os.path.join(project, package)):
@@ -1350,6 +1480,11 @@
def checkout_package(apiurl, project, package, revision=None):
olddir = os.getcwd()
+ path = (quote_plus(project), quote_plus(package))
+ if meta_exists(metatype='pkg', path_args=path, create_new=False) == None:
+ print >>sys.stderr, 'error 404 - package or package does not exist'
+ sys.exit(1)
+
os.chdir(make_dir(apiurl, project, package))
init_package_dir(apiurl, project, package, store, revision)
p = Package(os.curdir)
@@ -1361,6 +1496,20 @@
os.chdir(olddir)
+def replace_pkg_meta(pkgmeta, new_name, new_prj):
+ """
+ update pkgmeta with new new_name and new_prj and set calling user as the
+ only maintainer
+ """
+ root = ET.fromstring(''.join(pkgmeta))
+ root.set('name', new_name)
+ root.set('project', new_prj)
+ for person in root.findall('person'):
+ root.remove(person)
+ ET.SubElement(root, 'person',
+ userid = conf.config['user'], role = 'maintainer')
+ return ET.tostring(root)
+
def link_pac(src_project, src_package, dst_project, dst_package):
"""
create a linked package
@@ -1369,18 +1518,7 @@
"""
src_meta = show_package_meta(conf.config['apiurl'], src_project, src_package)
-
- # replace package name and username
- # using a string buffer
- # and create the package
- tree = ET.parse(StringIO(''.join(src_meta)))
- root = tree.getroot()
- root.set('name', dst_package)
- root.set('project', dst_project)
- tree.find('person').set('userid', conf.config['user'])
- buf = StringIO()
- tree.write(buf)
- src_meta = buf.getvalue()
+ src_meta = replace_pkg_meta(src_meta, dst_package, dst_project)
edit_meta('pkg',
path_args=(dst_project, dst_package),
@@ -1407,6 +1545,39 @@
http_PUT(u, data=link_template)
print 'Done.'
+def aggregate_pac(src_project, src_package, dst_project, dst_package):
+ """
+ aggregate package
+ - "src" is the original package
+ - "dst" is the "aggregate" package that we are creating here
+ """
+
+ src_meta = show_package_meta(conf.config['apiurl'], src_project, src_package)
+ src_meta = replace_pkg_meta(src_meta, dst_package, dst_project)
+
+ edit_meta('pkg',
+ path_args=(dst_project, dst_package),
+ data=src_meta)
+
+ # create the _aggregate file
+ # but first, make sure not to overwrite an existing one
+ if '_aggregate' in meta_get_filelist(conf.config['apiurl'], dst_project, dst_package):
+ print >>sys.stderr
+ print >>sys.stderr, '_aggregate file already exists...! Aborting'
+ sys.exit(1)
+
+ print 'Creating _aggregate...',
+ aggregate_template = """\
+<aggregatelist>
+ <aggregate project="%s">
+ <package>%s</package>
+ </aggregate>
+</aggregatelist>
+""" % (src_project, src_package)
+
+ u = makeurl(conf.config['apiurl'], ['source', dst_project, dst_package, '_aggregate'])
+ http_PUT(u, data=aggregate_template)
+ print 'Done.'
def copy_pac(src_apiurl, src_project, src_package,
dst_apiurl, dst_project, dst_package):
@@ -1417,17 +1588,7 @@
import tempfile
src_meta = show_package_meta(src_apiurl, src_project, src_package)
-
- # replace project and package name
- # using a string buffer
- # and create the package
- tree = ET.parse(StringIO(''.join(src_meta)))
- root = tree.getroot()
- root.set('name', dst_package)
- root.set('project', dst_project)
- buf = StringIO()
- tree.write(buf)
- src_meta = buf.getvalue()
+ src_meta = replace_pkg_meta(src_meta, dst_package, dst_project)
print 'Sending meta data...'
u = makeurl(dst_apiurl, ['source', dst_project, dst_package, '_meta'])
@@ -1609,6 +1770,8 @@
line = []
line.append(' ')
for pac in pacs[startpac:startpac+max_pacs]:
+ if not status.has_key(pac): # for newly added packages, status may be missing
+ status[pac] = '?'
line.append(status[pac])
line.append(' ')
line.append(' %s %s' % (target['repo'], target['arch']))
@@ -1804,7 +1967,7 @@
return root.get('code')
-def wipebinaries(apiurl, project, package=None, arch=None, repo=None, build_disabled=None):
+def wipebinaries(apiurl, project, package=None, arch=None, repo=None, code=None):
query = []
query.append('cmd=wipe')
if package:
@@ -1813,8 +1976,8 @@
query.append('arch=%s' % quote_plus(arch))
if repo:
query.append('repository=%s' % quote_plus(repo))
- if build_disabled:
- query.append('code=disabled')
+ if code:
+ query.append('code=%s' % quote_plus(code))
u = makeurl(apiurl, ['build', project], query)
try:
@@ -1827,8 +1990,8 @@
err_str += ' arch %s' % arch
if repo:
err_str += ' repository %s' % repo
- if build_disabled:
- err_str += ' code=disabled'
+ if code:
+ err_str += ' code=%s' % code
print >> sys.stderr, err_str
print >> sys.stderr, u
print >> sys.stderr, e
@@ -2118,3 +2281,61 @@
# see bug #280034
print >>sys.stderr, 'error while deleting file \'%s\'' % file
sys.exit(1)
+
+def addMaintainer(apiurl, prj, pac, user):
+ """ add a new maintainer to a package or project """
+ path = quote_plus(prj),
+ kind = 'prj'
+ if pac:
+ path = path + (quote_plus(pac),)
+ kind = 'pkg'
+ data = meta_exists(metatype=kind,
+ path_args=path,
+ template_args=None,
+ create_new=False)
+
+ if data and get_user_meta(apiurl, user) != None:
+ tree = ET.fromstring(''.join(data))
+ found = False
+ for person in tree.getiterator('person'):
+ if person.get('userid') == user:
+ found = True
+ print "user already exists"
+ break
+ if not found:
+ # the xml has a fixed structure
+ tree.insert(2, ET.Element('person', role='maintainer', userid=user))
+ print 'user \'%s\' added to \'%s\'' % (user, pac or prj)
+ edit_meta(metatype=kind,
+ path_args=path,
+ data=ET.tostring(tree))
+ else:
+ print "osc: an error occured"
+
+def delMaintainer(apiurl, prj, pac, user):
+ """ delete a maintainer from a package or project """
+ path = quote_plus(prj),
+ kind = 'prj'
+ if pac:
+ path = path + (quote_plus(pac), )
+ kind = 'pkg'
+ data = meta_exists(metatype=kind,
+ path_args=path,
+ template_args=None,
+ create_new=False)
+ if data:
+ tree = ET.fromstring(''.join(data))
+ found = False
+ for person in tree.getiterator('person'):
+ if person.get('userid') == user:
+ tree.remove(person)
+ found = True
+ print "user \'%s\' removed" % user
+ if found:
+ edit_meta(metatype=kind,
+ path_args=path,
+ data=ET.tostring(tree))
+ else:
+ print "user \'%s\' not found in \'%s\'" % (user, pac or prj)
+ else:
+ print "an error occured"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.98/osc/fetch.py new/osc-0.99/osc/fetch.py
--- old/osc-0.98/osc/fetch.py 2007-06-26 13:19:41.000000000 +0200
+++ new/osc-0.99/osc/fetch.py 2007-09-10 14:22:13.000000000 +0200
@@ -23,7 +23,7 @@
class Fetcher:
- def __init__(self, cachedir = '/tmp', auth_dict = {}, urllist = []):
+ def __init__(self, cachedir = '/tmp', auth_dict = {}, urllist = [], http_debug = False):
__version__ = '0.1'
__user_agent__ = 'osbuild/%s' % __version__
@@ -37,6 +37,7 @@
self.cachedir = cachedir
self.urllist = urllist
+ self.http_debug = http_debug
passmgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
for host in auth_dict.keys():
@@ -67,6 +68,12 @@
MirrorGroup._join_url = join_url
mg = MirrorGroup(self.gr, pac.urllist)
+ if self.http_debug:
+ print
+ print 'URLs to try for package \'%s\':' % pac
+ print '\n'.join(pac.urllist)
+ print
+
try:
# it returns the filename
ret = mg.urlgrab(pac.filename,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.98/TODO new/osc-0.99/TODO
--- old/osc-0.98/TODO 2007-09-03 12:49:44.000000000 +0200
+++ new/osc-0.99/TODO 2007-10-25 15:53:46.000000000 +0200
@@ -8,6 +8,7 @@
- think about how to locally build "linked" packages
http://lists4.opensuse.org/opensuse-buildservice/2007-07/msg00043.html
https://bugzilla.novell.com/show_bug.cgi?id=212565
+ draft on source code branching: http://en.opensuse.org/Build_Service/Concepts
NORMAL:
@@ -26,6 +27,8 @@
- use urllib.urlencode for parameter encoding (or check if this is the case already?)
- _real_ SSL support, with certificate verification
- copypac: put the current release number into the spec file before sending it
+ - for this, it is required to scan all current binaries, pick the highest release number
+ and put it into the spec file... otherwise clients won't regard the copied package as newer
- commit: check if errors during PUT are handled sensibly, so the change is
not committed to localmeta
- store password base64 hashed, so it is not directly visible in plaintext
@@ -152,3 +155,34 @@
+
+ % osc importsrcpkg -n apache2-mod_memcache /tmp/apache-mod_memcache-0.1.0-2mdv2008.0.src.rpm
+warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 26752624
+Traceback (most recent call last):
+ File "/suse/poeml/bin/osc", line 10, in ?
+ sys.exit( osc.main() )
+ File "/suse/poeml/osc/osc/cmdln.py", line 256, in main
+ return self.cmd(args)
+ File "/suse/poeml/osc/osc/cmdln.py", line 279, in cmd
+ retval = self.onecmd(argv)
+ File "/suse/poeml/osc/osc/cmdln.py", line 395, in onecmd
+ return self._dispatch_cmd(handler, argv)
+ File "/suse/poeml/osc/osc/cmdln.py", line 1070, in _dispatch_cmd
+ return handler(argv[0], opts, *args)
+ File "/suse/poeml/osc/osc/commandline.py", line 1714, in do_importsrcpkg
+ rpm_data = data_from_rpm(srpm, 'Name:', 'Summary:', '%description')
+ File "/suse/poeml/osc/osc/core.py", line 2128, in data_from_rpm
+ header = ts.hdrFromFdno(file.fileno())
+_rpm.error: public key not available
+
+
+15:16 < DuDE> mt: Projekte anlegen geht nur, wenn es ein Subprojekt ist von einem Projekt wo Du Schreibrechte hast
+15:16 < mt> DuDE: wofür?
+15:16 < DuDE> mt: dass jeder einfach so top-level-Projekte anlegen kann, war einmal. Chaos-Reduzierung
+15:17 < DuDE> mt: ueblich ist heutzutage ein Request auf opensuse-buildservice@
+15:18 < DuDE> mt: kannst Du das gleiche mal eben mit osc -H probieren? Mich wuerde mal interessieren, ob da eine sinnvollere Meldung im Body mitkommt
+15:19 < DuDE> mt: mit -H muesste osc den Response-Body anzeigen. Meist ist der unerwuenscht, weil er typischerweise dank iChain hauptsaechlich Javascript-Schlonz enthaelt.
+15:19 < mt> DuDE: reply: 'HTTP/1.1 403 Forbidden\r\n'
+15:20 < DuDE> mt: das ist gut, dann sollte osc kein "try again" anbieten, sondern die Meldung rueberbringen
+
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package dhcdbd
checked in at Fri Nov 30 00:35:27 CET 2007.
--------
New Changes file:
--- /dev/null 2006-09-20 18:56:23.000000000 +0200
+++ /mounts/work_src_done/STABLE/dhcdbd/dhcdbd.changes 2007-08-03 19:28:39.000000000 +0200
@@ -0,0 +1,152 @@
+-------------------------------------------------------------------
+Fri Aug 3 19:28:18 CEST 2007 - aj(a)suse.de
+
+- Add patch to reduce number of wakeups.
+
+-------------------------------------------------------------------
+Fri Nov 17 19:09:26 CET 2006 - varkoly(a)suse.de
+
+- Fixing bug #222267 - dhcdbd do not remove pid file
+
+-------------------------------------------------------------------
+Wed Oct 25 12:03:39 CEST 2006 - thoenig(a)suse.de
+
+- Update patch dhcdbd-dbus-reconnect-thoenig-03.patch: Do not crash
+ on D-Bus restart (b.n.c. 212468)
+
+-------------------------------------------------------------------
+Tue Oct 24 16:33:02 CEST 2006 - rml(a)suse.de
+
+- Update to dhcdbd 1.14. We already carried the fixes as patches,
+ so this is just a version bump and packaging cleanup.
+- Drop patch dhcdbd-1.14-bug-fixes.patch
+
+-------------------------------------------------------------------
+Wed Aug 9 16:57:41 CEST 2006 - thoenig(a)suse.de
+
+- Add patch: dhcdbd-dbus-api-fix-thoenig-01.patch
+
+-------------------------------------------------------------------
+Thu Jun 15 16:25:21 CEST 2006 - rml(a)suse.de
+
+- Handle non-empty /etc/HOSTNAME files that only contain newlines
+ (Novell bug #179492)
+
+-------------------------------------------------------------------
+Tue May 30 18:08:13 CEST 2006 - rml(a)suse.de
+
+- Send only the most significant hostname, not the entire FQDN,
+ from /etc/HOSTNAME when DHCLIENT_HOSTNAME_OPTION is enabled
+ (Novell bug #179903)
+
+-------------------------------------------------------------------
+Tue May 9 15:32:13 CEST 2006 - rml(a)suse.de
+
+- Fix 64-bit build (use pkg-config like we should)
+
+-------------------------------------------------------------------
+Thu May 4 23:02:48 CEST 2006 - rml(a)suse.de
+
+- Ask dhclient to set the hostname as required by the sysconfig
+ option DHCLIENT_HOSTNAME_OPTION (Novell major bug #139532)
+- Fix possible memory corruption
+
+-------------------------------------------------------------------
+Tue Mar 28 16:58:28 CEST 2006 - rml(a)suse.de
+
+- Log debugging spew less readily (Novell bug #161138)
+
+-------------------------------------------------------------------
+Tue Mar 21 21:27:13 CET 2006 - rml(a)suse.de
+
+- Survive DBUS restarts (Novell bug #150042)
+
+-------------------------------------------------------------------
+Fri Feb 24 21:01:23 CET 2006 - rml(a)suse.de
+
+- Add dhcdbd-no-nr_open-rml.patch to replace NR_OPEN with a call
+ to getdtablesize() to fix build on beta and remove use of
+ NR_OPEN.
+
+-------------------------------------------------------------------
+Wed Jan 25 21:35:26 CET 2006 - mls(a)suse.de
+
+- converted neededforbuild to BuildRequires
+
+-------------------------------------------------------------------
+Thu Jan 19 20:10:45 CET 2006 - rml(a)suse.de
+
+- 1.12 (bug fixes only)
+
+-------------------------------------------------------------------
+Wed Jan 11 22:56:24 CET 2006 - rml(a)suse.de
+
+- Remove named user from dhcdbd.conf
+
+-------------------------------------------------------------------
+Fri Jan 6 23:25:05 CET 2006 - rml(a)suse.de
+
+- Use correct lease directory (fix bug #139606)
+
+-------------------------------------------------------------------
+Wed Jan 4 23:12:44 CET 2006 - rml(a)suse.de
+
+- proper permissions on /etc/dbus-1/system.d/dhcdbd.conf
+
+-------------------------------------------------------------------
+Mon Dec 19 17:51:49 CET 2005 - rml(a)suse.de
+
+- Update to 1.11 (fixes build against DBUS 0.60)
+
+-------------------------------------------------------------------
+Mon Dec 12 16:21:44 CET 2005 - rml(a)suse.de
+
+- Remove dhcdbd service file and do not create named user or
+ group (#136872)
+
+-------------------------------------------------------------------
+Fri Dec 9 13:11:28 CET 2005 - ro(a)suse.de
+
+- create named user and group (since referenced in config)
+ fixing (#136872)
+
+-------------------------------------------------------------------
+Thu Nov 17 20:58:35 CET 2005 - rml(a)suse.de
+
+- Upgrade to 1.10 (includes our two patches).
+
+-------------------------------------------------------------------
+Mon Oct 31 20:05:30 CET 2005 - rml(a)suse.de
+
+- Add patch dhcdbd-quiet-dhclient.patch to pass "-q" option to
+ dhclient in order to minimize noise.
+- Add patch dhcdbd-use-daemon.patch to use daemon(3) instead of
+ hand-coded daemonizing code. Also ensures that stdout and stderr
+ are redirected to /dev/null, not /dev/console.
+
+-------------------------------------------------------------------
+Thu Oct 20 16:29:29 CEST 2005 - rml(a)suse.de
+
+- Update to dhcdbd 1.9
+
+-------------------------------------------------------------------
+Fri Aug 12 18:42:57 CEST 2005 - ro(a)suse.de
+
+- changed requires (#104373)
+
+-------------------------------------------------------------------
+Thu Jun 30 21:40:53 CEST 2005 - gekker(a)suse.de
+
+- Remove init script for rml, no longer needed
+
+-------------------------------------------------------------------
+Tue Jun 28 22:26:35 CEST 2005 - gekker(a)suse.de
+
+- Change requires for rml
+
+-------------------------------------------------------------------
+Fri Jun 24 01:39:02 CEST 2005 - ro(a)suse.de
+
+- created package taken from FC
+- first steps to adapt init script
+
New:
----
dhcdbd-1.14.tar.gz
dhcdbd.changes
dhcdbd-dbus-api-fix-thoenig-01.patch
dhcdbd-dbus-reconnect-thoenig-03.patch
dhcdbd-lease-dir-rml-1.10-1.patch
dhcdbd-less-verbose-logging-rml.patch
dhcdbd-no-nr_open-rml.patch
dhcdbd-powersave.patch
dhcdbd-remove-named-user-rml.patch
dhcdbd-set-hostname-fix.patch
dhcdbd-set-hostname.patch
dhcdbd-signalhandling-1.14.dif
dhcdbd.spec
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ dhcdbd.spec ++++++
#
# spec file for package dhcdbd (Version 1.14)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: dhcdbd
BuildRequires: dbus-1-devel glib2-devel
Summary: DHCP D-BUS Daemon
Version: 1.14
Release: 75
License: GPL v2 or later
Group: Productivity/Networking/Boot/Utilities
Url: http://people.redhat.com/dcantrel/dhcdbd/
Source0: %{name}-%{version}.tar.gz
Patch0: dhcdbd-lease-dir-rml-1.10-1.patch
Patch1: dhcdbd-remove-named-user-rml.patch
Patch2: dhcdbd-no-nr_open-rml.patch
Patch3: dhcdbd-dbus-reconnect-thoenig-03.patch
Patch4: dhcdbd-less-verbose-logging-rml.patch
Patch5: dhcdbd-set-hostname.patch
Patch6: dhcdbd-set-hostname-fix.patch
Patch7: dhcdbd-dbus-api-fix-thoenig-01.patch
Patch8: dhcdbd-signalhandling-1.14.dif
Patch9: dhcdbd-powersave.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: dhcp-client >= 3.0.3 dbus-1 >= 0.90
%description
DHCP D-BUS daemon (dhcdbd) controls dhclient sessions with D-BUS and
stores and presents DHCP options.
Authors:
--------
Jason Vas Dias
David Cantrell
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p0
%patch8 -p0
%patch9 -p0
%build
make CFLAGS="-Wall $RPM_OPT_FLAGS" CC='gcc' LIBDIR=%_lib
%install
DESTDIR=$RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT
# dbus lib is in /usr, so move
mkdir -p $RPM_BUILD_ROOT/usr/sbin
mv $RPM_BUILD_ROOT/sbin/dhcdbd $RPM_BUILD_ROOT/usr/sbin
mkdir -p $RPM_BUILD_ROOT/var/lib/named
rm $RPM_BUILD_ROOT/usr/share/dbus-1/services/dhcdbd.service
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc README LICENSE dhcp_options.h dhcdbd.h dbus_service.h
%attr(0644,root,root) %{_sysconfdir}/dbus-1/system.d/dhcdbd.conf
%attr(755,root,root) /usr/sbin/dhcdbd
%dir /var/lib/named
%changelog
* Fri Aug 03 2007 - aj(a)suse.de
- Add patch to reduce number of wakeups.
* Fri Nov 17 2006 - varkoly(a)suse.de
- Fixing bug #222267 - dhcdbd do not remove pid file
* Wed Oct 25 2006 - thoenig(a)suse.de
- Update patch dhcdbd-dbus-reconnect-thoenig-03.patch: Do not crash
on D-Bus restart (b.n.c. 212468)
* Tue Oct 24 2006 - rml(a)suse.de
- Update to dhcdbd 1.14. We already carried the fixes as patches,
so this is just a version bump and packaging cleanup.
- Drop patch dhcdbd-1.14-bug-fixes.patch
* Wed Aug 09 2006 - thoenig(a)suse.de
- Add patch: dhcdbd-dbus-api-fix-thoenig-01.patch
* Thu Jun 15 2006 - rml(a)suse.de
- Handle non-empty /etc/HOSTNAME files that only contain newlines
(Novell bug #179492)
* Tue May 30 2006 - rml(a)suse.de
- Send only the most significant hostname, not the entire FQDN,
from /etc/HOSTNAME when DHCLIENT_HOSTNAME_OPTION is enabled
(Novell bug #179903)
* Tue May 09 2006 - rml(a)suse.de
- Fix 64-bit build (use pkg-config like we should)
* Thu May 04 2006 - rml(a)suse.de
- Ask dhclient to set the hostname as required by the sysconfig
option DHCLIENT_HOSTNAME_OPTION (Novell major bug #139532)
- Fix possible memory corruption
* Tue Mar 28 2006 - rml(a)suse.de
- Log debugging spew less readily (Novell bug #161138)
* Tue Mar 21 2006 - rml(a)suse.de
- Survive DBUS restarts (Novell bug #150042)
* Fri Feb 24 2006 - rml(a)suse.de
- Add dhcdbd-no-nr_open-rml.patch to replace NR_OPEN with a call
to getdtablesize() to fix build on beta and remove use of
NR_OPEN.
* Wed Jan 25 2006 - mls(a)suse.de
- converted neededforbuild to BuildRequires
* Thu Jan 19 2006 - rml(a)suse.de
- 1.12 (bug fixes only)
* Wed Jan 11 2006 - rml(a)suse.de
- Remove named user from dhcdbd.conf
* Fri Jan 06 2006 - rml(a)suse.de
- Use correct lease directory (fix bug #139606)
* Wed Jan 04 2006 - rml(a)suse.de
- proper permissions on /etc/dbus-1/system.d/dhcdbd.conf
* Mon Dec 19 2005 - rml(a)suse.de
- Update to 1.11 (fixes build against DBUS 0.60)
* Mon Dec 12 2005 - rml(a)suse.de
- Remove dhcdbd service file and do not create named user or
group (#136872)
* Fri Dec 09 2005 - ro(a)suse.de
- create named user and group (since referenced in config)
fixing (#136872)
* Thu Nov 17 2005 - rml(a)suse.de
- Upgrade to 1.10 (includes our two patches).
* Mon Oct 31 2005 - rml(a)suse.de
- Add patch dhcdbd-quiet-dhclient.patch to pass "-q" option to
dhclient in order to minimize noise.
- Add patch dhcdbd-use-daemon.patch to use daemon(3) instead of
hand-coded daemonizing code. Also ensures that stdout and stderr
are redirected to /dev/null, not /dev/console.
* Thu Oct 20 2005 - rml(a)suse.de
- Update to dhcdbd 1.9
* Fri Aug 12 2005 - ro(a)suse.de
- changed requires (#104373)
* Thu Jun 30 2005 - gekker(a)suse.de
- Remove init script for rml, no longer needed
* Tue Jun 28 2005 - gekker(a)suse.de
- Change requires for rml
* Fri Jun 24 2005 - ro(a)suse.de
- created package taken from FC
- first steps to adapt init script
++++++ dhcdbd-dbus-api-fix-thoenig-01.patch ++++++
--- dbus_service.c_org 2006-08-09 12:21:18.000000000 +0200
+++ dbus_service.c 2006-08-09 12:21:26.000000000 +0200
@@ -1422,7 +1422,7 @@
return ( cs );
give_up:
- dbus_connection_disconnect( connection );
+ dbus_connection_close( connection );
dbus_shutdown();
return ( 0L );
}
++++++ dhcdbd-dbus-reconnect-thoenig-03.patch ++++++
diff -urN dhcdbd-1.12/dbus_service.c dhcdbd-1.12_mod/dbus_service.c
--- dhcdbd-1.12/dbus_service.c 2006-10-25 11:53:00.000000000 +0200
+++ dhcdbd-1.12_mod/dbus_service.c 2006-10-25 12:02:36.000000000 +0200
@@ -78,6 +78,7 @@
struct timeval tv;
} DBusConnectionTimeout;
+#define RECONNECT 254
#define SHUTDOWN 255
static void no_free( void *p){}
@@ -1219,7 +1220,6 @@
return;
fd = dbus_watch_get_fd( w );
flags = dbus_watch_get_flags( w );
- if( cs->dh != 0L ) (*(cs->dh))("handle_watch: %d", dbus_watch_get_fd( w ));
if ( (flags & DBUS_WATCH_READABLE) && (FD_ISSET(fd, &(cs->s_r_fds))) )
dbus_watch_handle(w, DBUS_WATCH_READABLE);
if ( (flags & DBUS_WATCH_WRITABLE) && (FD_ISSET(fd, &(cs->s_w_fds))) )
@@ -1311,12 +1311,12 @@
}
void
-dbus_svc_main_loop( DBusConnectionState *cs, void (*idle_handler)(DBusConnectionState *) )
+dbus_svc_main_loop( DBusConnectionState *cs, void (*idle_handler)(DBusConnectionState *), int *reconnect )
{
struct timeval timeout={0,200000};
int n_fds;
- while( cs->status != SHUTDOWN )
+ while( cs->status != SHUTDOWN && cs->status != RECONNECT )
{
cs->s_r_fds = cs->r_fds;
cs->s_w_fds = cs->w_fds;
@@ -1345,6 +1345,15 @@
if( idle_handler != 0L )
(*idle_handler)(cs);
}
+
+ *reconnect = (cs->status == RECONNECT) ? 1 : 0;
+}
+
+
+void
+dbus_svc_reconnect( DBusConnectionState *cs )
+{
+ cs->status = RECONNECT;
}
void
@@ -1358,7 +1367,7 @@
(
dbus_svc_DBUS_TYPE bus,
char *name,
- dbus_svc_ErrorHandler eh ,
+ dbus_svc_ErrorHandler eh,
dbus_svc_ErrorHandler dh
)
{
@@ -1370,10 +1379,14 @@
dbus_error_init(&error);
- if ( (connection = dbus_bus_get (bus, &error)) == 0L )
- {
- (*eh)("dbus_svc_init failed: %s %s",error.name, error.message);
- return ( 0L );
+ connection = NULL;
+ while (connection == NULL) {
+ if ( (connection = dbus_bus_get (bus, &error)) == 0L ) {
+ dbus_error_free (&error);
+ (*eh)("dbus_svc_init failed: %s %s",error.name, error.message);
+ dbus_error_init(&error);
+ sleep (3);
+ }
}
dbus_connection_set_exit_on_disconnect(connection, FALSE);
@@ -1450,8 +1463,8 @@
tdestroy( cs->roots, free_root);
cs->roots=0L;
-
- dbus_connection_disconnect( cs->connection );
- dbus_shutdown();
+ dbus_connection_unref( cs->connection );
+ dbus_connection_unref( cs->connection );
+
free( cs );
}
diff -urN dhcdbd-1.12/dbus_service.h dhcdbd-1.12_mod/dbus_service.h
--- dhcdbd-1.12/dbus_service.h 2006-01-17 22:23:51.000000000 +0100
+++ dhcdbd-1.12_mod/dbus_service.h 2006-10-25 11:53:42.000000000 +0200
@@ -114,12 +114,14 @@
* "eh" will be called for all errors from this server session.
*/
-extern void dbus_svc_main_loop( DBUS_SVC, void (*idle_handler)(DBUS_SVC) );
+extern void dbus_svc_main_loop( DBUS_SVC, void (*idle_handler)(DBUS_SVC), int * );
/*
* Enter message processing loop.
* If "idle_handler" is non-null, it will be called once per iteration of loop.
*/
+extern void dbus_svc_reconnect( DBUS_SVC );
+
extern void dbus_svc_quit( DBUS_SVC );
/*
* Exit message processing loop
diff -urN dhcdbd-1.12/dhcdbd.c dhcdbd-1.12_mod/dhcdbd.c
--- dhcdbd-1.12/dhcdbd.c 2006-10-25 11:53:00.000000000 +0200
+++ dhcdbd-1.12_mod/dhcdbd.c 2006-10-25 11:53:42.000000000 +0200
@@ -2776,7 +2776,7 @@
)
{
dhcdbd_debug("Filtered QUIT message OK");
- dbus_svc_quit( dbus );
+ dbus_svc_reconnect( dbus );
return HANDLED;
}
return NOT_HANDLED;
@@ -2789,68 +2789,73 @@
struct sigaction sa;
char path[1024];
int fd, l;
+ int reconnect = 0;
if( dhcdbd_daemonize && (daemon(0, 0) == -1) )
return errno;
openlog( "dhcdbd", LOG_NDELAY | LOG_CONS, LOG_USER );
- dbus = dbus_svc_init( bus, dhcdbd_destination, dhcdbd_log, 0L );
+ do {
+ dbus = dbus_svc_init( bus, dhcdbd_destination, dhcdbd_log, 0L );
- if ( dbus == 0L )
- {
- dhcdbd_log("Failed to initialise D-Bus service.\n");
- return( 1 );
- }
-
- dhco = dhco_new( dhcdbd_log );
- if( dhco == 0L )
- {
- dhcdbd_log("Failed to initialise DHCP options object.\n");
- return(1);
- }
+ if ( dbus == 0L )
+ {
+ dhcdbd_log("Failed to initialise D-Bus service.\n");
+ return( 1 );
+ }
+
+ dhco = dhco_new( dhcdbd_log );
+ if( dhco == 0L )
+ {
+ dhcdbd_log("Failed to initialise DHCP options object.\n");
+ return(1);
+ }
+
+ dhcdbd_debug("dhco: %p", dhco);
+
+ if ( !dbus_svc_add_path_handler
+ ( dbus, dhcdbd_object_path, dhcdbd_interface_prefix, dhcdbd_message_handler, dhco, TRUE )
+ )return( 1 );
+
+ if ( !dbus_svc_add_message_filter
+ ( dbus, dhcdbd_message_filter, 0 )
+ )return( 1 );
+
+ snprintf(path,1024,"subscribe.binary.binary");
+ if( !dbus_svc_add_handler(dbus, dhcdbd_object_path, path, dhcdbd_if_subscribe, dhco) )
+ return( 1 );
+ snprintf(path,1024,"subscribe.text.text");
+ if( !dbus_svc_add_handler(dbus, dhcdbd_object_path, path, dhcdbd_if_subscribe, dhco) )
+ return( 1 );
+ snprintf(path,1024,"subscribe.dbus.dbus");
+ if( !dbus_svc_add_handler(dbus, dhcdbd_object_path, path, dhcdbd_if_subscribe, dhco) )
+ return( 1 );
+
+ memset(&sa, '\0', sizeof(struct sigaction));
+ sa.sa_sigaction = dhc_reaper;
+ sa.sa_flags = SA_SIGINFO; /* NO RESTART, NO DEFER, CLDSTOP */
+ if( sigaction( SIGCHLD, &sa, 0L ) == -1 )
+ {
+ dhcdbd_log("sigaction failed: %s\n", strerror(errno));
+ return( 1 );
+ }
+ unlink(DHCDBD_PID_FILE);
+ if( (fd = open(DHCDBD_PID_FILE, O_WRONLY | O_CREAT)) == -1 )
+ exit(errno);
+ l=sprintf(path,"%u",getpid());
+ l=write(fd,path,l);
+ fsync(fd);
+ close(fd);
+ dhcdbd_log("Started up.");
+ dbus_svc_main_loop( dbus, dhcdbd_work, &reconnect );
+ dhcdbd_debug("Main Loop Exited.");
+ dbus_svc_shutdown( dbus );
+ } while (reconnect);
- dhcdbd_debug("dhco: %p", dhco);
-
- if ( !dbus_svc_add_path_handler
- ( dbus, dhcdbd_object_path, dhcdbd_interface_prefix, dhcdbd_message_handler, dhco, TRUE )
- )return( 1 );
-
- if ( !dbus_svc_add_message_filter
- ( dbus, dhcdbd_message_filter, 0 )
- )return( 1 );
-
- snprintf(path,1024,"subscribe.binary.binary");
- if( !dbus_svc_add_handler(dbus, dhcdbd_object_path, path, dhcdbd_if_subscribe, dhco) )
- return( 1 );
- snprintf(path,1024,"subscribe.text.text");
- if( !dbus_svc_add_handler(dbus, dhcdbd_object_path, path, dhcdbd_if_subscribe, dhco) )
- return( 1 );
- snprintf(path,1024,"subscribe.dbus.dbus");
- if( !dbus_svc_add_handler(dbus, dhcdbd_object_path, path, dhcdbd_if_subscribe, dhco) )
- return( 1 );
-
- memset(&sa, '\0', sizeof(struct sigaction));
- sa.sa_sigaction = dhc_reaper;
- sa.sa_flags = SA_SIGINFO; /* NO RESTART, NO DEFER, CLDSTOP */
- if( sigaction( SIGCHLD, &sa, 0L ) == -1 )
- {
- dhcdbd_log("sigaction failed: %s\n", strerror(errno));
- return( 1 );
- }
- unlink(DHCDBD_PID_FILE);
- if( (fd = open(DHCDBD_PID_FILE, O_WRONLY | O_CREAT)) == -1 )
- exit(errno);
- l=sprintf(path,"%u",getpid());
- l=write(fd,path,l);
- fsync(fd);
- close(fd);
- dhcdbd_log("Started up.");
- dbus_svc_main_loop( dbus, dhcdbd_work );
- dhcdbd_debug("Main Loop Exited.");
- dbus_svc_shutdown( dbus );
unlink(DHCDBD_PID_FILE);
dhcdbd_log("Shut down.");
+
return( 0 );
}
diff -urN dhcdbd-1.12/tests/test_binary.c dhcdbd-1.12_mod/tests/test_binary.c
--- dhcdbd-1.12/tests/test_binary.c 2006-01-17 22:23:51.000000000 +0100
+++ dhcdbd-1.12_mod/tests/test_binary.c 2006-10-25 11:53:42.000000000 +0200
@@ -266,6 +266,7 @@
int main( int argc, char **argv, char **envp )
{
DBUS_SVC dbus;
+ int reconnect = 0;
dhcdbd_log("starting up");
dbus = dbus_svc_init( DBUS_SYSTEM, 0L, 0L, 0L );
@@ -282,7 +283,7 @@
)
)return( 1 );
- dbus_svc_main_loop( dbus, 0L);
+ dbus_svc_main_loop( dbus, 0L, &reconnect );
return(0);
}
diff -urN dhcdbd-1.12/tests/test_prospective_subscriber.c dhcdbd-1.12_mod/tests/test_prospective_subscriber.c
--- dhcdbd-1.12/tests/test_prospective_subscriber.c 2006-01-17 22:23:51.000000000 +0100
+++ dhcdbd-1.12_mod/tests/test_prospective_subscriber.c 2006-10-25 11:53:42.000000000 +0200
@@ -184,7 +184,7 @@
int main( int argc, char **argv, char **envp )
{
DBUS_SVC dbus;
-
+ int reconnect = 0;
dbus = dbus_svc_init( DBUS_SYSTEM, 0L, 0L, 0L );
@@ -211,7 +211,7 @@
return(1);
}
- dbus_svc_main_loop( dbus, 0L);
+ dbus_svc_main_loop( dbus, 0L, &reconnect );
return(0);
}
diff -urN dhcdbd-1.12/tests/test_subscriber.c dhcdbd-1.12_mod/tests/test_subscriber.c
--- dhcdbd-1.12/tests/test_subscriber.c 2006-01-17 22:23:51.000000000 +0100
+++ dhcdbd-1.12_mod/tests/test_subscriber.c 2006-10-25 11:53:42.000000000 +0200
@@ -184,6 +184,7 @@
int main( int argc, char **argv, char **envp )
{
DBUS_SVC dbus;
+ int reconnect = 0;
char eth0[]="eth0", *ip_if = &(eth0[0]) ;
if( argc > 1 )
@@ -214,7 +215,7 @@
return(1);
}
- dbus_svc_main_loop( dbus, 0L);
+ dbus_svc_main_loop( dbus, 0L, &reconnect );
return(0);
}
diff -urN dhcdbd-1.12/tests/test_subscriber_dbus.c dhcdbd-1.12_mod/tests/test_subscriber_dbus.c
--- dhcdbd-1.12/tests/test_subscriber_dbus.c 2006-01-17 22:23:51.000000000 +0100
+++ dhcdbd-1.12_mod/tests/test_subscriber_dbus.c 2006-10-25 11:53:42.000000000 +0200
@@ -174,6 +174,7 @@
int main( int argc, char **argv, char **envp )
{
DBUS_SVC dbus;
+ int reconnect = 0;
dbus = dbus_svc_init( DBUS_SYSTEM, 0L, 0L, 0L );
@@ -200,7 +201,7 @@
return(1);
}
- dbus_svc_main_loop( dbus, 0L);
+ dbus_svc_main_loop( dbus, 0L, &reconnect );
return(0);
}
++++++ dhcdbd-lease-dir-rml-1.10-1.patch ++++++
dhcdbd.h | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
diff -urN dhcdbd-1.10/dhcdbd.h dhcdbd/dhcdbd.h
--- dhcdbd-1.10/dhcdbd.h 2005-11-16 21:36:00.000000000 -0500
+++ dhcdbd/dhcdbd.h 2006-01-06 17:22:18.000000000 -0500
@@ -31,7 +31,7 @@
#define DHCDBD_DHCLIENT_BIN "/sbin/dhclient"
#endif
#ifndef DHCDBD_DHCLIENT_LEASE_DIR
-#define DHCDBD_DHCLIENT_LEASE_DIR "/var/lib/dhclient/"
+#define DHCDBD_DHCLIENT_LEASE_DIR "/var/lib/dhcp/"
#endif
#ifndef DHCDBD_DHCLIENT_LEASE_PFX
#define DHCDBD_DHCLIENT_LEASE_PFX "dhclient-"
++++++ dhcdbd-less-verbose-logging-rml.patch ++++++
dbus_service.c | 5 -----
1 file changed, 5 deletions(-)
diff -urN dhcdbd-1.12/dbus_service.c dhcdbd/dbus_service.c
--- dhcdbd-1.12/dbus_service.c 2006-01-17 16:23:51.000000000 -0500
+++ dhcdbd/dbus_service.c 2006-03-28 09:58:24.000000000 -0500
@@ -247,12 +247,7 @@
return r;
mhpp = tfind(&mhn, &(root->tree), mh_comparator);
if ( (mhpp == 0L) || ((mhp=*mhpp)==0L) )
- {
- if( cs->eh != 0L ) (*(cs->eh))("message_handler: message handler not found under %s for sub-path %s", path, sub_path);
-
-
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
}
r =( (*(mhp->mh))
( cs, type, reply, serial, dest, path, member, interface, if_suffix,
++++++ dhcdbd-no-nr_open-rml.patch ++++++
dhcdbd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff -urN dhcdbd-1.12/dhcdbd.c dhcdbd/dhcdbd.c
--- dhcdbd-1.12/dhcdbd.c 2006-01-17 16:23:51.000000000 -0500
+++ dhcdbd/dhcdbd.c 2006-02-24 14:58:36.000000000 -0500
@@ -978,7 +978,8 @@
}else
if( d_if->dhc_pid == 0 )
{
- for( i=0; i < NR_OPEN; i++)
+ int nr_open = getdtablesize();
+ for( i=0; i < nr_open; i++)
close(i);
if((i = open("/dev/null",O_RDONLY)) != -1)
{
++++++ dhcdbd-powersave.patch ++++++
Patch from http://www.linuxpowertop.org/patches/dhcdbd.patch
to reduce number of wakeups of dhcdbd and therefore to save power.
This patch is part of dhcdbd 2.8.
--- dbus_service.c
+++ dbus_service.c
@@ -1132,6 +1132,53 @@
twalk( cs->timeouts, process_timeout );
}
+
+static float next_timeout;
+
+static void find_timeout (const void *p, const VISIT which, const int level) {
+ DBusConnectionState *cs;
+ const void *const *tpp = p;
+ DBusConnectionTimeout *to;
+ struct timeval tv;
+ float now, then, interval, timeout;
+
+ gettimeofday(&tv, 0L);
+
+ if ((tpp != 0L) && (*tpp != 0L) && ((which == postorder) || (which == leaf))) {
+ to = (DBusConnectionTimeout *) * tpp;
+ cs = to->cs;
+
+ if (!dbus_timeout_get_enabled(to->to))
+ return;
+
+ cs = dbus_timeout_get_data(to->to);
+ then = ((float) to->tv.tv_sec) + (((float) to->tv.tv_usec) / 1000000.0);
+
+ if (then != 0.0) {
+ interval = ((float) dbus_timeout_get_interval(to->to)) / 1000.0;
+ now = ((float) tv.tv_sec) + (((float) tv.tv_usec) / 1000000.0);
+
+ timeout = then + interval - now;
+ if (timeout < 0)
+ timeout = 0;
+ if (next_timeout < 0 || timeout < next_timeout)
+ next_timeout = timeout;
+ }
+ }
+}
+
+static struct timeval *find_next_timeout (DBusConnectionState * cs, struct timeval *tv) {
+ next_timeout = 1;
+ twalk(cs->timeouts, find_timeout);
+ printf ("next timeout %f\n", next_timeout);
+ if (next_timeout == -1)
+ return NULL;
+ tv->tv_sec = next_timeout;
+ tv->tv_usec = (next_timeout - tv->tv_sec) * 1000000;
+ return tv;
+}
+
+
static void
set_watch_fds( DBusWatch *watch, DBusConnectionState *cs )
{
@@ -1325,7 +1372,8 @@
timeout.tv_sec = 0;
timeout.tv_usec= 200000;
- if ( (n_fds = select(cs->n, &(cs->s_r_fds), &(cs->s_w_fds), &(cs->s_e_fds), &timeout)) < 0 )
+ if ( (n_fds = select(cs->n, &(cs->s_r_fds), &(cs->s_w_fds),
+ &(cs->s_e_fds), find_next_timeout (cs, &timeout))) < 0)
{
if (errno != EINTR)
{
++++++ dhcdbd-remove-named-user-rml.patch ++++++
remove named user from dhcdbd.conf
system.d/dhcdbd.conf | 4 ----
1 files changed, 4 deletions(-)
diff -urN dhcdbd-1.11/system.d/dhcdbd.conf dhcdbd/system.d/dhcdbd.conf
--- dhcdbd-1.11/system.d/dhcdbd.conf 2005-12-01 19:04:35.000000000 -0500
+++ dhcdbd/system.d/dhcdbd.conf 2006-01-11 16:54:47.000000000 -0500
@@ -7,10 +7,6 @@
<allow send_interface="com.redhat.dhcp"/>
<allow send_destination="com.redhat.dhcp"/>
</policy>
- <policy user="named">
- <allow send_interface="com.redhat.dhcp"/>
- <allow send_destination="com.redhat.dhcp"/>
- </policy>
<policy context="default">
<deny own="com.redhat.dhcp"/>
<deny send_destination="com.redhat.dhcp"/>
++++++ dhcdbd-set-hostname-fix.patch ++++++
diff -u dhcdbd/dhcdbd.c dhcdbd/dhcdbd.c
--- dhcdbd/dhcdbd.c 2006-05-30 12:05:27.000000000 -0400
+++ dhcdbd/dhcdbd.c 2006-05-30 12:05:27.000000000 -0400
@@ -922,7 +922,7 @@
f = fopen ("/etc/HOSTNAME", "r");
if (f) {
- if (fgets (hostname, HOST_NAME_MAX, f)) {
+ if (fgets (hostname, HOST_NAME_MAX, f) && hostname[0] != '\n') {
char *p;
/* just want the most significant hostname */
++++++ dhcdbd-set-hostname.patch ++++++
diff -urN dhcdbd-1.12/dhcdbd.c dhcdbd/dhcdbd.c
--- dhcdbd-1.12/dhcdbd.c 2006-01-17 16:23:51.000000000 -0500
+++ dhcdbd/dhcdbd.c 2006-05-30 12:05:27.000000000 -0400
@@ -20,9 +20,7 @@
#include "dbus_service.h"
#include "dhcdbd.h"
#include "dhcp_options.h"
-
-#define TRUE 1
-#define FALSE 0
+#include "shvar.h"
typedef
enum dhc_ifs_e
@@ -729,9 +727,10 @@
int dhcdbd_run_dhclient( DHC_IF *d_if )
{
char **dhc_args, **dhc_envp, *xtra_arg=0L;
- uint8_t n_args=12, arg;
+ uint8_t n_args=14, arg;
DHC_IF *rel_if=0L;
int i;
+ shvarFile *file;
sigset_t ss;
pid_t kill_pid=0;
char dhc_if_conf_file[1024];
@@ -911,6 +910,54 @@
return -1;
strcpy(dhc_args[arg], "-q");
+ file = svNewFile ("/etc/sysconfig/network/dhcp");
+ if (file) {
+ char hostname[HOST_NAME_MAX+1];
+ char *buf;
+
+ buf = svGetValue (file, "DHCLIENT_HOSTNAME_OPTION");
+ if (buf && buf[0] != '\0' && buf[0] != '"') {
+ if (!strcmp (buf, "AUTO")) {
+ FILE *f;
+
+ f = fopen ("/etc/HOSTNAME", "r");
+ if (f) {
+ if (fgets (hostname, HOST_NAME_MAX, f)) {
+ char *p;
+
+ /* just want the most significant hostname */
+ p = strchr (hostname, '.');
+ if (p)
+ p[0] = '\0';
+ else {
+ size_t len;
+
+ len = strlen (hostname);
+ if (hostname[len-1] == '\n')
+ hostname[len-1] = '\0';
+ }
+ } else {
+ fclose (f);
+ goto out;
+ }
+ fclose (f);
+ }
+ } else
+ strncpy (hostname, buf, HOST_NAME_MAX);
+
+ if((dhc_args[++arg] = (char*)malloc( 3 )) == 0L)
+ return -1;
+ strcpy(dhc_args[arg], "-H");
+ if((dhc_args[++arg] = (char*)malloc( strlen (hostname) + 1 )) == 0L)
+ return -1;
+ strcpy(dhc_args[arg], hostname);
+
+out:
+ free (buf);
+ }
+ svCloseFile (file);
+ }
+
if((dhc_args[++arg] = (char*)malloc( 3 )) == 0L)
return -1;
strcpy(dhc_args[arg], "-e");
diff -urN dhcdbd-1.12/Makefile dhcdbd/Makefile
--- dhcdbd-1.12/Makefile 2006-01-17 16:23:51.000000000 -0500
+++ dhcdbd/Makefile 2006-05-30 12:01:24.000000000 -0400
@@ -7,28 +7,31 @@
LDFLAGS ?= -g
DESTDIR ?= /
LIBDIR ?= lib
-DBUS_INCLUDES ?= -I/usr/$(LIBDIR)/dbus-1.0/include -I/usr/include/dbus-1.0
-DBUS_LIBS ?= -ldbus-1
-OBJS = dbus_service.o dhcdbd.o dhcp_options.o main.o
-SRCS = dbus_service.c dhcdbd.c dhcp_options.c main.c
-INCS = dbus_service.h dhcdbd.h dhcp_options.h includes.h
+INCLUDES ?= `pkg-config --cflags dbus-1 glib-2.0`
+LIBS ?= `pkg-config --libs dbus-1 glib-2.0`
+OBJS = dbus_service.o dhcdbd.o dhcp_options.o main.o shvar.o
+SRCS = dbus_service.c dhcdbd.c dhcp_options.c main.c shvar.c
+INCS = dbus_service.h dhcdbd.h dhcp_options.h includes.h shvar.h
all: dhcdbd tests CHANGES
.c.o:
- ${CC} ${CFLAGS} -c $<
+ ${CC} ${INCLUDES} ${CFLAGS} -c $<
.SUFFIXES: .c .o
dbus_service.o: dbus_service.c dbus_service.h
- $(CC) $(CFLAGS) $(DBUS_INCLUDES) -c dbus_service.c
+ $(CC) $(CFLAGS) $(INCLUDES) -c dbus_service.c
+
+shvar.o: shvar.c shvar.h
+ $(CC) $(CFLAGS) $(INCLUDES) -c shvar.c
dhcdbd.o: $(INCS) dhcdbd.c
dhcp_options.o: dhcp_options.c dhcp_options.h
dhcdbd: $(OBJS) $(SRCS) $(INCS)
- $(LD) $(LDFLAGS) -o $@ $(OBJS) $(DBUS_LIBS)
+ $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
tests: dhcdbd
(cd tests; make)
diff -urN dhcdbd-1.12/shvar.c dhcdbd/shvar.c
--- dhcdbd-1.12/shvar.c 1969-12-31 19:00:00.000000000 -0500
+++ dhcdbd/shvar.c 2006-05-30 12:01:24.000000000 -0400
@@ -0,0 +1,200 @@
+/*
+ * shvar.c
+ *
+ * Implementation of non-destructively reading/writing files containing
+ * only shell variable declarations and full-line comments.
+ *
+ * Includes explicit inheritance mechanism intended for use with
+ * Red Hat Linux ifcfg-* files. There is no protection against
+ * inheritance loops; they will generally cause stack overflows.
+ * Furthermore, they are only intended for one level of inheritance;
+ * the value setting algorithm assumes this.
+ *
+ * Copyright 1999,2000 Red Hat, Inc.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "shvar.h"
+
+/* Open the file <name>, returning a shvarFile on success and NULL on failure.
+ Add a wrinkle to let the caller specify whether or not to create the file
+ (actually, return a structure anyway) if it doesn't exist. */
+static shvarFile *
+svOpenFile(const char *name, gboolean create)
+{
+ shvarFile *s = NULL;
+ int closefd = 0;
+
+ s = g_malloc0(sizeof(shvarFile));
+
+#if 1 /* NetworkManager local change */
+ s->fd = open(name, O_RDONLY); /* NOT O_CREAT */
+ if (s->fd != -1) closefd = 1;
+#else
+ s->fd = open(name, O_RDWR); /* NOT O_CREAT */
+ if (s->fd == -1) {
+ /* try read-only */
+ s->fd = open(name, O_RDONLY); /* NOT O_CREAT */
+ if (s->fd != -1) closefd = 1;
+ }
+#endif
+ s->fileName = g_strdup(name);
+
+ if (s->fd != -1) {
+ struct stat buf;
+ char *p, *q;
+
+ if (fstat(s->fd, &buf) < 0) goto bail;
+ s->arena = g_malloc0(buf.st_size + 1);
+
+ if (read(s->fd, s->arena, buf.st_size) < 0) goto bail;
+
+ /* we'd use g_strsplit() here, but we want a list, not an array */
+ for(p = s->arena; (q = strchr(p, '\n')) != NULL; p = q + 1) {
+ s->lineList = g_list_append(s->lineList, g_strndup(p, q - p));
+ }
+
+ /* closefd is set if we opened the file read-only, so go ahead and
+ close it, because we can't write to it anyway */
+ if (closefd) {
+ close(s->fd);
+ s->fd = -1;
+ }
+
+ return s;
+ }
+
+ if (create) {
+ return s;
+ }
+
+bail:
+ if (s->fd != -1) close(s->fd);
+ if (s->arena) g_free (s->arena);
+ if (s->fileName) g_free (s->fileName);
+ g_free (s);
+ return NULL;
+}
+
+/* Open the file <name>, return shvarFile on success, NULL on failure */
+shvarFile *
+svNewFile(const char *name)
+{
+ return svOpenFile(name, FALSE);
+}
+
+/* Create a new file structure, returning actual data if the file exists,
+ * and a suitable starting point if it doesn't. */
+shvarFile *
+svCreateFile(const char *name)
+{
+ return svOpenFile(name, TRUE);
+}
+
+/* remove escaped characters in place */
+static void
+unescape(char *s) {
+ int len, i;
+
+ len = strlen(s);
+ if ((s[0] == '"' || s[0] == '\'') && s[0] == s[len-1]) {
+ i = len - 2;
+ memmove(s, s+1, i);
+ s[i+1] = '\0';
+ len = i;
+ }
+ for (i = 0; i < len; i++) {
+ if (s[i] == '\\') {
+ memmove(s+i, s+i+1, len-(i+1));
+ len--;
+ }
+ s[len] = '\0';
+ }
+}
+
+
+/* Get the value associated with the key, and leave the current pointer
+ * pointing at the line containing the value. The char* returned MUST
+ * be freed by the caller.
+ */
+char *
+svGetValue(shvarFile *s, const char *key)
+{
+ char *value = NULL;
+ char *line;
+ char *keyString;
+ int len;
+
+ g_assert(s);
+ g_assert(key);
+
+ keyString = g_malloc0(strlen(key) + 2);
+ strcpy(keyString, key);
+ keyString[strlen(key)] = '=';
+ len = strlen(keyString);
+
+ for (s->current = s->lineList; s->current; s->current = s->current->next) {
+ line = s->current->data;
+ if (!strncmp(keyString, line, len)) {
+ value = g_strdup(line + len);
+ unescape(value);
+ break;
+ }
+ }
+ g_free(keyString);
+
+ if (value) {
+ if (value[0]) {
+ return value;
+ } else {
+ g_free(value);
+ return NULL;
+ }
+ }
+ if (s->parent) value = svGetValue(s->parent, key);
+ return value;
+}
+
+/* Close the file descriptor (if open) and delete the shvarFile.
+ * Returns -1 on error and 0 on success.
+ */
+int
+svCloseFile(shvarFile *s)
+{
+
+ g_assert(s);
+
+ if (s->fd != -1) close(s->fd);
+
+ g_free(s->arena);
+ for (s->current = s->freeList; s->current; s->current = s->current->next) {
+ g_free(s->current->data);
+ }
+ g_free(s->fileName);
+ g_list_free(s->freeList);
+ g_list_free(s->lineList); /* implicitly frees s->current */
+ g_free(s);
+ return 0;
+}
diff -urN dhcdbd-1.12/shvar.h dhcdbd/shvar.h
--- dhcdbd-1.12/shvar.h 1969-12-31 19:00:00.000000000 -0500
+++ dhcdbd/shvar.h 2006-05-30 12:01:24.000000000 -0400
@@ -0,0 +1,74 @@
+/*
+ * shvar.h
+ *
+ * Interface for non-destructively reading/writing files containing
+ * only shell variable declarations and full-line comments.
+ *
+ * Includes explicit inheritance mechanism intended for use with
+ * Red Hat Linux ifcfg-* files. There is no protection against
+ * inheritance loops; they will generally cause stack overflows.
+ * Furthermore, they are only intended for one level of inheritance;
+ * the value setting algorithm assumes this.
+ *
+ * Copyright 1999 Red Hat, Inc.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+#ifndef _SHVAR_H
+#define _SHVAR_H
+
+#include <glib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+typedef struct _shvarFile shvarFile;
+struct _shvarFile {
+ char *fileName; /* read-only */
+ int fd; /* read-only */
+ char *arena; /* ignore */
+ GList *lineList; /* read-only */
+ GList *freeList; /* ignore */
+ GList *current; /* set implicitly or explicitly,
+ points to element of lineList */
+ shvarFile *parent; /* set explicitly */
+ int modified; /* ignore */
+};
+
+
+/* Open the file <name>, return shvarFile on success, NULL on failure */
+shvarFile *
+svNewFile(const char *name);
+
+/* Get the value associated with the key, and leave the current pointer
+ * pointing at the line containing the value. The char* returned MUST
+ * be freed by the caller.
+ */
+char *
+svGetValue(shvarFile *s, const char *key);
+
+/* Close the file descriptor (if open) and delete the shvarFile.
+ * Returns -1 on error and 0 on success.
+ */
+int
+svCloseFile(shvarFile *s);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* ! _SHVAR_H */
++++++ dhcdbd-signalhandling-1.14.dif ++++++
--- dhcdbd.c
+++ dhcdbd.c 2006/11/17 16:36:21
@@ -2782,14 +2782,21 @@
return NOT_HANDLED;
}
+static DBUS_SVC dbus;
+void quit_sig_handler(int signr)
+{
+ (void)signr;
+ dbus_svc_quit(dbus);
+}
+
int dhcdbd_run( D_BUS_TYPE bus )
{
- DBUS_SVC dbus;
DHCO dhco;
struct sigaction sa;
char path[1024];
int fd, l;
int reconnect = 0;
+ int exit_code = 0;
if( dhcdbd_daemonize && (daemon(0, 0) == -1) )
return errno;
@@ -2802,35 +2809,47 @@
if ( dbus == 0L )
{
dhcdbd_log("Failed to initialise D-Bus service.\n");
- return( 1 );
+ exit_code = 1; break;
}
dhco = dhco_new( dhcdbd_log );
if( dhco == 0L )
{
dhcdbd_log("Failed to initialise DHCP options object.\n");
- return(1);
+ exit_code = 1; break;
}
dhcdbd_debug("dhco: %p", dhco);
if ( !dbus_svc_add_path_handler
( dbus, dhcdbd_object_path, dhcdbd_interface_prefix, dhcdbd_message_handler, dhco, TRUE )
- )return( 1 );
+ )
+ {
+ exit_code = 1; break;
+ }
if ( !dbus_svc_add_message_filter
( dbus, dhcdbd_message_filter, 0 )
- )return( 1 );
+ )
+ {
+ exit_code = 1; break;
+ }
snprintf(path,1024,"subscribe.binary.binary");
if( !dbus_svc_add_handler(dbus, dhcdbd_object_path, path, dhcdbd_if_subscribe, dhco) )
- return( 1 );
+ {
+ exit_code = 1; break;
+ }
snprintf(path,1024,"subscribe.text.text");
if( !dbus_svc_add_handler(dbus, dhcdbd_object_path, path, dhcdbd_if_subscribe, dhco) )
- return( 1 );
+ {
+ exit_code = 1; break;
+ }
snprintf(path,1024,"subscribe.dbus.dbus");
if( !dbus_svc_add_handler(dbus, dhcdbd_object_path, path, dhcdbd_if_subscribe, dhco) )
- return( 1 );
+ {
+ exit_code = 1; break;
+ }
memset(&sa, '\0', sizeof(struct sigaction));
sa.sa_sigaction = dhc_reaper;
@@ -2838,8 +2857,15 @@
if( sigaction( SIGCHLD, &sa, 0L ) == -1 )
{
dhcdbd_log("sigaction failed: %s\n", strerror(errno));
- return( 1 );
+ exit_code = 1; break;
}
+
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ sa.sa_handler = quit_sig_handler;
+ sigaction(SIGINT, &sa, NULL);
+ sigaction(SIGTERM, &sa, NULL);
+
unlink(DHCDBD_PID_FILE);
if( (fd = open(DHCDBD_PID_FILE, O_WRONLY | O_CREAT)) == -1 )
exit(errno);
@@ -2856,7 +2882,7 @@
unlink(DHCDBD_PID_FILE);
dhcdbd_log("Shut down.");
- return( 0 );
+ return( exit_code );
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package NetworkManager
checked in at Fri Nov 30 00:35:08 CET 2007.
--------
--- NetworkManager/NetworkManager.changes 2007-11-29 01:41:18.000000000 +0100
+++ /mounts/work_src_done/STABLE/NetworkManager/NetworkManager.changes 2007-09-14 09:12:08.000000000 +0200
@@ -2,9 +1,0 @@
-Wed Nov 28 11:32:12 CET 2007 - tambet(a)suse.de
-
-- Upgrade to the unstable branch (0.7).
- - many changes and bugfixes
- - integrate all previous patches
- - switch to using dhcp-client instead of dhcdbd
- - gnome applet split off to own source
-
--------------------------------------------------------------------
Old:
----
NetworkManager-0.7.0.tar.bz2
New:
----
NetworkManager-0.6.5.tar.bz2
network-manager-applet-0.6.5.tar.bz2
nm-0.6.5-killswitch-fix.patch
nm-191251.patch
nm-222902.patch
nm-243959.patch
nm-271757.patch
nm-applet-0.6.5-build.patch
nm-applet-disconnect-on-exit.patch
nm-applet-editor.patch
nm-applet-fallback.patch
nm-configure-networking-rml.patch
nm-disconnect-wireless-on-exit.sh
nm-editor.tgz
nm-fallback.patch
nm-fix-adhoc-icon-rml.patch
nm-icons.tar.gz
nm-make-wireless-menu-item-inactive-rml.patch
nm-never-restart-nm-applet-rml.patch
nm-resolv-conf-header-rml.patch
nm-save-passwds-in-keyring.patch
nm-wireless-driver-workarounds-rml.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ NetworkManager.spec ++++++
--- /var/tmp/diff_new_pack.sZ3470/_old 2007-11-30 00:34:54.000000000 +0100
+++ /var/tmp/diff_new_pack.sZ3470/_new 2007-11-30 00:34:54.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package NetworkManager (Version 0.7.0)
+# spec file for package NetworkManager (Version 0.6.5)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -8,29 +8,70 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+# norootforbuild
Name: NetworkManager
-Url: http://www.gnome.org/projects/NetworkManager/
-Version: 0.7.0
-Release: 1
-License: GPL v2 or later
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: dbus-1-devel dbus-1-glib hal-devel intltool iproute2 libgcrypt-devel libnl-devel libtool ppp-devel wireless-tools
-Group: Productivity/Networking/System
-Summary: Network Link Manager and User Applications
-Source0: NetworkManager-%{version}.tar.bz2
-Source1: nfs
-Requires: wpa_supplicant >= 0.5.8-54
-Requires: dhcp-client
-Obsoletes: dhcdbd
-%define dbus_version 1.1.2
-%define dbus_glib_version 0.74
+BuildRequires: dhcdbd fdupes gconf2-devel gnome-keyring-devel gnome-patch-translation hal-devel intltool iproute2 libgcrypt-devel libglade2-devel libgnomeui-devel libgpg-error-devel libnl-devel libnotify-devel libtool wireless-tools wpa_supplicant
+%if %suse_version > 1010
+BuildRequires: dbus-1-glib-devel
+%else
+BuildRequires: dbus-1-devel dbus-1-glib
+%endif
+%define dbus_version 0.60-22
%define hal_version 0.5.0
%define wireless_version 28pre13-6
+%define wpa_supplicant_version 0.4.8-14
+%define resmgr_version 0.9.8
+%define dhcp_version 3.0.3-22
%define gtk_version 2.6.0
%define keyring_version 0.4.4
%define libnl_version 1.0-6
+%define dhcdbd_version 1.12-19
%define sysconfig_version 0.50.9-13.3
+License: GPL v2 or later
+Group: Productivity/Networking/System
+Url: http://www.gnome.org/projects/NetworkManager/
+AutoReqProv: on
+Version: 0.6.5
+Release: 69
+Summary: Network Link Manager and User Applications
+Source0: NetworkManager-%{version}.tar.bz2
+Source1: network-manager-applet-%{version}.tar.bz2
+Source2: nm-editor.tgz
+Source3: nm-icons.tar.gz
+Source4: nfs
+Source5: nm-disconnect-wireless-on-exit.sh
+Patch0: nm-wireless-driver-workarounds-rml.patch
+Patch1: nm-resolv-conf-header-rml.patch
+Patch2: nm-fallback.patch
+Patch3: nm-222902.patch
+Patch4: nm-191251.patch
+Patch5: nm-0.6.5-killswitch-fix.patch
+Patch6: nm-271757.patch
+Patch7: nm-applet-0.6.5-build.patch
+Patch8: nm-make-wireless-menu-item-inactive-rml.patch
+Patch9: nm-configure-networking-rml.patch
+Patch10: nm-never-restart-nm-applet-rml.patch
+Patch11: nm-fix-adhoc-icon-rml.patch
+Patch12: nm-applet-disconnect-on-exit.patch
+Patch13: nm-243959.patch
+Patch14: nm-applet-fallback.patch
+Patch15: nm-save-passwds-in-keyring.patch
+Patch16: nm-applet-editor.patch
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+PreReq: sysconfig >= %{sysconfig_version} /usr/bin/sed
+Recommends: %{name}-client
+Requires: wireless-tools >= %{wireless_version}
+Requires: dbus-1 >= %{dbus_version}
+Requires: dbus-1-glib >= %{dbus_version}
+Requires: hal >= %{hal_version}
+Requires: resmgr >= %{resmgr_version}
+Requires: dhcp-client >= %{dhcp_version}
+Requires: wpa_supplicant >= %{wpa_supplicant_version}
+Requires: dhcdbd >= %{dhcdbd_version}
+Requires: libnl >= %{libnl_version}
+Requires: iproute2 openssl nscd
+Conflicts: netapplet
%description
NetworkManager attempts to keep an active network connection available
@@ -47,13 +88,35 @@
Dan Williams <dcbw(a)redhat.com>
Robert Love <rml(a)novell.com>
+%package gnome
+Summary: GNOME applications for use with NetworkManager
+Group: System/GUI/GNOME
+Provides: %{name}-client
+Requires: %{name} = %{version}-%{release}
+Requires: dbus-1 >= %{dbus_version}
+Requires: dbus-1-glib >= %{dbus_version}
+Requires: hal >= %{hal_version}
+Requires: gnome-keyring >= %{keyring_version}
+Requires: gtk2 >= %{gtk_version}
+
+%description gnome
+This package contains GNOME utilities and applications for use with
+NetworkManager, including a panel applet for wireless networks.
+
+
+
+Authors:
+--------
+ Dan Williams <dcbw(a)redhat.com>
+ Robert Love <rml(a)novell.com>
+
%package devel
Summary: Libraries and headers for adding NetworkManager support to applications
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Requires: %{name}-glib = %{version}-%{release}
Requires: dbus-1 >= %{dbus_version}
-Requires: dbus-1-glib >= %{dbus_glib_version}
+Requires: dbus-1-glib >= %{dbus_version}
Requires: dbus-1-devel
Requires: glib2-devel
Requires: dbus-1-glib-devel
@@ -76,7 +139,7 @@
Group: Development/Libraries/GNOME
Requires: %{name} = %{version}-%{release}
Requires: dbus-1 >= %{dbus_version}
-Requires: dbus-1-glib >= %{dbus_glib_version}
+Requires: dbus-1-glib >= %{dbus_version}
Requires: glib2
%description glib
@@ -91,31 +154,84 @@
Robert Love <rml(a)novell.com>
%prep
-%setup
+%setup -a 1 -a 2 -a 3
+cd nm-applet-0.6.5
+gnome-patch-translation-prepare
+cd ..
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+mv editor nm-applet-0.6.5/
+# applet
+%patch7 -p1
+%patch8 -p0
+%patch9 -p0
+%patch10 -p0
+%patch11 -p0
+%patch12 -p0
+%patch13 -p0
+%patch14 -p0
+%patch15 -p0
+%patch16 -p1
+cd nm-applet-0.6.5
+gnome-patch-translation-update
+# Prepare directory for gnome-patch-translation-collect:
+mv gnome-patch-translation ..
+cd ..
%build
+intltoolize --force
+autoreconf
%configure\
--libexecdir=%{_prefix}/lib/NetworkManager\
--disable-static\
--with-gcrypt=yes\
--with-distro=suse
make %{?jobs:-j%jobs}
+# applet
+pushd nm-applet-0.6.5
+ sed -i s/" --sm-disable"// nm-applet.desktop
+ autoreconf -i
+ intltoolize --force
+ %configure\
+ --disable-static\
+ --with-notify
+ make
+popd
%install
+%fdupes -s $RPM_BUILD_ROOT
%makeinstall
-%find_lang %{name}
-mkdir -p $RPM_BUILD_ROOT%{_bindir}
-install -m 755 test/nm-tool $RPM_BUILD_ROOT%{_bindir}/
-install -m 755 test/nm-online $RPM_BUILD_ROOT%{_bindir}/
mkdir -p $RPM_BUILD_ROOT/var/log/
touch $RPM_BUILD_ROOT/var/log/NetworkManager
-cp %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/
+# applet
+pushd nm-applet-0.6.5
+ make install DESTDIR=$RPM_BUILD_ROOT
+popd
+%find_lang %{name}
+%find_lang nm-applet
+cat nm-applet.lang >> %{name}.lang
+cp -r nm-icons/* $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/
+cp test/nm-tool $RPM_BUILD_ROOT%{_bindir}/
+cp test/nm-online $RPM_BUILD_ROOT%{_bindir}/
+install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/
+cp %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/NetworkManager/
%clean
-rm -rf "$RPM_BUILD_ROOT"
+rm -rf $RPM_BUILD_ROOT
%post
/sbin/ldconfig
+if [ "$1" = 1 ]; then
+ if grep "network_manager.*always" etc/YaST2/ProductFeatures &> /dev/null; then
+ sed -i '/^NETWORKMANAGER=.*no/s/no/yes/' etc/sysconfig/network/config
+ sed -i '/^NM_DISPATCHER=.*no/s/no/yes/' etc/sysconfig/network/config
+ fi
+fi
%postun -p /sbin/ldconfig
@@ -126,43 +242,42 @@
%files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING ChangeLog NEWS AUTHORS README CONTRIBUTING TODO
-%{_bindir}/nm-tool
-%{_bindir}/nm-online
+%{_bindir}/nm-[ot]*
%{_libdir}/libnm-util.so.*
-%{_libdir}/nm-pppd-plugin.*
%{_datadir}/NetworkManager
%dir %attr(0700,root,root) %{_localstatedir}/run/NetworkManager
%doc %{_mandir}/man1/*.*
-%doc %{_mandir}/man8/*.*
%{_prefix}/lib/NetworkManager
%{_sbindir}/*
%{_sysconfdir}/dbus-1/system.d/NetworkManager.conf
-%{_sysconfdir}/dbus-1/system.d/nm-dhcp-client.conf
-%dir %{_sysconfdir}/NetworkManager
-%dir %{_sysconfdir}/NetworkManager/dispatcher.d
-%attr(0755,root,root) %{_sysconfdir}/NetworkManager/dispatcher.d/nfs
+%{_sysconfdir}/NetworkManager
%ghost %config(noreplace) /var/log/NetworkManager
+%files gnome
+%defattr(-,root,root)
+%{_bindir}/nm-applet
+%{_bindir}/nm-vpn-properties
+%{_bindir}/nm-editor
+%{_datadir}/gnome/autostart/nm-applet.desktop
+%{_datadir}/nm-applet
+%{_datadir}/nm-editor
+%{_datadir}/applications/nm-editor.desktop
+%{_datadir}/icons/hicolor/*/apps/*.png
+%{_datadir}/gnome-vpn-properties
+%{_sysconfdir}/dbus-1/system.d/nm-applet.conf
+
%files devel
%defattr(-,root,root)
%{_includedir}/NetworkManager
-%{_includedir}/libnm-glib
-%{_libdir}/libnm-util*
-%{_libdir}/pkgconfig/NetworkManager.pc
-%{_libdir}/pkgconfig/libnm-util.pc
-%{_libdir}/pkgconfig/libnm_glib.pc
+%{_libdir}/*.so
+%{_libdir}/*.*a
+%{_libdir}/pkgconfig/*.pc
%files glib
%defattr(-,root,root)
-%{_libdir}/libnm_glib*
+%{_libdir}/libnm_glib.so.*
%changelog
-* Wed Nov 28 2007 - tambet(a)suse.de
-- Upgrade to the unstable branch (0.7).
- - many changes and bugfixes
- - integrate all previous patches
- - switch to using dhcp-client instead of dhcdbd
- - gnome applet split off to own source
* Fri Sep 14 2007 - tambet(a)suse.de
- Make sure gnome-keyring does not return empty result. (Novell #307910).
* Wed Aug 15 2007 - tambet(a)suse.de
++++++ NetworkManager-0.7.0.tar.bz2 -> NetworkManager-0.6.5.tar.bz2 ++++++
++++ 148301 lines of diff (skipped)
++++++ nm-0.6.5-killswitch-fix.patch ++++++
Index: NetworkManager-0.6.5/src/NetworkManager.c
===================================================================
--- NetworkManager-0.6.5.orig/src/NetworkManager.c
+++ NetworkManager-0.6.5/src/NetworkManager.c
@@ -826,6 +826,10 @@ void nm_hal_init (NMData *data)
nm_add_initial_killswitch_devices (data);
nm_add_initial_devices (data);
}
+
+ /* If there weren't any killswitches, mark hardware RF to on */
+ if (g_slist_length (data->killswitch_list) == 0)
+ data->hw_rf_enabled = TRUE;
}
++++++ nm-191251.patch ++++++
Index: NetworkManager-0.6.5/src/vpn-manager/nm-dbus-vpn.c
===================================================================
--- NetworkManager-0.6.5.orig/src/vpn-manager/nm-dbus-vpn.c
+++ NetworkManager-0.6.5/src/vpn-manager/nm-dbus-vpn.c
@@ -410,8 +410,6 @@ static void nm_dbus_vpn_connections_upda
NMData * data = (NMData *) user_data;
DBusMessage * reply;
DBusMessageIter iter, array_iter;
- GSList * remove_list = NULL;
- GSList * elt;
g_return_if_fail (pcall);
g_return_if_fail (data != NULL);
@@ -427,22 +425,15 @@ static void nm_dbus_vpn_connections_upda
nm_info ("Updating VPN Connections...");
- remove_list = nm_vpn_manager_vpn_connection_list_copy (data->vpn_manager);
-
dbus_message_iter_init (reply, &iter);
dbus_message_iter_recurse (&iter, &array_iter);
while (dbus_message_iter_get_arg_type (&array_iter) == DBUS_TYPE_STRING)
{
DBusMessage * message;
const char * con_name;
- NMVPNConnection * vpn;
dbus_message_iter_get_basic (&array_iter, &con_name);
- /* If the connection already exists, remove it from the remove list */
- if ((vpn = nm_vpn_manager_find_connection_by_name (data->vpn_manager, con_name)))
- remove_list = g_slist_remove (remove_list, vpn);
-
if ((message = dbus_message_new_method_call (NMI_DBUS_SERVICE, NMI_DBUS_PATH, NMI_DBUS_INTERFACE, "getVPNConnectionProperties")))
{
DBusPendingCall * vpn_pcall = NULL;
@@ -463,15 +454,6 @@ static void nm_dbus_vpn_connections_upda
}
dbus_message_unref (reply);
- /* VPN connections left in the remove list aren't known by NMI, therefore we delete them */
- for (elt = remove_list; elt; elt = g_slist_next (elt))
- {
- nm_vpn_manager_remove_connection (data->vpn_manager, elt->data);
- nm_vpn_connection_unref (elt->data);
- }
-
- g_slist_free (remove_list);
-
out:
dbus_pending_call_unref (pcall);
}
@@ -527,6 +509,8 @@ static gboolean nm_dbus_vpn_connections_
g_return_val_if_fail (data->dbus_connection != NULL, FALSE);
g_return_val_if_fail (data->vpn_manager != NULL, FALSE);
+ nm_vpn_manager_clear_connections (data->vpn_manager);
+
if (!(message = dbus_message_new_method_call (NMI_DBUS_SERVICE, NMI_DBUS_PATH, NMI_DBUS_INTERFACE, "getVPNConnections")))
{
nm_warning ("nm_dbus_vpn_connections_update (): Couldn't allocate the dbus message");
Index: NetworkManager-0.6.5/src/vpn-manager/nm-vpn-manager.c
===================================================================
--- NetworkManager-0.6.5.orig/src/vpn-manager/nm-vpn-manager.c
+++ NetworkManager-0.6.5/src/vpn-manager/nm-vpn-manager.c
@@ -130,28 +130,6 @@ NMVPNService *nm_vpn_manager_find_servic
/*
- * nm_vpn_manager_vpn_connection_list_copy
- *
- * Make a shallow copy of the VPN connection list, should
- * only be used by nm-dbus-vpn.c
- *
- */
-GSList *nm_vpn_manager_vpn_connection_list_copy (NMVPNManager *manager)
-{
- GSList * list;
- GSList * elt;
-
- g_return_val_if_fail (manager != NULL, NULL);
-
- list = g_slist_copy (manager->connections);
- for (elt = list; elt; elt = g_slist_next (elt))
- nm_vpn_connection_ref (elt->data);
-
- return list;
-}
-
-
-/*
* nm_vpn_manager_add_connection
*
* Add a new VPN connection if none already exits, otherwise update the existing one.
@@ -227,6 +205,29 @@ void nm_vpn_manager_remove_connection (N
/*
+ * nm_vpn_manager_clear_connections
+ *
+ * Remove all VPN connections.
+ *
+ */
+void
+nm_vpn_manager_clear_connections (NMVPNManager *manager)
+{
+ GSList *connections;
+ GSList *iter;
+
+ g_return_if_fail (manager != NULL);
+
+ connections = g_slist_copy (manager->connections);
+
+ for (iter = connections; iter; iter = iter->next)
+ nm_vpn_manager_remove_connection (manager, (NMVPNConnection *) iter->data);
+
+ g_slist_free (connections);
+}
+
+
+/*
* nm_vpn_manager_get_connection_names
*
* Return an array of strings of all the VPN Connection names
Index: NetworkManager-0.6.5/src/vpn-manager/nm-vpn-manager.h
===================================================================
--- NetworkManager-0.6.5.orig/src/vpn-manager/nm-vpn-manager.h
+++ NetworkManager-0.6.5/src/vpn-manager/nm-vpn-manager.h
@@ -29,13 +29,12 @@
NMVPNManager * nm_vpn_manager_new (NMData *app_data);
NMVPNConnection * nm_vpn_manager_add_connection (NMVPNManager *manager, const char *name, const char *service_name, const char *user_name);
void nm_vpn_manager_remove_connection (NMVPNManager *manager, NMVPNConnection *vpn);
+void nm_vpn_manager_clear_connections (NMVPNManager *manager);
char ** nm_vpn_manager_get_connection_names (NMVPNManager *manager);
void nm_vpn_manager_dispose (NMVPNManager *manager);
NMVPNActRequest * nm_vpn_manager_get_vpn_act_request (NMVPNManager *manager);
-GSList * nm_vpn_manager_vpn_connection_list_copy (NMVPNManager *manager);
-
void nm_vpn_manager_activate_vpn_connection (NMVPNManager *manager, NMVPNConnection *vpn, char **password_items,
int password_count, char **data_items, int data_count,
char **user_routes, int user_routes_count );
++++++ nm-222902.patch ++++++
Index: NetworkManager-0.6.5/src/nm-device-802-11-wireless.c
===================================================================
--- NetworkManager-0.6.5.orig/src/nm-device-802-11-wireless.c
+++ NetworkManager-0.6.5/src/nm-device-802-11-wireless.c
@@ -2637,7 +2637,7 @@ supplicant_status_cb (GIOChannel *source
if ((self->priv->link_timeout == NULL) && !self->priv->scanning)
{
GMainContext * context = nm_device_get_main_context (dev);
- self->priv->link_timeout = g_timeout_source_new (8000);
+ self->priv->link_timeout = g_timeout_source_new (16000);
g_source_set_callback (self->priv->link_timeout,
link_timeout_cb,
self,
++++++ nm-243959.patch ++++++
Index: nm-applet-0.6.5/src/applet-dbus-info.c
===================================================================
--- nm-applet-0.6.5/src/applet-dbus-info.c.orig
+++ nm-applet-0.6.5/src/applet-dbus-info.c
@@ -841,6 +841,16 @@ nmi_dbus_get_vpn_connection_routes (DBus
}
+static void
+save_network_info_keyring_cb (GnomeKeyringResult result,
+ guint32 val,
+ gpointer user_data)
+{
+ if (result != GNOME_KEYRING_RESULT_OK)
+ nm_warning ("Error saving secret for wireless network '%s' in keyring: %d", (char *) user_data, result);
+}
+
+
/*
* nmi_save_network_info
*
@@ -942,8 +952,6 @@ nmi_save_network_info (NMApplet *applet,
GnomeKeyringAttributeList * attributes;
GnomeKeyringAttribute attr;
char * display_name;
- GnomeKeyringResult ret;
- guint32 item_id;
display_name = g_strdup_printf (_("Passphrase for wireless network %s"), essid);
@@ -953,16 +961,15 @@ nmi_save_network_info (NMApplet *applet,
attr.value.string = g_strdup (essid);
g_array_append_val (attributes, attr);
- ret = gnome_keyring_item_create_sync (NULL,
- GNOME_KEYRING_ITEM_GENERIC_SECRET,
- display_name,
- attributes,
- nm_gconf_wso_get_key (gconf_wso),
- TRUE,
- &item_id);
- if (ret != GNOME_KEYRING_RESULT_OK)
- nm_warning ("Error saving secret for wireless network '%s' in keyring: %d", essid, ret);
-
+ gnome_keyring_item_create (NULL,
+ GNOME_KEYRING_ITEM_GENERIC_SECRET,
+ display_name,
+ attributes,
+ nm_gconf_wso_get_key (gconf_wso),
+ TRUE,
+ save_network_info_keyring_cb,
+ g_strdup (essid),
+ (GDestroyNotify) g_free);
g_free (display_name);
gnome_keyring_attribute_list_free (attributes);
}
++++++ nm-271757.patch ++++++
Index: NetworkManager-0.6.5/src/backends/NetworkManagerSuSE.c
===================================================================
--- NetworkManager-0.6.5.orig/src/backends/NetworkManagerSuSE.c
+++ NetworkManager-0.6.5/src/backends/NetworkManagerSuSE.c
@@ -32,6 +32,9 @@
#include <signal.h>
#include <sys/stat.h>
#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <string.h>
#include "NetworkManagerSystem.h"
#include "NetworkManagerUtils.h"
@@ -425,6 +428,38 @@ out:
}
+static gboolean
+parse_netmask (const char *buf, guint32 *netmask)
+{
+ gboolean success = FALSE;
+
+ if (strstr (buf, ".")) {
+ struct in_addr addr;
+
+ if (inet_aton (buf, &addr)) {
+ *netmask = addr.s_addr;
+ success = TRUE;
+ }
+ } else {
+ int maskval;
+
+ maskval = atoi (buf);
+ if (maskval >= 0 && maskval <= 32) {
+ guint32 mask = 0;
+
+ while (maskval > 0) {
+ mask = (mask >> 1) + 0x80000000;
+ maskval--;
+ }
+
+ *netmask = htonl (mask);
+ success = TRUE;
+ }
+ }
+
+ return success;
+}
+
/*
* nm_system_device_get_system_config
*
@@ -674,14 +709,38 @@ found:
buf = svGetValue (file, "IPADDR");
if (buf)
{
- struct in_addr ip;
- int ret;
-
- ret = inet_aton (buf, &ip);
- if (ret)
- nm_ip4_config_set_address (sys_data->config, ip.s_addr);
- else
+ char **pieces;
+ char *ip_str = NULL;
+ char *netmask_str = NULL;
+
+ pieces = g_strsplit (buf, "/", 0);
+ if (g_strv_length (pieces) == 1) {
+ ip_str = buf;
+ } else if (g_strv_length (pieces) == 2) {
+ ip_str = pieces[0];
+ netmask_str = pieces[1];
+ } else
error = TRUE;
+
+ if (!error && ip_str) {
+ struct in_addr ip;
+
+ if (inet_aton (ip_str, &ip))
+ nm_ip4_config_set_address (sys_data->config, ip.s_addr);
+ else
+ error = TRUE;
+ }
+
+ if (!error && netmask_str) {
+ guint32 netmask;
+
+ if (parse_netmask (netmask_str, &netmask))
+ nm_ip4_config_set_netmask (sys_data->config, netmask);
+ else
+ error = TRUE;
+ }
+
+ g_strfreev (pieces);
free (buf);
}
else
@@ -696,7 +755,8 @@ found:
if ((buf = svGetValue (file, "NETMASK")))
{
- nm_ip4_config_set_netmask (sys_data->config, inet_addr (buf));
+ if (nm_ip4_config_get_netmask (sys_data->config) == 0)
+ nm_ip4_config_set_netmask (sys_data->config, inet_addr (buf));
free (buf);
}
else
Index: NetworkManager-0.6.5/gnome/vpn-properties/nm-vpn-properties.c
===================================================================
--- NetworkManager-0.6.5.orig/gnome/vpn-properties/nm-vpn-properties.c
+++ NetworkManager-0.6.5/gnome/vpn-properties/nm-vpn-properties.c
@@ -39,6 +39,7 @@
#include <gtk/gtkwindow.h>
#include <glade/glade.h>
#include <gconf/gconf-client.h>
+#include <libgnomeui/libgnomeui.h>
#include <glib/gi18n.h>
#define NM_VPN_API_SUBJECT_TO_CHANGE
Index: NetworkManager-0.6.5/gnome/vpn-properties/Makefile.am
===================================================================
--- NetworkManager-0.6.5.orig/gnome/vpn-properties/Makefile.am
+++ NetworkManager-0.6.5/gnome/vpn-properties/Makefile.am
@@ -26,7 +26,6 @@ nm_vpn_properties_CFLAGS =
-DGLADEDIR=\""$(gladedir)"\" \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
- -DGNOME_DISABLE_DEPRECATED \
-DGNOMELOCALEDIR=\"$(datadir)/locale\" \
-DVERSION=\"$(VERSION)\" \
$(NULL)
++++++ nm-applet-0.6.5-build.patch ++++++
--- NetworkManager-0.6.5/nm-applet-0.6.5/src/Makefile.am.buildfix 2007-02-02 10:53:26.000000000 -0500
+++ NetworkManager-0.6.5/nm-applet-0.6.5/src/Makefile.am 2007-03-15 14:20:32.000000000 -0400
@@ -2,6 +2,9 @@
bin_PROGRAMS = nm-applet
+INCLUDES = -I${top_srcdir}/../include \
+ -I${top_srcdir}/../libnm-util
+
nm_applet_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
@@ -12,7 +15,6 @@
$(GCONF_CFLAGS) \
$(LIBGNOMEUI_CFLAGS) \
$(GNOME_KEYRING_CFLAGS) \
- $(NM_CFLAGS) \
-DICONDIR=\""$(datadir)/icons"\" \
-DGLADEDIR=\""$(gladedir)"\" \
-DBINDIR=\""$(bindir)"\" \
@@ -112,7 +114,7 @@
$(GCONF_LIBS) \
$(LIBGNOMEUI_LIBS) \
$(GNOME_KEYRING_LIBS) \
- $(NM_LIBS) \
+ -L${top_srcdir}/../libnm-util $(top_builddir)/../libnm-util/libnm-util.la \
$(NULL)
if WITH_NOTIFY
--- NetworkManager-0.6.5/nm-applet-0.6.5/configure.ac.buildfix 2007-03-15 11:51:49.000000000 -0400
+++ NetworkManager-0.6.5/nm-applet-0.6.5/configure.ac 2007-03-15 16:33:34.000000000 -0400
@@ -18,10 +18,10 @@
dnl This doesn't depend on gnome support, only on gnome-common, autogen already
dnl uses gnome-autogen
dnl
-GNOME_COMMON_INIT
-GNOME_DEBUG_CHECK
-GNOME_COMPILE_WARNINGS([maximum])
-GNOME_MAINTAINER_MODE_DEFINES
+dnl GNOME_COMMON_INIT
+dnl GNOME_DEBUG_CHECK
+dnl GNOME_COMPILE_WARNINGS([maximum])
+dnl GNOME_MAINTAINER_MODE_DEFINES
dnl
dnl Required headers
@@ -112,10 +112,6 @@
AC_SUBST(GOBJECT_CFLAGS)
AC_SUBST(GOBJECT_LIBS)
-PKG_CHECK_MODULES(NM, NetworkManager)
-AC_SUBST(NM_CFLAGS)
-AC_SUBST(NM_LIBS)
-
AC_ARG_WITH(notify, AC_HELP_STRING([--with-notify], [Use libnotify]), enable_notify=$withval, enable_notify=auto)
PKG_CHECK_MODULES(GTK, gtk+-2.0)
++++++ nm-applet-disconnect-on-exit.patch ++++++
Index: nm-applet-0.6.5/src/applet.c
===================================================================
--- nm-applet-0.6.5/src/applet.c.orig
+++ nm-applet-0.6.5/src/applet.c
@@ -1195,6 +1195,48 @@ done:
}
+gboolean nma_get_disconnect_wireless_on_exit (NMApplet *applet)
+{
+ GConfValue *value;
+ gboolean ret = FALSE;
+
+ g_return_val_if_fail (applet != NULL, FALSE);
+ g_return_val_if_fail (applet->gconf_client != NULL, FALSE);
+
+ value = gconf_client_get (applet->gconf_client,
+ GCONF_PATH_PREFS "/disconnect_wireless_on_exit",
+ NULL);
+
+ if (value)
+ {
+ if (value->type == GCONF_VALUE_BOOL)
+ ret = gconf_value_get_bool (value);
+
+ gconf_value_free (value);
+ }
+
+ return ret;
+}
+
+
+void nma_set_disconnect_wireless_on_exit (NMApplet *applet, gboolean disconnect)
+{
+ gboolean current;
+
+ g_return_if_fail (applet != NULL);
+ g_return_if_fail (applet->gconf_client != NULL);
+
+ current = nma_get_disconnect_wireless_on_exit (applet);
+ if (current != disconnect)
+ {
+ gconf_client_set_bool (applet->gconf_client,
+ GCONF_PATH_PREFS "/disconnect_wireless_on_exit",
+ disconnect,
+ NULL);
+ }
+}
+
+
/*
* nma_redraw_timeout
*
@@ -1984,7 +2026,13 @@ static void nma_set_wireless_enabled_cb
state = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget));
if (applet->wireless_enabled != state)
+ {
+ gconf_client_set_bool (applet->gconf_client,
+ GCONF_PATH_PREFS "/wireless_enabled",
+ state,
+ NULL);
nma_dbus_enable_wireless (applet, state);
+ }
}
@@ -1996,7 +2044,13 @@ static void nma_set_networking_enabled_c
state = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget));
if ((applet->nm_state == NM_STATE_ASLEEP && state) || (applet->nm_state != NM_STATE_ASLEEP && !state))
+ {
+ gconf_client_set_bool (applet->gconf_client,
+ GCONF_PATH_PREFS "/networking_enabled",
+ state,
+ NULL);
nma_dbus_enable_networking (applet, state);
+ }
}
@@ -2577,6 +2631,36 @@ static void G_GNUC_NORETURN nma_destroy
}
+static gboolean
+update_network_state (gpointer data)
+{
+ NMApplet *applet = data;
+ GConfValue *value;
+
+ value = gconf_client_get (applet->gconf_client,
+ GCONF_PATH_PREFS "/networking_enabled",
+ NULL);
+ if (value)
+ {
+ if (value->type == GCONF_VALUE_BOOL)
+ nma_dbus_enable_networking (applet, gconf_value_get_bool (value));
+ gconf_value_free (value);
+ }
+
+ value = gconf_client_get (applet->gconf_client,
+ GCONF_PATH_PREFS "/wireless_enabled",
+ NULL);
+ if (value)
+ {
+ if (value->type == GCONF_VALUE_BOOL)
+ nma_dbus_enable_wireless (applet, gconf_value_get_bool (value));
+ gconf_value_free (value);
+ }
+
+ return FALSE;
+}
+
+
/*
* nma_get_instance
*
@@ -2656,6 +2740,11 @@ static GtkWidget * nma_get_instance (NMA
g_signal_connect (applet, "destroy", G_CALLBACK (nma_destroy), NULL);
g_signal_connect (applet, "style-set", G_CALLBACK (nma_theme_change_cb), NULL);
+ g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
+ update_network_state,
+ g_object_ref (applet),
+ (GDestroyNotify) g_object_unref);
+
return GTK_WIDGET (applet);
}
Index: nm-applet-0.6.5/src/applet.h
===================================================================
--- nm-applet-0.6.5/src/applet.h.orig
+++ nm-applet-0.6.5/src/applet.h
@@ -157,6 +157,9 @@ void nma_set_state (NMApplet *ap
void nma_set_running (NMApplet *applet, gboolean running);
void nma_update_state (NMApplet *applet);
+gboolean nma_get_disconnect_wireless_on_exit (NMApplet *applet);
+void nma_set_disconnect_wireless_on_exit (NMApplet *applet, gboolean disconnect);
+
int nm_null_safe_strcmp (const char *s1, const char *s2);
#endif
Index: nm-applet-0.6.5/src/main.c
===================================================================
--- nm-applet-0.6.5/src/main.c.orig
+++ nm-applet-0.6.5/src/main.c
@@ -36,7 +36,14 @@
static void session_die (GnomeClient *client, gpointer client_data)
{
NMApplet *applet = client_data;
+
+ /* Deactivate VPN */
nma_dbus_vpn_deactivate_connection (applet->connection);
+
+ /* Deactivate wireless devices if required */
+ if (nma_get_disconnect_wireless_on_exit (applet))
+ nma_dbus_enable_wireless (applet, FALSE);
+
gtk_main_quit ();
}
++++++ nm-applet-editor.patch ++++++
Index: NetworkManager-0.6.5/nm-applet-0.6.5/configure.ac
===================================================================
--- NetworkManager-0.6.5.orig/nm-applet-0.6.5/configure.ac
+++ NetworkManager-0.6.5/nm-applet-0.6.5/configure.ac
@@ -249,6 +249,7 @@ fi
AC_OUTPUT([
Makefile
src/Makefile
+editor/Makefile
icons/Makefile
po/Makefile.in
])
Index: NetworkManager-0.6.5/nm-applet-0.6.5/Makefile.am
===================================================================
--- NetworkManager-0.6.5.orig/nm-applet-0.6.5/Makefile.am
+++ NetworkManager-0.6.5/nm-applet-0.6.5/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = src icons po
+SUBDIRS = src editor icons po
EXTRA_DIST = \
CONTRIBUTING \
Index: NetworkManager-0.6.5/nm-applet-0.6.5/po/POTFILES.in
===================================================================
--- NetworkManager-0.6.5.orig/nm-applet-0.6.5/po/POTFILES.in
+++ NetworkManager-0.6.5/nm-applet-0.6.5/po/POTFILES.in
@@ -19,3 +19,11 @@ src/wso-wep-hex.c
src/wso-wep-passphrase.c
src/wso-wpa-eap.c
src/wso-wpa-psk.c
+editor/bssid-editor-dialog.c
+editor/editor-app.c
+editor/editor-gconf-helper.c
+editor/editor-keyring-helper.c
+editor/widget-wso-wep.c
+editor/widget-wso-wpa-enterprise.c
+editor/widget-wso-wpa-personal.c
+editor/editor.glade
Index: NetworkManager-0.6.5/nm-applet-0.6.5/src/applet.c
===================================================================
--- NetworkManager-0.6.5.orig/nm-applet-0.6.5/src/applet.c
+++ NetworkManager-0.6.5/nm-applet-0.6.5/src/applet.c
@@ -1614,6 +1614,28 @@ static void nma_menu_add_custom_essid_it
}
+static void edit_essid_items_selected (GtkWidget *menu_item, NMApplet *applet)
+{
+ g_spawn_command_line_async ("nm-editor", NULL);
+}
+
+
+static void nma_menu_add_edit_essid_item (GtkWidget *menu, NMApplet *applet)
+{
+ GtkWidget *menu_item;
+ GtkWidget *label;
+
+ menu_item = gtk_menu_item_new ();
+ label = gtk_label_new_with_mnemonic (_("_Edit Wireless Networks..."));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_container_add (GTK_CONTAINER (menu_item), label);
+ gtk_widget_show_all (menu_item);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect (menu_item, "activate", G_CALLBACK (edit_essid_items_selected), applet);
+}
+
+
+
static void new_network_item_selected (GtkWidget *menu_item, NMApplet *applet)
{
nma_other_network_dialog_run (applet, TRUE);
@@ -2014,6 +2036,7 @@ static void nma_menu_add_devices (GtkWid
nma_menu_add_separator_item (menu);
nma_menu_add_custom_essid_item (menu, applet);
nma_menu_add_create_network_item (menu, applet);
+ nma_menu_add_edit_essid_item (menu, applet);
}
}
Index: NetworkManager-0.6.5/nm-applet-0.6.5/editor/Makefile.am
===================================================================
--- NetworkManager-0.6.5.orig/nm-applet-0.6.5/editor/Makefile.am
+++ NetworkManager-0.6.5/nm-applet-0.6.5/editor/Makefile.am
@@ -1,6 +1,6 @@
NULL=
-INCLUDES = -I${top_srcdir} -I${top_srcdir}/utils -I${top_srcdir}/include -I${top_srcdir}/libnm-util
+INCLUDES = -I${top_srcdir}/../include -I${top_srcdir}/../libnm-util
bin_PROGRAMS = nm-editor
@@ -55,8 +55,8 @@ nm_editor_LDADD = \
$(GCONF_LIBS) \
$(LIBGNOMEUI_LIBS) \
$(GNOME_KEYRING_LIBS) \
- $(top_builddir)/utils/libnmutils.la \
- $(top_builddir)/libnm-util/libnm-util.la \
+ $(top_builddir)/../utils/libnmutils.la \
+ $(top_builddir)/../libnm-util/libnm-util.la \
$(NULL)
Index: NetworkManager-0.6.5/nm-applet-0.6.5/editor/editor-app.c
===================================================================
--- NetworkManager-0.6.5.orig/nm-applet-0.6.5/editor/editor-app.c
+++ NetworkManager-0.6.5/nm-applet-0.6.5/editor/editor-app.c
@@ -197,7 +197,7 @@ gboolean quit_editor(WE_DATA *we_data)
if(we_data != NULL)
{
if(we_data->editor_xml != NULL)
- g_free(we_data->editor_xml);
+ g_object_unref(we_data->editor_xml);
if(we_data->gconf_client != NULL)
g_object_unref(we_data->gconf_client);
if(we_data->glade_file != NULL)
@@ -894,7 +894,7 @@ void update_security_widget(gint option,
if(we_data->sub_xml != NULL)
{
- g_free(we_data->sub_xml);
+ g_object_unref(we_data->sub_xml);
we_data->sub_xml = NULL;
}
++++++ nm-applet-fallback.patch ++++++
Index: nm-applet-0.6.5/src/applet-dbus-devices.c
===================================================================
--- nm-applet-0.6.5/src/applet-dbus-devices.c.orig
+++ nm-applet-0.6.5/src/applet-dbus-devices.c
@@ -1266,7 +1266,7 @@ void nma_dbus_device_remove_one_device (
*
*/
void nma_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid,
- WirelessSecurityOption * opt)
+ gboolean fallback, WirelessSecurityOption * opt)
{
DBusMessage * message;
gboolean success = TRUE;
@@ -1285,6 +1285,7 @@ void nma_dbus_set_device (DBusConnection
/* Build up the required args */
dbus_message_append_args (message, DBUS_TYPE_OBJECT_PATH, &dev_path,
DBUS_TYPE_STRING, &essid,
+ DBUS_TYPE_BOOLEAN, &fallback,
DBUS_TYPE_INVALID);
/* If we have specific wireless security options, add them */
Index: nm-applet-0.6.5/src/applet-dbus-devices.h
===================================================================
--- nm-applet-0.6.5/src/applet-dbus-devices.h.orig
+++ nm-applet-0.6.5/src/applet-dbus-devices.h
@@ -49,7 +49,7 @@ void nma_dbus_device_remove_one_device
void nma_dbus_device_update_one_network (NMApplet *applet, const char *dev_path, const char *net_path, const char *active_net_path);
void nma_dbus_device_remove_one_network (NMApplet *applet, const char *dev_path, const char *net_path);
void nma_dbus_update_strength (NMApplet *applet, const char *dev_path, const char *net_path, int strength);
-void nma_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid, WirelessSecurityOption *opt);
+void nma_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid, gboolean fallback, WirelessSecurityOption *opt);
void nma_dbus_create_network (DBusConnection *connection, NetworkDevice *dev, const char *essid, WirelessSecurityOption *opt);
void nma_free_data_model (NMApplet *applet);
Index: nm-applet-0.6.5/src/applet-dbus-info.c
===================================================================
--- nm-applet-0.6.5/src/applet-dbus-info.c.orig
+++ nm-applet-0.6.5/src/applet-dbus-info.c
@@ -428,7 +428,7 @@ nmi_dbus_get_network_properties (DBusCon
char * escaped_network = NULL;
char * essid = NULL;
gint timestamp = -1;
- gboolean trusted = FALSE;
+ gboolean fallback = FALSE;
DBusMessageIter iter, array_iter;
GConfClient * client;
NMGConfWSO * gconf_wso;
@@ -468,9 +468,9 @@ nmi_dbus_get_network_properties (DBusCon
if (!nm_gconf_get_int_helper (client, GCONF_PATH_WIRELESS_NETWORKS, "timestamp", escaped_network, ×tamp) || (timestamp < 0))
timestamp = 0;
- /* Trusted status */
- if (!nm_gconf_get_bool_helper (client, GCONF_PATH_WIRELESS_NETWORKS, "trusted", escaped_network, &trusted))
- trusted = FALSE;
+ /* Fallback status */
+ if (!nm_gconf_get_bool_helper (client, GCONF_PATH_WIRELESS_NETWORKS, "fallback", escaped_network, &fallback))
+ fallback = FALSE;
/* Grab the list of stored access point BSSIDs */
gconf_key = g_strdup_printf ("%s/%s/bssids", GCONF_PATH_WIRELESS_NETWORKS, escaped_network);
@@ -501,8 +501,8 @@ nmi_dbus_get_network_properties (DBusCon
/* Second arg: Timestamp (INT32) */
dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, ×tamp);
- /* Third arg: Trusted (BOOLEAN) */
- dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &trusted);
+ /* Third arg: Fallback? (BOOLEAN) */
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &fallback);
/* Fourth arg: List of AP BSSIDs (ARRAY, STRING) */
dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING_AS_STRING, &array_iter);
@@ -861,12 +861,14 @@ static void
nmi_save_network_info (NMApplet *applet,
const char *essid,
gboolean automatic,
+ gboolean fallback,
const char *bssid,
NMGConfWSO * gconf_wso)
{
- char * key;
- GConfEntry * gconf_entry;
- char * escaped_network;
+ char * key;
+ GConfEntry * gconf_entry;
+ char * escaped_network;
+ GConfValue * value;
g_return_if_fail (applet != NULL);
g_return_if_fail (essid != NULL);
@@ -897,9 +899,18 @@ nmi_save_network_info (NMApplet *applet,
g_free (key);
}
+ /*
+ * XXX: We don't want to move a network from fallback to non-fallback because the user
+ * connected via other means. We need a better way to do this.
+ */
+ key = g_strdup_printf ("%s/%s/fallback", GCONF_PATH_WIRELESS_NETWORKS, escaped_network);
+ value = gconf_client_get (applet->gconf_client, key, NULL);
+ if (!value || value->type != GCONF_VALUE_BOOL || (!gconf_value_get_bool (value) && fallback))
+ gconf_client_set_bool (applet->gconf_client, key, fallback, NULL);
+ g_free (key);
+
if (bssid && (strlen (bssid) >= 11))
{
- GConfValue * value;
GSList * new_bssid_list = NULL;
gboolean found = FALSE;
@@ -994,6 +1005,7 @@ nmi_dbus_update_network_info (DBusConnec
NMApplet * applet = (NMApplet *) user_data;
char * essid = NULL;
gboolean automatic;
+ gboolean fallback;
NMGConfWSO * gconf_wso = NULL;
DBusMessageIter iter;
char * bssid;
@@ -1024,7 +1036,15 @@ nmi_dbus_update_network_info (DBusConnec
}
dbus_message_iter_get_basic (&iter, &automatic);
- /* Third argument: Access point's BSSID */
+ /* Third argument: Fallback? (BOOLEAN) */
+ if (!dbus_message_iter_next (&iter) || (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_BOOLEAN))
+ {
+ nm_warning ("%s:%d - message argument 'fallback' was invalid.", __FILE__, __LINE__);
+ goto out;
+ }
+ dbus_message_iter_get_basic (&iter, &fallback);
+
+ /* Fourth argument: Access point's BSSID */
if (!dbus_message_iter_next (&iter) || (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING))
{
nm_warning ("%s:%d - message argument 'bssid' was invalid.", __FILE__, __LINE__);
@@ -1042,7 +1062,7 @@ nmi_dbus_update_network_info (DBusConnec
goto out;
}
- nmi_save_network_info (applet, essid, automatic, bssid, gconf_wso);
+ nmi_save_network_info (applet, essid, automatic, fallback, bssid, gconf_wso);
g_object_unref (G_OBJECT (gconf_wso));
out:
Index: nm-applet-0.6.5/src/applet.c
===================================================================
--- nm-applet-0.6.5/src/applet.c.orig
+++ nm-applet-0.6.5/src/applet.c
@@ -1352,7 +1352,7 @@ static void nma_menu_item_activate (GtkM
if ((tag = g_object_get_data (G_OBJECT (item), "network")))
net = network_device_get_wireless_network_by_essid (dev, tag);
- nma_dbus_set_device (applet->connection, dev, net ? wireless_network_get_essid (net) : NULL, NULL);
+ nma_dbus_set_device (applet->connection, dev, net ? wireless_network_get_essid (net) : NULL, FALSE, NULL);
network_device_unref (dev);
nmi_dbus_signal_user_interface_activated (applet->connection);
Index: nm-applet-0.6.5/src/applet.glade
===================================================================
--- nm-applet-0.6.5/src/applet.glade.orig
+++ nm-applet-0.6.5/src/applet.glade
@@ -426,7 +426,7 @@ You have chosen to log in to the wireles
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="n_rows">4</property>
+ <property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@@ -548,8 +548,8 @@ You have chosen to log in to the wireles
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@@ -569,8 +569,8 @@ WEP 64/128-bit ASCII
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
@@ -589,9 +589,31 @@ WEP 64/128-bit ASCII
<packing>
<property name="left_attach">0</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="fallback_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Fallback on this Network</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">fill</property>
+ <property name="y_options"></property>
</packing>
</child>
</widget>
Index: nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.c
===================================================================
--- nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.c.orig
+++ nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.c
@@ -346,3 +346,80 @@ nm_gconf_wso_wpa_eap_get_type (void)
}
return type;
}
+
+typedef struct {
+ GtkComboBox *combo;
+ gint value;
+} ComboSelectInfo;
+
+static gboolean
+combo_select (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data)
+{
+ ComboSelectInfo *info = user_data;
+ GValue val = { 0, };
+ gint i;
+
+ gtk_tree_model_get_value (model, iter, 1, &val);
+ i = g_value_get_int (&val);
+
+ if (i == info->value) {
+ gtk_combo_box_set_active_iter (info->combo, iter);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/* Ugh. Please avert your eyes. */
+void
+nm_gconf_wpa_eap_populate_dialog (NMGConfWSOWPA_EAP *wso, GladeXML *xml)
+{
+ GtkWidget *widget;
+ GtkTreeModel *model;
+ ComboSelectInfo info;
+
+ g_return_if_fail (wso != NULL);
+ g_return_if_fail (xml != NULL);
+
+ if (wso->priv->identity != NULL) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_identity_entry");
+ gtk_entry_set_text (GTK_ENTRY (widget), wso->priv->identity);
+ }
+
+ if (wso->priv->passwd != NULL) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_passwd_entry");
+ gtk_entry_set_text (GTK_ENTRY (widget), wso->priv->passwd);
+ }
+
+ if (wso->priv->anon_identity != NULL) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_anon_identity_entry");
+ gtk_entry_set_text (GTK_ENTRY (widget), wso->priv->anon_identity);
+ }
+
+ widget = glade_xml_get_widget (xml, "wpa_eap_eap_method_combo");
+ info.combo = GTK_COMBO_BOX (widget);
+ info.value = wso->priv->eap_method;
+ gtk_tree_model_foreach (gtk_combo_box_get_model (info.combo),
+ combo_select, &info);
+
+ widget = glade_xml_get_widget (xml, "wpa_eap_key_type_combo");
+ info.combo = GTK_COMBO_BOX (widget);
+ info.value = wso->priv->key_type;
+ gtk_tree_model_foreach (gtk_combo_box_get_model (info.combo),
+ combo_select, &info);
+
+ if (wso->priv->client_cert_file != NULL && g_file_test (wso->priv->client_cert_file, G_FILE_TEST_EXISTS)) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_client_cert_file_chooser_button");
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), wso->priv->client_cert_file);
+ }
+
+ if (wso->priv->ca_cert_file != NULL && g_file_test (wso->priv->ca_cert_file, G_FILE_TEST_EXISTS)) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_ca_cert_file_chooser_button");
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), wso->priv->ca_cert_file);
+ }
+
+ if (wso->priv->private_key_file != NULL && g_file_test (wso->priv->private_key_file, G_FILE_TEST_EXISTS)) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_private_key_file_chooser_button");
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), wso->priv->private_key_file);
+ }
+}
Index: nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.h
===================================================================
--- nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.h.orig
+++ nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.h
@@ -59,4 +59,7 @@ NMGConfWSOWPA_EAP * nm_gconf_wso_wpa_eap
NMGConfWSOWPA_EAP * nm_gconf_wso_wpa_eap_new_deserialize_gconf (GConfClient *client, const char *network, int we_cipher);
+/* Ugh. Please avert your eyes. */
+void nm_gconf_wpa_eap_populate_dialog (NMGConfWSOWPA_EAP *wso, GladeXML *xml);
+
#endif /* NM_GCONF_WSO_WPA_EAP_H */
Index: nm-applet-0.6.5/src/other-network-dialog.c
===================================================================
--- nm-applet-0.6.5/src/other-network-dialog.c.orig
+++ nm-applet-0.6.5/src/other-network-dialog.c
@@ -410,19 +410,24 @@ static void nma_ond_response_cb (GtkDial
WirelessSecurityOption * opt;
GtkComboBox * security_combo;
GtkTreeIter iter;
+ GtkWidget * fallback_button;
char * str;
NetworkDevice * dev;
+ gboolean fallback;
gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter);
gtk_tree_model_get (model, &iter, NAME_COLUMN, &str, DEV_COLUMN, &dev, -1);
+ fallback_button = glade_xml_get_widget (xml, "fallback_button");
+ fallback = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (fallback_button));
+
security_combo = GTK_COMBO_BOX (glade_xml_get_widget (xml, "security_combo"));
opt = wsm_get_option_for_active (wsm, security_combo);
if (create_network)
nma_dbus_create_network (applet->connection, dev, essid, opt);
else
- nma_dbus_set_device (applet->connection, dev, essid, opt);
+ nma_dbus_set_device (applet->connection, dev, essid, fallback, opt);
}
}
Index: nm-applet-0.6.5/src/passphrase-dialog.c
===================================================================
--- nm-applet-0.6.5/src/passphrase-dialog.c.orig
+++ nm-applet-0.6.5/src/passphrase-dialog.c
@@ -37,6 +37,9 @@
#include "NetworkManager.h"
#include "wireless-security-manager.h"
+#include "nm-gconf-wso-wpa-eap.h"
+#include "wso-private.h"
+
static GladeXML *get_dialog_xml (GtkWidget *dialog)
{
g_return_val_if_fail (dialog != NULL, NULL);
@@ -269,6 +272,24 @@ nmi_passphrase_dialog_new (NMApplet *app
g_signal_connect (G_OBJECT (dialog), "response", GTK_SIGNAL_FUNC (nmi_passphrase_dialog_response_received), dialog);
+ /* Ugh. Avert your eyes, please. */
+ {
+ /* Pre-populate the dialog if we have information about this network. */
+ NMGConfWSO *wso;
+ const char *essid;
+ char *escaped_network;
+
+ essid = wireless_network_get_essid (net);
+ escaped_network = gconf_escape_key (essid, strlen (essid));
+ wso = nm_gconf_wso_new_deserialize_gconf (applet->gconf_client, escaped_network);
+ g_free (escaped_network);
+
+ if (wso != NULL && NM_IS_GCONF_WSO_WPA_EAP (wso)) {
+ WirelessSecurityOption *wso_widget = wsm_get_option_for_active (wsm, GTK_COMBO_BOX (security_combo));
+ nm_gconf_wpa_eap_populate_dialog (NM_GCONF_WSO_WPA_EAP (wso), wso_widget->uixml);
+ }
+ }
+
/* Bash focus-stealing prevention in the face */
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ALWAYS);
gtk_widget_realize (dialog);
++++++ nm-configure-networking-rml.patch ++++++
Index: nm-applet-0.6.5/src/applet.c
===================================================================
--- nm-applet-0.6.5/src/applet.c.orig
+++ nm-applet-0.6.5/src/applet.c
@@ -273,16 +273,43 @@ static gboolean nma_update_info (NMApple
return TRUE;
}
-static void nma_show_info_cb (GtkMenuItem *mi, NMApplet *applet)
+
+static gboolean nma_run_yast (GtkWidget *info_dialog)
{
- GtkWidget *info_dialog;
+ char *argv[] = { "/usr/bin/gnomesu", "/sbin/yast2", "lan", NULL };
+ GError *err = NULL;
- info_dialog = glade_xml_get_widget (applet->info_dialog_xml, "info_dialog");
+ if (!g_spawn_async ("/", argv, NULL, 0, NULL, NULL, NULL, &err))
+ {
+ GtkWidget *dialog;
+ char *msg;
+
+ msg = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s",
+ _("Network configuration could not be run"), err->message);
+
+ dialog = gtk_message_dialog_new_with_markup (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, msg);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ gtk_widget_destroy (dialog);
+ g_free (msg);
+ g_error_free (err);
+ }
+
+ gtk_widget_hide (info_dialog);
+ return FALSE;
+}
+
+
+static void nma_show_info_cb (GtkMenuItem *mi, NMApplet *applet)
+{
if (nma_update_info (applet))
{
+ GtkWidget * info_dialog;
+
+ info_dialog = glade_xml_get_widget (applet->info_dialog_xml, "info_dialog");
+
gtk_window_present (GTK_WINDOW (info_dialog));
- g_signal_connect_swapped (info_dialog, "response", G_CALLBACK (gtk_widget_hide), info_dialog);
}
}
@@ -1742,10 +1769,42 @@ static void nma_menu_add_vpn_menu (GtkWi
}
+static void nma_config_dialup_cb (GtkMenu *item, gpointer data)
+{
+ char *modem_argv[] = { "/usr/bin/gnomesu", "/sbin/yast2", "modem", NULL };
+ char *isdn_argv[] = { "/usr/bin/gnomesu", "/sbin/yast2", "isdn", NULL };
+ char **argv;
+ gboolean modem = (gboolean) data;
+ GError *err = NULL;
+
+ if (modem)
+ argv = modem_argv;
+ else
+ argv = isdn_argv;
+
+ if (!g_spawn_async ("/", argv, NULL, 0, NULL, NULL, NULL, &err))
+ {
+ GtkWidget *dialog;
+ char *msg;
+
+ msg = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s",
+ _("Dialup configuration could not be run"), err->message);
+
+ dialog = gtk_message_dialog_new_with_markup (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, msg);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ gtk_widget_destroy (dialog);
+ g_free (msg);
+ g_error_free (err);
+ }
+}
+
+
static void nma_menu_add_dialup_menu (GtkWidget *menu, NMApplet *applet)
{
GtkMenuItem *item;
GtkMenu *dialup_menu;
+ GtkWidget *configure_item;
GSList *elt;
g_return_if_fail (menu != NULL);
@@ -1777,6 +1836,14 @@ static void nma_menu_add_dialup_menu (Gt
gtk_menu_shell_append (GTK_MENU_SHELL (dialup_menu), GTK_WIDGET (disconnect_item));
}
+ configure_item = gtk_menu_item_new_with_mnemonic (_("Configure _Modem..."));
+ g_signal_connect (G_OBJECT (configure_item), "activate", G_CALLBACK (nma_config_dialup_cb), (gpointer) 1);
+ gtk_menu_shell_append (GTK_MENU_SHELL (dialup_menu), configure_item);
+
+ configure_item = gtk_menu_item_new_with_mnemonic (_("Configure _ISDN..."));
+ g_signal_connect (G_OBJECT (configure_item), "activate", G_CALLBACK (nma_config_dialup_cb), (gpointer) 0);
+ gtk_menu_shell_append (GTK_MENU_SHELL (dialup_menu), configure_item);
+
gtk_menu_item_set_submenu (item, GTK_WIDGET (dialup_menu));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), GTK_WIDGET (item));
gtk_widget_show_all (GTK_WIDGET (item));
@@ -2518,6 +2585,9 @@ static void G_GNUC_NORETURN nma_destroy
*/
static GtkWidget * nma_get_instance (NMApplet *applet)
{
+ GtkWidget * widget;
+ GtkWidget * info_dialog;
+
gtk_widget_hide (GTK_WIDGET (applet));
applet->nm_running = FALSE;
@@ -2545,6 +2615,15 @@ static GtkWidget * nma_get_instance (NMA
}
applet->info_dialog_xml = glade_xml_new (applet->glade_file, "info_dialog", NULL);
+ info_dialog = glade_xml_get_widget (applet->info_dialog_xml, "info_dialog");
+
+ widget = glade_xml_get_widget (applet->info_dialog_xml, "configure_button");
+ g_signal_connect_swapped (widget, "clicked", G_CALLBACK (nma_run_yast), info_dialog);
+
+ widget = glade_xml_get_widget (applet->info_dialog_xml, "closebutton1");
+ g_signal_connect_swapped (widget, "clicked", G_CALLBACK (gtk_widget_hide), info_dialog);
+
+ g_signal_connect_swapped (info_dialog, "delete_event", G_CALLBACK (gtk_widget_hide_on_delete), info_dialog);
applet->gconf_client = gconf_client_get_default ();
if (!applet->gconf_client)
Index: nm-applet-0.6.5/src/applet.glade
===================================================================
--- nm-applet-0.6.5/src/applet.glade.orig
+++ nm-applet-0.6.5/src/applet.glade
@@ -855,24 +855,9 @@ WEP 64/128-bit ASCII
<property name="spacing">6</property>
<child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <widget class="GtkHButtonBox" id="hbuttonbox2">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="closebutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-7</property>
- </widget>
- </child>
</widget>
<packing>
<property name="padding">0</property>
@@ -927,7 +912,7 @@ WEP 64/128-bit ASCII
<widget class="GtkTable" id="table1">
<property name="border_width">1</property>
<property name="visible">True</property>
- <property name="n_rows">14</property>
+ <property name="n_rows">16</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@@ -1696,6 +1681,165 @@ WEP 64/128-bit ASCII
<property name="y_options"></property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkButton" id="closebutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="has_focus">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">15</property>
+ <property name="bottom_attach">16</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="configure_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox8">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="stock">gtk-properties</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label34">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Configure _Networking</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">15</property>
+ <property name="bottom_attach">16</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label35">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">14</property>
+ <property name="bottom_attach">15</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label36">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">14</property>
+ <property name="bottom_attach">15</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
++++++ nm-fallback.patch ++++++
Index: NetworkManager-0.6.5/src/NetworkManagerAP.c
===================================================================
--- NetworkManager-0.6.5.orig/src/NetworkManagerAP.c
+++ NetworkManager-0.6.5/src/NetworkManagerAP.c
@@ -56,7 +56,7 @@ struct NMAccessPoint
GTimeVal last_seen; /* Last time the AP was seen in a scan */
/* Things from user prefs/NetworkManagerInfo */
- gboolean trusted;
+ gboolean fallback;
NMAPSecurity * security;
GTimeVal timestamp;
GSList * user_addresses;
@@ -403,21 +403,21 @@ void nm_ap_set_invalid (NMAccessPoint *a
/*
* Get/Set functions to indicate that an access point is
- * 'trusted'
+ * 'fallback'
*
*/
-gboolean nm_ap_get_trusted (const NMAccessPoint *ap)
+gboolean nm_ap_get_fallback (const NMAccessPoint *ap)
{
g_return_val_if_fail (ap != NULL, FALSE);
- return (ap->trusted);
+ return (ap->fallback);
}
-void nm_ap_set_trusted (NMAccessPoint *ap, gboolean trusted)
+void nm_ap_set_fallback (NMAccessPoint *ap, gboolean fallback)
{
g_return_if_fail (ap != NULL);
- ap->trusted = trusted;
+ ap->fallback = fallback;
}
Index: NetworkManager-0.6.5/src/NetworkManagerAP.h
===================================================================
--- NetworkManager-0.6.5.orig/src/NetworkManagerAP.h
+++ NetworkManager-0.6.5/src/NetworkManagerAP.h
@@ -72,8 +72,8 @@ void nm_ap_set_rate (NMAccessPoint
gboolean nm_ap_get_invalid (const NMAccessPoint *ap);
void nm_ap_set_invalid (NMAccessPoint *ap, gboolean invalid);
-gboolean nm_ap_get_trusted (const NMAccessPoint *ap);
-void nm_ap_set_trusted (NMAccessPoint *ap, gboolean trusted);
+gboolean nm_ap_get_fallback (const NMAccessPoint *ap);
+void nm_ap_set_fallback (NMAccessPoint *ap, gboolean fallback);
gboolean nm_ap_get_artificial (const NMAccessPoint *ap);
void nm_ap_set_artificial (NMAccessPoint *ap, gboolean artificial);
Index: NetworkManager-0.6.5/src/NetworkManagerAPList.c
===================================================================
--- NetworkManager-0.6.5.orig/src/NetworkManagerAPList.c
+++ NetworkManager-0.6.5/src/NetworkManagerAPList.c
@@ -422,6 +422,63 @@ NMAccessPoint *nm_ap_list_get_ap_by_addr
return (found_ap);
}
+/*
+ * nm_ap_list_merge_fallback
+ *
+ * Merges the user's fallback networks, if any, into the scan list. We "fall back"
+ * on these networks and attempt a brute-force connection, given no better options.
+ */
+void nm_ap_list_merge_fallback (NMDevice80211Wireless *dev)
+{
+ NMAccessPointList * allowed_list;
+ NMAccessPointList * scan_list;
+ NMAPListIter * iter;
+ NMData * app_data;
+
+ app_data = nm_device_get_app_data (NM_DEVICE (dev));
+ allowed_list = app_data->allowed_ap_list;
+ scan_list = nm_device_802_11_wireless_ap_list_get (dev);
+
+ iter = nm_ap_list_iter_new (allowed_list);
+ if (iter)
+ {
+ NMAccessPoint * allowed_ap;
+
+ while ((allowed_ap = nm_ap_list_iter_next (iter)))
+ {
+ if (nm_ap_get_fallback (allowed_ap))
+ {
+ NMAccessPoint * ap;
+ GTimeVal cur_time;
+ NMAPSecurity * allowed_security;
+
+ ap = nm_ap_new ();
+ nm_ap_set_essid (ap, nm_ap_get_essid (allowed_ap));
+ nm_ap_set_timestamp_via_timestamp (ap, nm_ap_get_timestamp (allowed_ap));
+ nm_ap_set_fallback (ap, TRUE);
+
+ allowed_security = nm_ap_get_security (allowed_ap);
+ nm_ap_set_security (ap, allowed_security);
+ nm_ap_set_capabilities (ap, nm_ap_security_get_default_capabilities (allowed_security));
+ nm_ap_add_capabilities_from_security (ap, allowed_security);
+
+ /*
+ * Fake it as if we see the AP right now. We process the scan results _after_ this, thus
+ * if the AP is seen in a scan we will favor that AP when we merge.
+ * XXX: Temporarily doing this _after_ the scan results.
+ */
+ g_get_current_time (&cur_time);
+ nm_ap_set_last_seen (ap, &cur_time);
+ nm_ap_set_artificial (ap, TRUE);
+ nm_ap_set_broadcast (ap, FALSE);
+
+ nm_ap_list_merge_scanned_ap (dev, scan_list, ap);
+ nm_ap_unref (ap);
+ }
+ }
+ nm_ap_list_iter_free (iter);
+ }
+}
/*
* nm_ap_list_merge_scanned_ap
Index: NetworkManager-0.6.5/src/NetworkManagerAPList.h
===================================================================
--- NetworkManager-0.6.5.orig/src/NetworkManagerAPList.h
+++ NetworkManager-0.6.5/src/NetworkManagerAPList.h
@@ -51,6 +51,8 @@ void nm_ap_list_copy_properties (NMA
void nm_ap_list_copy_essids_by_address (NMData *app_data, NMDevice80211Wireless *dev, NMAccessPointList *dest, NMAccessPointList *source);
void nm_ap_list_copy_one_essid_by_address (NMData *app_data, NMDevice80211Wireless *dev, NMAccessPoint *ap, NMAccessPointList *search_list);
+void nm_ap_list_merge_fallback (NMDevice80211Wireless *dev);
+
gboolean nm_ap_list_merge_scanned_ap (NMDevice80211Wireless *dev, NMAccessPointList *list, NMAccessPoint *merge_ap);
NMNetworkType nm_ap_list_get_type (NMAccessPointList *list);
Index: NetworkManager-0.6.5/src/backends/NetworkManagerSuSE.c
===================================================================
--- NetworkManager-0.6.5.orig/src/backends/NetworkManagerSuSE.c
+++ NetworkManager-0.6.5/src/backends/NetworkManagerSuSE.c
@@ -527,11 +527,10 @@ found:
NMAccessPoint * list_ap;
char * key;
char * mode;
+ gboolean success = FALSE;
ap = nm_ap_new ();
nm_ap_set_essid (ap, buf);
- nm_ap_set_timestamp (ap, time (NULL), 0);
- nm_ap_set_trusted (ap, TRUE);
if ((mode = svGetValue (file, "WIRELESS_AUTH_MODE")) && !strcmp (mode, "psk"))
{
@@ -549,11 +548,16 @@ found:
{
nm_ap_security_set_key (NM_AP_SECURITY (security), hash, strlen (hash));
nm_ap_set_security (ap, NM_AP_SECURITY (security));
+ success = TRUE;
}
+ else
+ nm_warning ("Ignoring ESSID '%s' (invalid PSK key).", nm_ap_get_orig_essid (ap));
ieee_802_11_cipher_unref (cipher);
g_object_unref (G_OBJECT (security));
}
+ else
+ nm_warning ("Ignoring ESSID '%s' (PSK mode but no key provided).", nm_ap_get_orig_essid (ap));
}
else if ((key = svGetValue (file, "WIRELESS_KEY_0")) && strlen (key) > 3)
{
@@ -612,7 +616,10 @@ found:
{
nm_ap_security_set_key (NM_AP_SECURITY (security), hash, strlen (hash));
nm_ap_set_security (ap, NM_AP_SECURITY (security));
+ success = TRUE;
}
+ else
+ nm_warning ("Ignoring ESSID '%s' (invalid WEP key).", nm_ap_get_orig_essid (ap));
ieee_802_11_cipher_unref (cipher);
g_object_unref (G_OBJECT (security));
@@ -626,26 +633,32 @@ found:
security = nm_ap_security_new (IW_AUTH_CIPHER_NONE);
nm_ap_set_security (ap, security);
g_object_unref (G_OBJECT (security));
+ success = TRUE;
}
- if ((list_ap = nm_ap_list_get_ap_by_essid (app_data->allowed_ap_list, buf)))
- {
- nm_ap_set_essid (list_ap, nm_ap_get_essid (ap));
- nm_ap_set_timestamp_via_timestamp (list_ap, nm_ap_get_timestamp (ap));
- nm_ap_set_trusted (list_ap, nm_ap_get_trusted (ap));
- nm_ap_set_security (list_ap, nm_ap_get_security (ap));
- }
- else
+ if (success)
{
- /* New AP, just add it to the list */
- nm_ap_list_append_ap (app_data->allowed_ap_list, ap);
- }
- nm_ap_unref (ap);
+ if ((list_ap = nm_ap_list_get_ap_by_essid (app_data->allowed_ap_list, buf)))
+ {
+ nm_ap_set_essid (list_ap, nm_ap_get_essid (ap));
+ nm_ap_set_timestamp_via_timestamp (list_ap, nm_ap_get_timestamp (ap));
+ nm_ap_set_security (list_ap, nm_ap_get_security (ap));
+ }
+ else
+ {
+ nm_ap_set_timestamp (ap, time (NULL), 0);
+
+ /* New AP, just add it to the list */
+ nm_ap_list_append_ap (app_data->allowed_ap_list, ap);
+ }
+
+ nm_debug ("Adding '%s' to the list of trusted networks", buf);
- nm_debug ("Adding '%s' to the list of trusted networks", buf);
+ /* Ensure all devices get new information copied into their device lists */
+ nm_policy_schedule_device_ap_lists_update_from_allowed (app_data);
+ }
- /* Ensure all devices get new information copied into their device lists */
- nm_policy_schedule_device_ap_lists_update_from_allowed (app_data);
+ nm_ap_unref (ap);
free (key);
free (mode);
Index: NetworkManager-0.6.5/src/nm-dbus-nm.c
===================================================================
--- NetworkManager-0.6.5.orig/src/nm-dbus-nm.c
+++ NetworkManager-0.6.5/src/nm-dbus-nm.c
@@ -262,6 +262,7 @@ static DBusMessage *nm_dbus_nm_set_activ
{
NMAPSecurity * security = NULL;
char * essid = NULL;
+ gboolean fallback = FALSE;
if (!dbus_message_iter_next (&iter) || (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING))
{
@@ -277,6 +278,15 @@ static DBusMessage *nm_dbus_nm_set_activ
goto out;
}
+ if (!dbus_message_iter_next (&iter) || (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_BOOLEAN))
+ {
+ nm_warning ("Invalid argument type (fallback");
+ goto out;
+ }
+
+ /* grab the fallback bit */
+ dbus_message_iter_get_basic (&iter, &fallback);
+
/* If there's security information, we use that. If not, we
* make some up from the scan list.
*/
@@ -293,6 +303,7 @@ static DBusMessage *nm_dbus_nm_set_activ
/* Set up the wireless-specific activation request properties */
ap = nm_device_802_11_wireless_get_activation_ap (NM_DEVICE_802_11_WIRELESS (dev), essid, security);
+ nm_ap_set_fallback (ap, fallback);
if (security)
g_object_unref (G_OBJECT (security));
Index: NetworkManager-0.6.5/src/nm-dbus-nmi.c
===================================================================
--- NetworkManager-0.6.5.orig/src/nm-dbus-nmi.c
+++ NetworkManager-0.6.5/src/nm-dbus-nmi.c
@@ -229,6 +229,7 @@ gboolean nm_dbus_update_network_info (DB
{
DBusMessage * message;
gboolean success = FALSE;
+ gboolean fallback;
const char * essid;
gchar * char_bssid;
NMAPSecurity * security;
@@ -251,10 +252,14 @@ gboolean nm_dbus_update_network_info (DB
/* First argument: ESSID (STRING) */
dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &essid);
- /* Second argument: Automatic (BOOLEAN) */
+ /* Second argument: Automatic or user-driven connection? (BOOLEAN) */
dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &automatic);
- /* Third argument: Access point's BSSID */
+ /* Third argument: Fallback? (BOOLEAN) */
+ fallback = nm_ap_get_fallback (ap);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &fallback);
+
+ /* Fourth argument: Access point's BSSID */
addr = nm_ap_get_address (ap);
if ((nm_ap_get_mode (ap) == IW_MODE_INFRA) && nm_ethernet_address_is_valid (addr))
{
@@ -345,7 +350,7 @@ static void nm_dbus_get_network_data_cb
DBusMessageIter subiter;
const char * essid = NULL;
gint timestamp_secs = -1;
- gboolean trusted = FALSE;
+ gboolean fallback = FALSE;
GSList * addr_list = NULL;
NMAPSecurity * security;
NMAccessPoint * ap;
@@ -396,14 +401,14 @@ static void nm_dbus_get_network_data_cb
}
dbus_message_iter_get_basic (&iter, ×tamp_secs);
- /* Third arg: Trusted (BOOLEAN) */
+ /* Third arg: Fallback? (BOOLEAN) */
if (!dbus_message_iter_next (&iter)
|| (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_BOOLEAN))
{
- nm_warning ("a message argument (trusted) was invalid.");
+ nm_warning ("a message argument (fallback) was invalid.");
goto out;
}
- dbus_message_iter_get_basic (&iter, &trusted);
+ dbus_message_iter_get_basic (&iter, &fallback);
/* Fourth arg: BSSID addresses (ARRAY, STRING) */
if (!dbus_message_iter_next (&iter)
@@ -442,11 +447,12 @@ static void nm_dbus_get_network_data_cb
ap = nm_ap_new ();
nm_ap_set_essid (ap, essid);
nm_ap_set_security (ap, security);
+ nm_ap_add_capabilities_from_security (ap, security);
g_object_unref (G_OBJECT (security)); /* set_security copies the object */
nm_ap_set_timestamp (ap, timestamp_secs, 0);
- nm_ap_set_trusted (ap, trusted);
+ nm_ap_set_fallback (ap, fallback);
nm_ap_set_user_addresses (ap, addr_list);
if ((list_ap = nm_ap_list_get_ap_by_essid (cb_data->list, essid)))
@@ -455,8 +461,9 @@ static void nm_dbus_get_network_data_cb
nm_ap_set_essid (list_ap, nm_ap_get_essid (ap));
nm_ap_set_timestamp_via_timestamp (list_ap, nm_ap_get_timestamp (ap));
- nm_ap_set_trusted (list_ap, nm_ap_get_trusted (ap));
+ nm_ap_set_fallback (list_ap, nm_ap_get_fallback (ap));
nm_ap_set_security (list_ap, nm_ap_get_security (ap));
+ nm_ap_add_capabilities_from_security (list_ap, nm_ap_get_security (ap));
user_addresses = nm_ap_get_user_addresses (ap);
nm_ap_set_user_addresses (list_ap, user_addresses);
Index: NetworkManager-0.6.5/src/nm-device-802-11-wireless.c
===================================================================
--- NetworkManager-0.6.5.orig/src/nm-device-802-11-wireless.c
+++ NetworkManager-0.6.5/src/nm-device-802-11-wireless.c
@@ -242,12 +242,13 @@ nm_device_802_11_wireless_update_bssid (
return;
/* Get the current BSSID. If it is valid but does not match the stored value,
- * and the ESSID is the same as what we think its suposed to be, update it. */
+ * and the ESSID is the same as what we think its supposed to be, update it. */
nm_device_802_11_wireless_get_bssid (self, &new_bssid);
old_bssid = nm_ap_get_address (ap);
new_essid = nm_device_802_11_wireless_get_essid(self);
old_essid = nm_ap_get_essid(ap);
if ( nm_ethernet_address_is_valid (&new_bssid)
+ && nm_ethernet_address_is_valid (old_bssid)
&& !nm_ethernet_addresses_are_equal (&new_bssid, old_bssid)
&& !nm_null_safe_strcmp (old_essid, new_essid))
{
@@ -742,12 +743,11 @@ nm_device_802_11_wireless_get_best_ap (N
NMAPListIter * iter;
NMAccessPoint * scan_ap = NULL;
NMAccessPoint * best_ap = NULL;
+ NMAccessPoint * fallback_ap = NULL;
NMAccessPoint * cur_ap = NULL;
NMActRequest * req = NULL;
- NMAccessPoint * trusted_best_ap = NULL;
- NMAccessPoint * untrusted_best_ap = NULL;
- GTimeVal trusted_latest_timestamp = {0, 0};
- GTimeVal untrusted_latest_timestamp = {0, 0};
+ GTimeVal best_timestamp = {0, 0};
+ GTimeVal fallback_timestamp = {0, 0};
NMData * app_data;
g_return_val_if_fail (self != NULL, NULL);
@@ -833,27 +833,50 @@ nm_device_802_11_wireless_get_best_ap (N
}
}
- g_slist_foreach (user_addrs, (GFunc)g_free, NULL);
+ g_slist_foreach (user_addrs, (GFunc) g_free, NULL);
g_slist_free (user_addrs);
}
- if (!blacklisted && nm_ap_get_trusted (tmp_ap) && (curtime->tv_sec > trusted_latest_timestamp.tv_sec))
+ if (!blacklisted)
{
- trusted_latest_timestamp = *nm_ap_get_timestamp (tmp_ap);
- trusted_best_ap = scan_ap;
- nm_ap_set_security (trusted_best_ap, nm_ap_get_security (tmp_ap));
- }
- else if (!blacklisted && !nm_ap_get_trusted (tmp_ap) && (curtime->tv_sec > untrusted_latest_timestamp.tv_sec))
- {
- untrusted_latest_timestamp = *nm_ap_get_timestamp (tmp_ap);
- untrusted_best_ap = scan_ap;
- nm_ap_set_security (untrusted_best_ap, nm_ap_get_security (tmp_ap));
+ if (!nm_ap_get_artificial (scan_ap))
+ {
+ /*
+ * Allowed, non-blacklist, non-invalid, really-seen-in-scan network. We
+ * prefer these, and we will return the most-recently-used.
+ */
+ if (curtime->tv_sec > best_timestamp.tv_sec)
+ {
+ best_timestamp = *nm_ap_get_timestamp (tmp_ap);
+ best_ap = scan_ap;
+ nm_ap_set_security (best_ap, nm_ap_get_security (tmp_ap));
+ }
+ }
+ else
+ {
+ /*
+ * Allowed, non-blacklist, non-invalid, fallback, but not-seen-in-scan network.
+ * If we don't find any of the above networks, we will brute-force one of these
+ */
+ if (nm_ap_get_fallback (tmp_ap) && (curtime->tv_sec > fallback_timestamp.tv_sec))
+ {
+ fallback_timestamp = *nm_ap_get_timestamp (tmp_ap);
+ fallback_ap = scan_ap;
+ nm_ap_set_security (fallback_ap, nm_ap_get_security (tmp_ap));
+ }
+ }
}
}
}
- best_ap = trusted_best_ap ? trusted_best_ap : untrusted_best_ap;
nm_ap_list_iter_free (iter);
+ if (!best_ap && fallback_ap)
+ {
+ nm_ap_set_broadcast (fallback_ap, FALSE);
+ nm_info ("Attempting to fallback to wireless network '%s'", nm_ap_get_essid (fallback_ap));
+ best_ap = fallback_ap;
+ }
+
if (best_ap)
nm_ap_ref (best_ap);
@@ -1787,7 +1810,6 @@ convert_scan_results (gpointer user_data
NMDevice80211Wireless * self;
GTimeVal cur_time;
NMAPListIter * iter = NULL;
- const char * iface;
NMData * app_data;
NMAccessPointList * ap_list;
@@ -1797,17 +1819,22 @@ convert_scan_results (gpointer user_data
if (!self || !cb_data->results)
return FALSE;
- iface = nm_device_get_iface (NM_DEVICE (self));
app_data = nm_device_get_app_data (NM_DEVICE (self));
if (cb_data->results_len > 0)
{
if (!process_scan_results (self, cb_data->results, cb_data->results_len))
+ {
+ const char * iface;
+ iface = nm_device_get_iface (NM_DEVICE (self));
nm_warning ("process_scan_results() on device %s returned an error.", iface);
+ }
/* Once we have the list, copy in any relevant information from our Allowed list. */
nm_ap_list_copy_properties (nm_device_802_11_wireless_ap_list_get (self), app_data->allowed_ap_list);
}
+ nm_ap_list_merge_fallback (self);
+
/* Walk the access point list and remove any access points older than thrice the inactive scan interval */
g_get_current_time (&cur_time);
ap_list = nm_device_802_11_wireless_ap_list_get (self);
@@ -2906,9 +2933,10 @@ supplicant_send_network_config (NMDevice
goto out;
/* For non-broadcast networks, we need to set "scan_ssid 1" to scan with probe request frames.
+ * FIXME: Unfortunately, we sometimes think a hidden network is broadcast, so we always do this.
* However, don't try to probe Ad-Hoc networks.
*/
- if (!nm_ap_get_broadcast (ap) && !is_adhoc)
+ if (!is_adhoc)
{
if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL,
"SET_NETWORK %i scan_ssid 1", nwid))
@@ -3219,24 +3247,27 @@ real_activation_failure_handler (NMDevic
if ((ap = nm_act_request_get_ap (req)))
{
- if (nm_ap_get_artificial (ap))
+ if (!nm_ap_get_fallback (ap))
{
- NMAccessPointList * dev_list;
-
- /* Artificial APs are ones that don't show up in scans,
- * but which the user explicitly attempted to connect to.
- * However, if we fail on one of these, remove it from the
- * list because we don't have any scan or capability info
- * for it, and they are pretty much useless.
- */
- dev_list = nm_device_802_11_wireless_ap_list_get (self);
- nm_ap_list_remove_ap (dev_list, ap);
- }
- else
- {
- /* Add the AP to the invalid list */
- nm_ap_set_invalid (ap, TRUE);
- nm_ap_list_append_ap (app_data->invalid_ap_list, ap);
+ if (nm_ap_get_artificial (ap))
+ {
+ NMAccessPointList * dev_list;
+
+ /* Artificial APs are ones that don't show up in scans,
+ * but which the user explicitly attempted to connect to.
+ * However, if we fail on one of these, remove it from the
+ * list because we don't have any scan or capability info
+ * for it, and they are pretty much useless.
+ */
+ dev_list = nm_device_802_11_wireless_ap_list_get (self);
+ nm_ap_list_remove_ap (dev_list, ap);
+ }
+ else
+ {
+ /* Add the AP to the invalid list */
+ nm_ap_set_invalid (ap, TRUE);
+ nm_ap_list_append_ap (app_data->invalid_ap_list, ap);
+ }
}
}
Index: NetworkManager-0.6.5/test/nm-set-fallback
===================================================================
--- /dev/null
+++ NetworkManager-0.6.5/test/nm-set-fallback
@@ -0,0 +1,28 @@
+#! /bin/sh
+#
+# nm-set-fallback - mark a network as fallback
+#
+# Robert Love
+
+BIN=`which gconftool-2`
+
+if [ "x$1" == "x" ]; then
+ echo "usage: $0 <network> <true|false>"
+ exit 1
+fi
+
+if [ "x$2" != "xtrue" -a "x$2" != "xfalse" ]; then
+ echo "usage: $0 <network> <true|false>"
+ exit 2
+fi
+
+KEY="/system/networking/wireless/networks/${1}/fallback"
+CURRENT=`$BIN --get $KEY 2>/dev/null`
+
+if [ "x$CURRENT" != "xtrue" -a "x$CURRENT" != "xfalse" ]; then
+ echo "Network '$1' is not valid"
+ exit 3
+fi
+
+$BIN --set --type=bool $KEY ${2}
+
++++++ nm-fix-adhoc-icon-rml.patch ++++++
Index: nm-applet-0.6.5/src/applet.c
===================================================================
--- nm-applet-0.6.5/src/applet.c.orig
+++ nm-applet-0.6.5/src/applet.c
@@ -2741,7 +2741,7 @@ nma_icons_load_from_disk (NMApplet *appl
ICON_LOAD(applet->no_connection_icon, "nm-no-connection");
ICON_LOAD(applet->wired_icon, "nm-device-wired");
- ICON_LOAD(applet->adhoc_icon, "nm-adhoc");
+ ICON_LOAD(applet->adhoc_icon, "nm-adhoc-nd");
ICON_LOAD(applet->vpn_lock_icon, "nm-vpn-lock");
ICON_LOAD(applet->wireless_00_icon, "nm-signal-00");
++++++ nm-make-wireless-menu-item-inactive-rml.patch ++++++
Index: nm-applet-0.6.5/src/menu-items.c
===================================================================
--- nm-applet-0.6.5.orig/src/menu-items.c
+++ nm-applet-0.6.5/src/menu-items.c
@@ -112,14 +112,6 @@ struct NMWirelessMenuItem
};
-static gboolean label_expose (GtkWidget *widget)
-{
- /* Bad hack to make the label draw normally, instead of insensitive. */
- widget->state = GTK_STATE_NORMAL;
-
- return FALSE;
-}
-
NMWirelessMenuItem *wireless_menu_item_new (void)
{
NMWirelessMenuItem *item = g_malloc0 (sizeof (NMWirelessMenuItem));
@@ -129,7 +121,6 @@ NMWirelessMenuItem *wireless_menu_item_n
/* Make sure it looks slightly different if the label determines the width of the widget */
item->label = GTK_LABEL (gtk_label_new (NULL));
gtk_misc_set_padding (GTK_MISC (item->label), 6, 0);
- g_signal_connect (G_OBJECT (item->label), "expose-event", G_CALLBACK (label_expose), NULL);
gtk_container_add (GTK_CONTAINER (item->menu_item), GTK_WIDGET (item->label));
gtk_widget_show (GTK_WIDGET (item->label));
++++++ nm-never-restart-nm-applet-rml.patch ++++++
Index: nm-applet-0.6.5/src/main.c
===================================================================
--- nm-applet-0.6.5.orig/src/main.c
+++ nm-applet-0.6.5/src/main.c
@@ -50,7 +50,7 @@ int main (int argc, char *argv[])
GNOME_PARAM_NONE, GNOME_PARAM_NONE);
client = gnome_master_client ();
- gnome_client_set_restart_style (client, GNOME_RESTART_ANYWAY);
+ gnome_client_set_restart_style (client, GNOME_RESTART_NEVER);
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
++++++ nm-resolv-conf-header-rml.patch ++++++
Index: NetworkManager-0.6.5/src/named-manager/nm-named-manager.c
===================================================================
--- NetworkManager-0.6.5.orig/src/named-manager/nm-named-manager.c
+++ NetworkManager-0.6.5/src/named-manager/nm-named-manager.c
@@ -367,7 +367,15 @@ rewrite_resolv_conf (NMNamedManager *mgr
if ((f = fopen (tmp_resolv_conf, "w")) == NULL)
goto lose;
- if (fprintf (f, "%s","# generated by NetworkManager, do not edit!\n\n") < 0)
+ if (fprintf (f, "### BEGIN INFO\n#\n") < 0)
+ goto lose;
+ if (fprintf (f, "# Modified_by: NetworkManager\n") < 0)
+ goto lose;
+ if (fprintf (f, "# Process: /usr/bin/NetworkManager\n") < 0)
+ goto lose;
+ if (fprintf (f, "# Process_id: %d\n", getpid ()) < 0)
+ goto lose;
+ if (fprintf (f, "#\n### END INFO\n\n") < 0)
goto lose;
searches = compute_searches (mgr, config);
++++++ nm-save-passwds-in-keyring.patch ++++++
Index: nm-applet-0.6.5/src/applet-dbus-info.c
===================================================================
--- nm-applet-0.6.5/src/applet-dbus-info.c.orig
+++ nm-applet-0.6.5/src/applet-dbus-info.c
@@ -39,6 +39,7 @@
#include "passphrase-dialog.h"
#include "nm-utils.h"
#include "nm-gconf-wso.h"
+#include "nm-gconf-wso-wpa-eap.h"
#include "gconf-helpers.h"
#include "dbus-method-dispatcher.h"
#include "dbus-helpers.h"
@@ -73,6 +74,7 @@ typedef struct NMGetNetworkKeyCBData
{
NMApplet *applet;
DBusMessage *message;
+ NMGConfWSO *gconf_wso;
NetworkDevice *dev;
char *net_path;
char *essid;
@@ -83,6 +85,7 @@ static void free_network_key_cb_data (NM
if (cb_data)
{
dbus_message_unref (cb_data->message);
+ g_object_unref (cb_data->gconf_wso);
network_device_unref (cb_data->dev);
g_free (cb_data->net_path);
g_free (cb_data->essid);
@@ -92,6 +95,37 @@ static void free_network_key_cb_data (NM
}
+static void
+nmi_dbus_get_eap_key_callback (GnomeKeyringResult result,
+ GList *found_list,
+ gpointer data)
+{
+ NMGetNetworkKeyCBData * cb_data = (NMGetNetworkKeyCBData*) data;
+ NMApplet * applet = cb_data->applet;
+ DBusMessage * message = cb_data->message;
+ NMGConfWSO * gconf_wso = cb_data->gconf_wso;
+ NetworkDevice * dev = cb_data->dev;
+ char * net_path = cb_data->net_path;
+
+ if (result == GNOME_KEYRING_RESULT_OK && found_list) {
+ GnomeKeyringFound * found;
+
+ found = found_list->data;
+ nm_gconf_wso_wpa_eap_set_password (NM_GCONF_WSO_WPA_EAP (gconf_wso),
+ found->secret,
+ strlen (found->secret));
+ nmi_dbus_return_user_key (applet->connection, message, gconf_wso);
+ } else {
+ WirelessNetwork *net;
+
+ nmi_passphrase_dialog_destroy (applet);
+ if ((net = network_device_get_wireless_network_by_nm_path (dev, net_path)))
+ applet->passphrase_dialog = nmi_passphrase_dialog_new (applet, 0, dev, net, message);
+ }
+
+ free_network_key_cb_data (cb_data);
+}
+
static void nmi_dbus_get_network_key_callback (GnomeKeyringResult result,
GList *found_list,
gpointer data)
@@ -99,26 +133,30 @@ static void nmi_dbus_get_network_key_cal
NMGetNetworkKeyCBData * cb_data = (NMGetNetworkKeyCBData*) data;
NMApplet * applet = cb_data->applet;
DBusMessage * message = cb_data->message;
+ NMGConfWSO * gconf_wso = cb_data->gconf_wso;
NetworkDevice * dev = cb_data->dev;
char * net_path = cb_data->net_path;
char * essid = cb_data->essid;
- if (result == GNOME_KEYRING_RESULT_OK)
- {
- gchar * escaped_network;
- GnomeKeyringFound * found;
- NMGConfWSO * gconf_wso;
+ if (result == GNOME_KEYRING_RESULT_OK && found_list) {
+ GnomeKeyringFound *found = (GnomeKeyringFound *) found_list->data;
+ nm_gconf_wso_set_key (gconf_wso, found->secret, strlen (found->secret));
- escaped_network = gconf_escape_key (essid, strlen (essid));
- gconf_wso = nm_gconf_wso_new_deserialize_gconf (applet->gconf_client, escaped_network);
- g_free (escaped_network);
+ if (nm_gconf_wso_get_we_cipher (gconf_wso) == NM_AUTH_TYPE_WPA_EAP &&
+ nm_gconf_wso_wpa_eap_have_passwd (NM_GCONF_WSO_WPA_EAP (gconf_wso))) {
- found = found_list->data;
- nm_gconf_wso_set_key (gconf_wso, found->secret, strlen (found->secret));
- nmi_dbus_return_user_key (applet->connection, message, gconf_wso);
- }
- else
- {
+ gnome_keyring_find_itemsv (GNOME_KEYRING_ITEM_GENERIC_SECRET,
+ nmi_dbus_get_eap_key_callback,
+ cb_data,
+ NULL,
+ "eap-essid",
+ GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
+ essid,
+ NULL);
+ return; /* Don't free cb_data */
+ } else
+ nmi_dbus_return_user_key (applet->connection, message, gconf_wso);
+ } else {
WirelessNetwork *net;
nmi_passphrase_dialog_destroy (applet);
@@ -210,7 +248,6 @@ nmi_dbus_get_key_for_network (DBusConnec
else
new_key = TRUE;
}
- g_free (escaped_network);
/* It's not a new key, so try to get the key from the keyring. */
if (!new_key)
@@ -222,6 +259,7 @@ nmi_dbus_get_key_for_network (DBusConnec
cb_data->essid = g_strdup (essid);
cb_data->message = message;
dbus_message_ref (message);
+ cb_data->gconf_wso = nm_gconf_wso_new_deserialize_gconf (applet->gconf_client, escaped_network);
cb_data->dev = dev;
network_device_ref (dev);
cb_data->net_path = g_strdup (net_path);
@@ -234,16 +272,38 @@ nmi_dbus_get_key_for_network (DBusConnec
gtk_menu_shell_deactivate (GTK_MENU_SHELL (applet->dropdown_menu));
/* Get the essid key, if any, from the keyring */
- gnome_keyring_find_itemsv (GNOME_KEYRING_ITEM_GENERIC_SECRET,
- (GnomeKeyringOperationGetListCallback) nmi_dbus_get_network_key_callback,
- cb_data,
- NULL,
- "essid",
- GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
- essid,
- NULL);
+ if (!NM_IS_GCONF_WSO_WPA_EAP (cb_data->gconf_wso) ||
+ (NM_IS_GCONF_WSO_WPA_EAP (cb_data->gconf_wso) &&
+ nm_gconf_wso_wpa_eap_have_private_key_passwd (NM_GCONF_WSO_WPA_EAP (cb_data->gconf_wso)))) {
+
+ /* Not WPA-EAP or WPA-EAP and have private key password */
+ gnome_keyring_find_itemsv (GNOME_KEYRING_ITEM_GENERIC_SECRET,
+ nmi_dbus_get_network_key_callback,
+ cb_data,
+ NULL,
+ "essid",
+ GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
+ essid,
+ NULL);
+ } else if (NM_IS_GCONF_WSO_WPA_EAP (cb_data->gconf_wso) &&
+ nm_gconf_wso_wpa_eap_have_passwd (NM_GCONF_WSO_WPA_EAP (cb_data->gconf_wso))) {
+
+ /* WPA-EAP, no private key password, user password */
+ gnome_keyring_find_itemsv (GNOME_KEYRING_ITEM_GENERIC_SECRET,
+ nmi_dbus_get_eap_key_callback,
+ cb_data,
+ NULL,
+ "eap-essid",
+ GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
+ essid,
+ NULL);
+ } else {
+ free_network_key_cb_data (cb_data);
+ new_key = TRUE;
+ }
}
- else
+
+ if (new_key)
{
/* We only ask the user for a new key when we know about the network from NM,
* since throwing up a dialog with a random essid from somewhere is a security issue.
@@ -255,6 +315,8 @@ nmi_dbus_get_key_for_network (DBusConnec
}
}
+ g_free (escaped_network);
+
return NULL;
}
@@ -850,6 +912,62 @@ save_network_info_keyring_cb (GnomeKeyri
nm_warning ("Error saving secret for wireless network '%s' in keyring: %d", (char *) user_data, result);
}
+
+static void
+save_one_secret (const char *description, const char *essid, const char *name, const char *key)
+{
+ GnomeKeyringAttributeList *attributes;
+ GnomeKeyringAttribute attr;
+ GnomeKeyringResult ret;
+ guint32 item_id;
+
+ attributes = gnome_keyring_attribute_list_new ();
+ attr.name = g_strdup (name);
+ attr.type = GNOME_KEYRING_ATTRIBUTE_TYPE_STRING;
+ attr.value.string = g_strdup (essid);
+ g_array_append_val (attributes, attr);
+
+ ret = gnome_keyring_item_create_sync (NULL,
+ GNOME_KEYRING_ITEM_GENERIC_SECRET,
+ description,
+ attributes,
+ key,
+ TRUE,
+ &item_id);
+ if (ret != GNOME_KEYRING_RESULT_OK)
+ nm_warning ("Error saving secret for wireless network '%s' in keyring: %d", essid, ret);
+
+ gnome_keyring_attribute_list_free (attributes);
+}
+
+static void
+save_secrets (NMGConfWSO *gconf_wso, const char *essid)
+{
+ int we_cipher;
+ const char *key;
+ char *description;
+
+ we_cipher = nm_gconf_wso_get_we_cipher (gconf_wso);
+ if (we_cipher == IW_AUTH_CIPHER_NONE)
+ /* That was easy */
+ return;
+
+ key = nm_gconf_wso_get_key (gconf_wso);
+ if (key) {
+ description = g_strdup_printf (_("Passphrase for wireless network %s"), essid);
+ save_one_secret (description, essid, "essid", key);
+ g_free (description);
+ }
+
+ if (we_cipher == NM_AUTH_TYPE_WPA_EAP) {
+ key = nm_gconf_wso_wpa_eap_get_password (NM_GCONF_WSO_WPA_EAP (gconf_wso));
+ if (key) {
+ description = g_strdup_printf (_("EAP password for wireless network %s"), essid);
+ save_one_secret (description, essid, "eap-essid", key);
+ g_free (description);
+ }
+ }
+}
/*
* nmi_save_network_info
@@ -958,32 +1076,7 @@ nmi_save_network_info (NMApplet *applet,
}
/* Stuff the encryption key into the keyring */
- if (nm_gconf_wso_get_we_cipher (gconf_wso) != IW_AUTH_CIPHER_NONE)
- {
- GnomeKeyringAttributeList * attributes;
- GnomeKeyringAttribute attr;
- char * display_name;
-
- display_name = g_strdup_printf (_("Passphrase for wireless network %s"), essid);
-
- attributes = gnome_keyring_attribute_list_new ();
- attr.name = g_strdup ("essid");
- attr.type = GNOME_KEYRING_ATTRIBUTE_TYPE_STRING;
- attr.value.string = g_strdup (essid);
- g_array_append_val (attributes, attr);
-
- gnome_keyring_item_create (NULL,
- GNOME_KEYRING_ITEM_GENERIC_SECRET,
- display_name,
- attributes,
- nm_gconf_wso_get_key (gconf_wso),
- TRUE,
- save_network_info_keyring_cb,
- g_strdup (essid),
- (GDestroyNotify) g_free);
- g_free (display_name);
- gnome_keyring_attribute_list_free (attributes);
- }
+ save_secrets (gconf_wso, essid);
out:
g_free (escaped_network);
Index: nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.c
===================================================================
--- nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.c.orig
+++ nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.c
@@ -49,6 +49,9 @@ struct _NMGConfWSOWPA_EAPPrivate
const char * private_key_file;
const char * client_cert_file;
const char * ca_cert_file;
+
+ gboolean have_passwd;
+ gboolean have_private_key_passwd;
};
@@ -78,14 +81,21 @@ nm_gconf_wso_wpa_eap_new_deserialize_dbu
/* Success, build up our security object */
security = g_object_new (NM_TYPE_GCONF_WSO_WPA_EAP, NULL);
nm_gconf_wso_set_we_cipher (NM_GCONF_WSO (security), we_cipher);
- if (private_key_passwd && strlen (private_key_passwd) > 0)
+ if (private_key_passwd && strlen (private_key_passwd) > 0) {
+ security->priv->have_private_key_passwd = TRUE;
nm_gconf_wso_set_key (NM_GCONF_WSO (security), private_key_passwd, strlen (private_key_passwd));
+ }
security->priv->wpa_version = wpa_version;
security->priv->key_type = key_type;
security->priv->eap_method = NM_EAP_TO_EAP_METHOD (eap_method);
security->priv->phase2_type = NM_EAP_TO_PHASE2_METHOD (eap_method);
security->priv->key_mgmt = IW_AUTH_KEY_MGMT_802_1X;
- security->priv->identity = g_strdup (identity);
+
+ if (passwd) {
+ security->priv->have_passwd = TRUE;
+ security->priv->passwd = g_strdup (passwd);
+ }
+
security->priv->passwd = g_strdup (passwd);
security->priv->anon_identity = g_strdup (anon_identity);
security->priv->private_key_file = g_strdup (private_key_file);
@@ -102,7 +112,6 @@ nm_gconf_wso_wpa_eap_new_deserialize_gco
{
NMGConfWSOWPA_EAP * security = NULL;
char * identity = NULL;
- char * passwd = NULL;
char * anon_identity = NULL;
char * private_key_file = NULL;
char * client_cert_file = NULL;
@@ -112,6 +121,8 @@ nm_gconf_wso_wpa_eap_new_deserialize_gco
int key_type = 0;
int phase2_type = 0;
int key_mgmt = 0;
+ gboolean have_passwd = FALSE;
+ gboolean have_private_key_passwd = FALSE;
g_return_val_if_fail (client != NULL, NULL);
g_return_val_if_fail (network != NULL, NULL);
@@ -155,12 +166,6 @@ nm_gconf_wso_wpa_eap_new_deserialize_gco
nm_gconf_get_string_helper (client,
GCONF_PATH_WIRELESS_NETWORKS,
- WPA_EAP_PREFIX"passwd",
- network,
- &passwd);
-
- nm_gconf_get_string_helper (client,
- GCONF_PATH_WIRELESS_NETWORKS,
WPA_EAP_PREFIX"anon_identity",
network,
&anon_identity);
@@ -183,6 +188,18 @@ nm_gconf_wso_wpa_eap_new_deserialize_gco
network,
&ca_cert_file);
+ nm_gconf_get_bool_helper (client,
+ GCONF_PATH_WIRELESS_NETWORKS,
+ WPA_EAP_PREFIX"passwd",
+ network,
+ &have_passwd);
+
+ nm_gconf_get_bool_helper (client,
+ GCONF_PATH_WIRELESS_NETWORKS,
+ WPA_EAP_PREFIX"private_key_passwd",
+ network,
+ &have_private_key_passwd);
+
/* Success, build up our security object */
security = g_object_new (NM_TYPE_GCONF_WSO_WPA_EAP, NULL);
nm_gconf_wso_set_we_cipher (NM_GCONF_WSO (security), we_cipher);
@@ -192,14 +209,14 @@ nm_gconf_wso_wpa_eap_new_deserialize_gco
security->priv->phase2_type = phase2_type;
security->priv->key_mgmt = IW_AUTH_KEY_MGMT_802_1X;
security->priv->identity = g_strdup (identity);
- security->priv->passwd = g_strdup (passwd);
security->priv->anon_identity = g_strdup (anon_identity);
security->priv->private_key_file = g_strdup (private_key_file);
security->priv->client_cert_file = g_strdup (client_cert_file);
security->priv->ca_cert_file = g_strdup (ca_cert_file);
+ security->priv->have_passwd = have_passwd;
+ security->priv->have_private_key_passwd = have_private_key_passwd;
g_free (identity);
- g_free (passwd);
g_free (anon_identity);
g_free (private_key_file);
g_free (client_cert_file);
@@ -262,13 +279,6 @@ real_serialize_gconf (NMGConfWSO *instan
g_free (key);
}
- if (self->priv->passwd && strlen (self->priv->passwd) > 0)
- {
- key = g_strdup_printf ("%s/%s/%spasswd", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX);
- gconf_client_set_string (client, key, self->priv->passwd, NULL);
- g_free (key);
- }
-
if (self->priv->anon_identity && strlen (self->priv->anon_identity) > 0)
{
key = g_strdup_printf ("%s/%s/%sanon_identity", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX);
@@ -297,6 +307,18 @@ real_serialize_gconf (NMGConfWSO *instan
g_free (key);
}
+ /* Only update these if we have any security information. NM happens to send blank
+ security every now and then */
+ if (self->priv->passwd || nm_gconf_wso_get_key (instance)) {
+ key = g_strdup_printf ("%s/%s/%spasswd", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX);
+ gconf_client_set_bool (client, key, self->priv->have_passwd, NULL);
+ g_free (key);
+
+ key = g_strdup_printf ("%s/%s/%sprivate_key_passwd", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX);
+ gconf_client_set_bool (client, key, self->priv->have_private_key_passwd, NULL);
+ g_free (key);
+ }
+
return TRUE;
}
@@ -423,3 +445,42 @@ nm_gconf_wpa_eap_populate_dialog (NMGCon
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), wso->priv->private_key_file);
}
}
+
+void
+nm_gconf_wso_wpa_eap_set_password (NMGConfWSOWPA_EAP *wso, const char *passwd, int passwd_len)
+{
+ g_return_if_fail (NM_IS_GCONF_WSO_WPA_EAP (wso));
+ g_return_if_fail (passwd != NULL);
+ g_return_if_fail (passwd_len > 0);
+
+ if (wso->priv->passwd)
+ g_free (wso->priv->passwd);
+
+ wso->priv->passwd = g_malloc0 (passwd_len + 1);
+ memcpy (wso->priv->passwd, passwd, passwd_len);
+ wso->priv->have_passwd = TRUE;
+}
+
+const char *
+nm_gconf_wso_wpa_eap_get_password (NMGConfWSOWPA_EAP *wso)
+{
+ g_return_val_if_fail (NM_IS_GCONF_WSO_WPA_EAP (wso), NULL);
+
+ return wso->priv->passwd;
+}
+
+gboolean
+nm_gconf_wso_wpa_eap_have_private_key_passwd (NMGConfWSOWPA_EAP *wso)
+{
+ g_return_val_if_fail (NM_IS_GCONF_WSO_WPA_EAP (wso), FALSE);
+
+ return wso->priv->have_private_key_passwd;
+}
+
+gboolean
+nm_gconf_wso_wpa_eap_have_passwd (NMGConfWSOWPA_EAP *wso)
+{
+ g_return_val_if_fail (NM_IS_GCONF_WSO_WPA_EAP (wso), FALSE);
+
+ return wso->priv->have_passwd;
+}
Index: nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.h
===================================================================
--- nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.h.orig
+++ nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.h
@@ -61,5 +61,9 @@ NMGConfWSOWPA_EAP * nm_gconf_wso_wpa_eap
/* Ugh. Please avert your eyes. */
void nm_gconf_wpa_eap_populate_dialog (NMGConfWSOWPA_EAP *wso, GladeXML *xml);
+void nm_gconf_wso_wpa_eap_set_password (NMGConfWSOWPA_EAP *wso, const char *passwd, int passwd_len);
+const char *nm_gconf_wso_wpa_eap_get_password (NMGConfWSOWPA_EAP *wso);
+gboolean nm_gconf_wso_wpa_eap_have_private_key_passwd (NMGConfWSOWPA_EAP *wso);
+gboolean nm_gconf_wso_wpa_eap_have_passwd (NMGConfWSOWPA_EAP *wso);
#endif /* NM_GCONF_WSO_WPA_EAP_H */
++++++ nm-wireless-driver-workarounds-rml.patch ++++++
Index: NetworkManager-0.6.5/src/nm-device-802-11-wireless.c
===================================================================
--- NetworkManager-0.6.5.orig/src/nm-device-802-11-wireless.c
+++ NetworkManager-0.6.5/src/nm-device-802-11-wireless.c
@@ -116,9 +116,10 @@ static gboolean process_scan_results (NM
guint32 res_buf_len);
static void schedule_scan (NMDevice80211Wireless *self);
-static int wireless_qual_to_percent (const struct iw_quality *qual,
- const struct iw_quality *max_qual,
- const struct iw_quality *avg_qual);
+static int wireless_qual_to_percent (NMDevice *dev,
+ const struct iw_quality *qual,
+ const struct iw_quality *max_qual,
+ const struct iw_quality *avg_qual);
static gboolean is_associated (NMDevice80211Wireless *self);
@@ -190,8 +191,9 @@ nm_device_802_11_wireless_update_signal_
#endif
if (iw_get_stats (nm_dev_sock_get_fd (sk), iface, &stats, &range, has_range) == 0)
{
- percent = wireless_qual_to_percent (&stats.qual, (const iwqual *)(&self->priv->max_qual),
- (const iwqual *)(&self->priv->avg_qual));
+ percent = wireless_qual_to_percent (NM_DEVICE (self), &stats.qual,
+ (const iwqual *)(&self->priv->max_qual),
+ (const iwqual *)(&self->priv->avg_qual));
}
nm_dev_sock_close (sk);
}
@@ -350,23 +352,15 @@ get_wireless_capabilities (NMDevice80211
if ((data_len >= minlen) && range->we_version_compiled >= 18)
{
- if (range->enc_capa & IW_ENC_CAPA_WPA)
- {
- caps |= (NM_802_11_CAP_PROTO_WPA
- | NM_802_11_CAP_KEY_MGMT_PSK
- | NM_802_11_CAP_KEY_MGMT_802_1X);
- }
- if (range->enc_capa & IW_ENC_CAPA_WPA2)
- {
- caps |= (NM_802_11_CAP_PROTO_WPA2
- | NM_802_11_CAP_KEY_MGMT_PSK
- | NM_802_11_CAP_KEY_MGMT_802_1X);
- }
-
- if (range->enc_capa & IW_ENC_CAPA_CIPHER_TKIP)
- caps |= NM_802_11_CAP_CIPHER_TKIP;
- if (range->enc_capa & IW_ENC_CAPA_CIPHER_CCMP)
- caps |= NM_802_11_CAP_CIPHER_CCMP;
+ /* FIXME: Until all drivers support enc_capa ... */
+ caps |= (NM_802_11_CAP_PROTO_WPA
+ | NM_802_11_CAP_KEY_MGMT_PSK
+ | NM_802_11_CAP_KEY_MGMT_802_1X);
+ caps |= (NM_802_11_CAP_PROTO_WPA2
+ | NM_802_11_CAP_KEY_MGMT_PSK
+ | NM_802_11_CAP_KEY_MGMT_802_1X);
+ caps |= NM_802_11_CAP_CIPHER_TKIP;
+ caps |= NM_802_11_CAP_CIPHER_CCMP;
}
return caps;
@@ -1234,7 +1228,8 @@ nm_device_802_11_wireless_get_signal_str
*
*/
static int
-wireless_qual_to_percent (const struct iw_quality *qual,
+wireless_qual_to_percent (NMDevice *dev,
+ const struct iw_quality *qual,
const struct iw_quality *max_qual,
const struct iw_quality *avg_qual)
{
@@ -1263,7 +1258,7 @@ max_qual->updated);
* are free to use whatever they want to calculate "Link Quality".
*/
if ((max_qual->qual != 0) && !(max_qual->updated & IW_QUAL_QUAL_INVALID) && !(qual->updated & IW_QUAL_QUAL_INVALID))
- percent = (int)(100 * ((double)qual->qual / (double)max_qual->qual));
+ percent = (int) (100 * ((double) qual->qual / (double) max_qual->qual));
/* If the driver doesn't specify a complete and valid quality, we have two options:
*
@@ -1329,7 +1324,7 @@ max_qual->updated);
}
/* If the quality percent was 0 or doesn't exist, then try to use signal levels instead */
- if ((percent < 1) && (level_percent >= 0))
+ if ((percent < 1 || !strcmp (nm_device_get_driver (dev), "ath_pci")) && (level_percent >= 0))
percent = level_percent;
#ifdef IW_QUAL_DEBUG
@@ -2636,13 +2631,11 @@ supplicant_status_cb (GIOChannel *source
}
-#define NM_SUPPLICANT_TIMEOUT 20 /* how long we wait for wpa_supplicant to associate (in seconds) */
+#define NM_SUPPLICANT_TIMEOUT 60 /* how long we wait for wpa_supplicant to associate (in seconds) */
static unsigned int
get_supplicant_timeout (NMDevice80211Wireless *self)
{
- if (self->priv->num_freqs > 14)
- return NM_SUPPLICANT_TIMEOUT * 2;
return NM_SUPPLICANT_TIMEOUT;
}
@@ -2762,6 +2755,8 @@ supplicant_interface_init (NMDevice80211
struct wpa_ctrl * ctrl = NULL;
char * socket_path;
const char * iface = nm_device_get_iface (NM_DEVICE (self));
+ const char * wpa_driver;
+ const char * kernel_driver;
gboolean success = FALSE;
int tries = 0;
@@ -2778,9 +2773,19 @@ supplicant_interface_init (NMDevice80211
goto exit;
}
+ /*
+ * We want to work with the generic "wext" wpa_supplicant driver, but some kernel drivers
+ * are just utter junk. For those losers, we use a specific wpa_supplicant driver.
+ */
+ kernel_driver = nm_device_get_driver (NM_DEVICE (self));
+ if (!strcmp (kernel_driver, "ath_pci"))
+ wpa_driver = "madwifi";
+ else
+ wpa_driver = "wext";
+
/* wpa_cli -g/var/run/wpa_supplicant-global interface_add eth1 "" wext /var/run/wpa_supplicant */
if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL,
- "INTERFACE_ADD %s\t\twext\t" WPA_SUPPLICANT_CONTROL_SOCKET "\t", iface))
+ "INTERFACE_ADD %s\t\t%s\t" WPA_SUPPLICANT_CONTROL_SOCKET "\t", iface, wpa_driver))
goto exit;
wpa_ctrl_close (ctrl);
@@ -2816,7 +2821,8 @@ supplicant_send_network_config (NMDevice
struct wpa_ctrl * ctrl;
gboolean is_adhoc;
char * hex_essid = NULL;
- const char * ap_scan = "AP_SCAN 1";
+ char * ap_scan;
+ const char * kernel_driver;
guint32 caps;
gboolean supports_wpa;
@@ -2838,12 +2844,39 @@ supplicant_send_network_config (NMDevice
|| (caps & NM_802_11_CAP_PROTO_WPA2);
/* Use "AP_SCAN 2" if:
+ *
+ * - The wireless driver does not support "AP_SCAN 1"
+ * (orinoco, prism54, airo, and airo_cs)
+ * - The wireless network is hidden and the driver does not support
+ * "AP_SCAN 1" with hidden networks (ipw2100, ipw2200, and ndiswrapper)
* - The wireless network is non-broadcast or Ad-Hoc
* - The wireless driver does not support WPA (stupid drivers...)
+ *
+ * Otherwise, we prefer "AP_SCAN 1".
*/
is_adhoc = (nm_ap_get_mode(ap) == IW_MODE_ADHOC);
- if (!nm_ap_get_broadcast (ap) || is_adhoc || !supports_wpa)
+ kernel_driver = nm_device_get_driver (NM_DEVICE (self));
+ if (!strcmp (kernel_driver, "orinoco_cs"))
+ ap_scan = "AP_SCAN 2";
+ else if (!strcmp (kernel_driver, "prism54"))
+ ap_scan = "AP_SCAN 2";
+ else if (!strncmp (kernel_driver, "airo", 4))
+ ap_scan = "AP_SCAN 2";
+ else if (!strcmp (kernel_driver, "ndiswrapper") && !nm_ap_get_broadcast (ap))
+ ap_scan = "AP_SCAN 2";
+ else if (!strcmp (kernel_driver, "ipw2100") || !strcmp (kernel_driver, "ipw2200"))
+ {
+ if (nm_ap_get_broadcast (ap))
+ ap_scan = "AP_SCAN 1";
+ else
+ ap_scan = "AP_SCAN 2";
+ }
+ else if (is_adhoc)
ap_scan = "AP_SCAN 2";
+ else if (!supports_wpa)
+ ap_scan = "AP_SCAN 2";
+ else
+ ap_scan = "AP_SCAN 1";
/* Tell wpa_supplicant that we'll do the scanning */
if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL, ap_scan))
@@ -3522,7 +3555,8 @@ process_scan_results (NMDevice80211Wirel
nm_ap_set_freq (ap, iw_freq2float(&(iwe->u.freq)));
break;
case IWEVQUAL:
- nm_ap_set_strength (ap, wireless_qual_to_percent (&(iwe->u.qual),
+ nm_ap_set_strength (ap, wireless_qual_to_percent (&dev->parent,
+ &(iwe->u.qual),
(const iwqual *)(&dev->priv->max_qual),
(const iwqual *)(&dev->priv->avg_qual)));
break;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package xen
checked in at Thu Nov 29 22:05:24 CET 2007.
--------
--- arch/i386/xen/xen.changes 2007-11-05 17:39:58.000000000 +0100
+++ /mounts/work_src_done/STABLE/xen/xen.changes 2007-11-29 21:56:24.345318000 +0100
@@ -1,0 +2,6 @@
+Thu Nov 29 13:44:29 MST 2007 - carnold(a)novell.com
+
+- Added part of upstream c/s 15211. Fixed open call with O_CREAT
+ because it had no mode flags.
+
+-------------------------------------------------------------------
New:
----
15211-partial-changeset.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xen.spec ++++++
--- /var/tmp/diff_new_pack.F22843/_old 2007-11-29 22:05:05.000000000 +0100
+++ /var/tmp/diff_new_pack.F22843/_new 2007-11-29 22:05:05.000000000 +0100
@@ -34,7 +34,7 @@
BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11
%endif
Version: 3.1.0_15042
-Release: 69
+Release: 73
License: GPL v2 only
Group: System/Kernel
AutoReqProv: on
@@ -72,48 +72,49 @@
Patch12: 15185-vtpr.patch
Patch13: 15189-pmtimer.patch
Patch14: 15190-clocksource-opt.patch
-Patch15: 15217-hvm-save-restore.patch
-Patch16: 15228-hvm-usb-windows-crash.patch
-Patch17: 15230-hvm-usb-windows-crash.patch
-Patch18: 15234-hvm-usb-windows-crash.patch
-Patch19: 15250_xend_device_destroy.patch
-Patch20: 15257-hvm-save-restore.patch
-Patch21: 15273_libxenapi.patch
-Patch22: 15274_xenapi.patch
-Patch23: 15275_xenapi.patch
-Patch24: 15277-hvm-intel2amd-windows-migrate.patch
-Patch25: 15381-log-svm-npt.patch
-Patch26: 15383-hvm-usb-windows-crash.patch
-Patch27: 15389-32on64-memop-error-path.patch
-Patch28: 15390-32on64-setup-error-path.patch
-Patch29: 15391-32on64-setup-pgtable.patch
-Patch30: 15410-domain-restore.patch
-Patch31: 15416-x86_64-failsafe.patch
-Patch32: 15418-hvm-usb-windows-crash.patch
-Patch33: 15433-pae-ptwr-check.patch
-Patch34: 15444-vmxassist-p2r.patch
-Patch35: 15469-hvm-save-restore.patch
-Patch36: 15477_dev_attach.patch
-Patch37: 15480-man-xm.patch
-Patch38: 15528-hvm-sles9-install.patch
-Patch39: 15587-domid-reset.patch
-Patch40: 15595-rtl8139-data-corruption.patch
-Patch41: 15596-rtl8139-crc-fix.patch
-Patch42: 15609-save-mem-values.patch
-Patch43: 15642_uuid_unique.patch
-Patch44: 15645-hvm-save-restore.patch
-Patch45: 15649_xenapi.patch
-Patch46: 15650_xenapi.patch
-Patch47: 15651_xenapi.patch
-Patch48: 15689_dev_destroy_cleanup.patch
-Patch49: 15691-hvm-save-restore.patch
-Patch50: 15693-32on64-gnttab-err.patch
-Patch51: 15716_dev_detach.patch
-Patch52: fix_15716.patch
-Patch53: hvm_vnc.diff
-Patch54: xend_mem_leak.diff
-Patch55: 16157-xenmon-security.patch
-Patch56: 15434-irq-permissions.patch
+Patch15: 15211-partial-changeset.patch
+Patch16: 15217-hvm-save-restore.patch
+Patch17: 15228-hvm-usb-windows-crash.patch
+Patch18: 15230-hvm-usb-windows-crash.patch
+Patch19: 15234-hvm-usb-windows-crash.patch
+Patch20: 15250_xend_device_destroy.patch
+Patch21: 15257-hvm-save-restore.patch
+Patch22: 15273_libxenapi.patch
+Patch23: 15274_xenapi.patch
+Patch24: 15275_xenapi.patch
+Patch25: 15277-hvm-intel2amd-windows-migrate.patch
+Patch26: 15381-log-svm-npt.patch
+Patch27: 15383-hvm-usb-windows-crash.patch
+Patch28: 15389-32on64-memop-error-path.patch
+Patch29: 15390-32on64-setup-error-path.patch
+Patch30: 15391-32on64-setup-pgtable.patch
+Patch31: 15410-domain-restore.patch
+Patch32: 15416-x86_64-failsafe.patch
+Patch33: 15418-hvm-usb-windows-crash.patch
+Patch34: 15433-pae-ptwr-check.patch
+Patch35: 15444-vmxassist-p2r.patch
+Patch36: 15469-hvm-save-restore.patch
+Patch37: 15477_dev_attach.patch
+Patch38: 15480-man-xm.patch
+Patch39: 15528-hvm-sles9-install.patch
+Patch40: 15587-domid-reset.patch
+Patch41: 15595-rtl8139-data-corruption.patch
+Patch42: 15596-rtl8139-crc-fix.patch
+Patch43: 15609-save-mem-values.patch
+Patch44: 15642_uuid_unique.patch
+Patch45: 15645-hvm-save-restore.patch
+Patch46: 15649_xenapi.patch
+Patch47: 15650_xenapi.patch
+Patch48: 15651_xenapi.patch
+Patch49: 15689_dev_destroy_cleanup.patch
+Patch50: 15691-hvm-save-restore.patch
+Patch51: 15693-32on64-gnttab-err.patch
+Patch52: 15716_dev_detach.patch
+Patch53: fix_15716.patch
+Patch54: hvm_vnc.diff
+Patch55: xend_mem_leak.diff
+Patch56: 16157-xenmon-security.patch
+Patch57: 15434-irq-permissions.patch
# Our patches
Patch100: xen-config.diff
Patch101: xend-config.diff
@@ -482,6 +483,7 @@
Ian Pratt <ian.pratt(a)cl.cam.ac.uk>
%if %{?with_kmp}0
+
%package KMP
Group: System/Kernel
Summary: Xen para-virtual device drivers for fully virtualized guests
@@ -528,6 +530,7 @@
%endif
+
%package doc-html
Summary: Xen Virtualization: HTML documentation
Group: Documentation/HTML
@@ -624,6 +627,7 @@
%patch54 -p1
%patch55 -p1
%patch56 -p1
+%patch57 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
@@ -1013,7 +1017,11 @@
%postun libs
/sbin/ldconfig
+
%changelog
+* Thu Nov 29 2007 - carnold(a)novell.com
+- Added part of upstream c/s 15211. Fixed open call with O_CREAT
+ because it had no mode flags.
* Mon Nov 05 2007 - jfehlig(a)novell.com
- Added upstream c/s 15434 to allow access to serial devices.
Bug #338486.
++++++ 15211-partial-changeset.patch ++++++
Index: xen-3.1-testing/tools/console/daemon/utils.c
===================================================================
--- xen-3.1-testing.orig/tools/console/daemon/utils.c
+++ xen-3.1-testing/tools/console/daemon/utils.c
@@ -86,7 +86,7 @@ void daemonize(const char *pidfile)
if (chdir("/") < 0)
exit (1);
- fd = open(pidfile, O_RDWR | O_CREAT);
+ fd = open(pidfile, O_RDWR | O_CREAT, S_IRUSR|S_IWUSR);
if (fd == -1) {
exit(1);
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package glib2
checked in at Thu Nov 29 22:04:31 CET 2007.
--------
--- GNOME/glib2/glib2.changes 2007-10-15 11:58:26.000000000 +0200
+++ /mounts/work_src_done/STABLE/glib2/glib2.changes 2007-11-29 20:32:41.083174000 +0100
@@ -1,0 +2,5 @@
+Thu Nov 29 20:32:25 CET 2007 - maw(a)suse.de
+
+- Use the system's PCRE (#325921).
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ glib2.spec ++++++
--- /var/tmp/diff_new_pack.I19221/_old 2007-11-29 22:03:36.000000000 +0100
+++ /var/tmp/diff_new_pack.I19221/_new 2007-11-29 22:03:36.000000000 +0100
@@ -12,19 +12,19 @@
Name: glib2
%define _name glib
-BuildRequires: fdupes pkg-config
-License: LGPL v2 or later
+BuildRequires: fdupes pcre-devel pkg-config
+License: LGPL v2.1 or later
Group: Development/Libraries/C and C++
AutoReqProv: on
Version: 2.14.1
-Release: 11
+Release: 18
Summary: A Library with Convenient Functions Written in C
Url: http://www.gtk.org/
Source: ftp://ftp.gnome.org/pub/GNOME/sources/%{_name}/2.14/%{_name}-%{version}.tar…
Source1: glib2.sh
Source2: glib2.csh
# Not depending on gtk-doc shortens bootstrap compilation path.
-# Please update this file from the latest gtk-doc package:
+# Please update this file from the latest gtk-doc package:
Source3: gtk-doc.m4
Patch0: glib-mkinstalldirs.patch
Patch1: glib-aclocal.patch
@@ -60,7 +60,7 @@
Sebastian Wilhelmi <wilhelmi(a)ira.uka.de>
%package devel
-Requires: %{name} = %{version} pkg-config glibc-devel
+Requires: %{name} = %{version} pcre-devel pkg-config glibc-devel
Summary: Include files and libraries mandatory for development
Group: Development/Libraries/C and C++
AutoReqProv: on
@@ -137,7 +137,8 @@
# needed for glib-2.12.4:
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%configure \
- --enable-static
+ --enable-static \
+ --with-pcre=system
make %{?jobs:-j%jobs}
%install
@@ -182,7 +183,10 @@
# Own these repositories to not depend on gtk-doc while building:
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
+
%changelog
+* Thu Nov 29 2007 - maw(a)suse.de
+- Use the system's PCRE (#325921).
* Mon Oct 15 2007 - meissner(a)suse.de
- merge malloc size markup from BETA.
* Thu Oct 11 2007 - rguenther(a)suse.de
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package freeciv
checked in at Thu Nov 29 21:57:24 CET 2007.
--------
--- freeciv/freeciv.changes 2007-11-03 11:12:56.000000000 +0100
+++ /mounts/work_src_done/STABLE/freeciv/freeciv.changes 2007-11-29 16:46:35.804319000 +0100
@@ -1,0 +2,15 @@
+Thu Nov 29 16:52:42 CET 2007 - sndirsch(a)suse.de
+
+- update to release 2.1.1
+ * Turn off full screen mode by default. (PR#12119)
+ * Fix city dialog. (PR#39825)
+ * Fix goto and patrol. (PR#3980, PR#39817, PR#39852, PR#39868)
+ * Fix reported border and vision bugs. (PR#39828, PR#39829,
+ PR#39830, PR#39858)
+ * Modified Eiffel Tower. (PR#39826, PR#39874)
+ * SDL client much improved and usable. (PR#39859)
+ * Improved support for GGZ Gaming Zone. (PR#39611)
+ * Updated menus, text, and translations. (PR#9347, PR#23078,
+ PR#39541, PR#39723, PR#39748, PR#39818, PR#39884)
+
+-------------------------------------------------------------------
Old:
----
freeciv-2.1.0-no-nb.diff
freeciv-2.1.0.tar.bz2
New:
----
freeciv-2.1.1-no-nb.diff
freeciv-2.1.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ freeciv.spec ++++++
--- /var/tmp/diff_new_pack.TJ8131/_old 2007-11-29 21:57:15.000000000 +0100
+++ /var/tmp/diff_new_pack.TJ8131/_new 2007-11-29 21:57:15.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package freeciv (Version 2.1.0)
+# spec file for package freeciv (Version 2.1.1)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -22,8 +22,8 @@
Group: Amusements/Games/Strategy/Turn Based
AutoReqProv: on
Summary: Free Civilization Clone
-Version: 2.1.0
-Release: 120
+Version: 2.1.1
+Release: 1
Source0: %{name}-%{version}.tar.bz2
Source5: freeciv.desktop
Source6: freeciv.png
@@ -119,7 +119,20 @@
/usr/share/pixmaps/freeciv-manual.png
/usr/share/freeciv/
/usr/share/locale/*/LC_MESSAGES/freeciv.mo
+
%changelog
+* Thu Nov 29 2007 - sndirsch(a)suse.de
+- update to release 2.1.1
+ * Turn off full screen mode by default. (PR#12119)
+ * Fix city dialog. (PR#39825)
+ * Fix goto and patrol. (PR#3980, PR#39817, PR#39852, PR#39868)
+ * Fix reported border and vision bugs. (PR#39828, PR#39829,
+ PR#39830, PR#39858)
+ * Modified Eiffel Tower. (PR#39826, PR#39874)
+ * SDL client much improved and usable. (PR#39859)
+ * Improved support for GGZ Gaming Zone. (PR#39611)
+ * Updated menus, text, and translations. (PR#9347, PR#23078,
+ PR#39541, PR#39723, PR#39748, PR#39818, PR#39884)
* Sat Nov 03 2007 - sndirsch(a)suse.de
- update to final release 2.1.0. Changes since 2.0.9:
* Significantly improved features for modmakers.
++++++ freeciv-2.1.0-no-nb.diff -> freeciv-2.1.1-no-nb.diff ++++++
++++++ freeciv-2.1.0.tar.bz2 -> freeciv-2.1.1.tar.bz2 ++++++
freeciv/freeciv-2.1.0.tar.bz2 /mounts/work_src_done/STABLE/freeciv/freeciv-2.1.1.tar.bz2 differ: byte 11, line 1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package util-linux
checked in at Thu Nov 29 18:31:42 CET 2007.
--------
--- util-linux/util-linux.changes 2007-11-21 15:16:03.000000000 +0100
+++ /mounts/work_src_done/STABLE/util-linux/util-linux.changes 2007-11-29 17:52:21.000000000 +0100
@@ -1,0 +2,9 @@
+Thu Nov 29 17:51:17 CET 2007 - lnussel(a)suse.de
+
+- update crypto patch
+ * fix mount buffer overflow when reading the passphrase (#332148)
+ * add loop_fish2 compatability code to losetup/mount again (#332095)
+ * change default hash size for 128bit keys to sha256 again
+
+
+-------------------------------------------------------------------
Old:
----
util-linux-2.13-mount_losetup_crypto.patch
New:
----
util-linux-mount_losetup_crypto.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ util-linux.spec ++++++
--- /var/tmp/diff_new_pack.b14906/_old 2007-11-29 18:30:58.000000000 +0100
+++ /var/tmp/diff_new_pack.b14906/_new 2007-11-29 18:30:58.000000000 +0100
@@ -21,7 +21,7 @@
Group: System/Base
AutoReqProv: on
Version: 2.13.0.1+git20071121
-Release: 1
+Release: 5
Summary: A collection of basic system utilities
Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/%name-ng-%version.tar.bz2
Source1: util-linux-2.13-rpmlintrc
@@ -64,7 +64,7 @@
# TODO: Needs to be ported to new version
Patch38: util-linux-2.12r-mount_swapon_swsuspend_resume.patch
# 304861 - support password hashing and key length
-Patch10: util-linux-2.13-mount_losetup_crypto.patch
+Patch10: util-linux-mount_losetup_crypto.patch
Patch11: util-linux-2.13-mount_fd_leak.patch
Patch12: util-linux-2.13-fdisk_cfdisk_ncursesw.patch
##
@@ -557,7 +557,13 @@
#/usr/bin/i386
#/usr/bin/ia64
#%endif
+
%changelog
+* Thu Nov 29 2007 - lnussel(a)suse.de
+- update crypto patch
+ * fix mount buffer overflow when reading the passphrase (#332148)
+ * add loop_fish2 compatability code to losetup/mount again (#332095)
+ * change default hash size for 128bit keys to sha256 again
* Wed Nov 21 2007 - mkoenig(a)suse.de
- update to git20071121:
add sector size check for mkfs.minix [#308256]
++++++ util-linux-mount_losetup_crypto.patch ++++++
++++ 1594 lines (skipped)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package tei-roma
checked in at Thu Nov 29 18:30:14 CET 2007.
--------
--- tei-roma/tei-roma.changes 2007-04-02 16:25:22.000000000 +0200
+++ /mounts/work_src_done/NOARCH/tei-roma/tei-roma.changes 2007-11-29 16:11:54.000000000 +0100
@@ -1,0 +2,5 @@
+Thu Nov 29 16:11:38 CET 2007 - ke(a)suse.de
+
+- Update to version 2.11.
+
+-------------------------------------------------------------------
Old:
----
tei-roma-2.8.zip
New:
----
tei-roma-2.11.zip
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ tei-roma.spec ++++++
--- /var/tmp/diff_new_pack.XN4441/_old 2007-11-29 18:29:56.000000000 +0100
+++ /var/tmp/diff_new_pack.XN4441/_new 2007-11-29 18:29:56.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package tei-roma (Version 2.8)
+# spec file for package tei-roma (Version 2.11)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,15 +12,15 @@
Name: tei-roma
Summary: TEI Schema or DTD Generator
-Version: 2.8
+Version: 2.11
Release: 1
-License: GNU General Public License (GPL)
+License: GPL v2 or later
Group: Productivity/Publishing/XML
Source0: http://ftp1.sourceforge.net/sourceforge/tei/tei-roma-%{version}.zip
Patch: roma-dir.diff
-URL: http://www.tei-c.org/
+Url: http://www.tei-c.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildArchitectures: noarch
+BuildArch: noarch
Requires: /usr/bin/xsltproc trang perl
BuildRequires: unzip
@@ -39,6 +39,7 @@
%define xml_mod_style_dir %{xml_mod_dir}
%define xml_mod_style_prod_dir %{xml_mod_style_dir}/rahtz
%define xml_mod_style_prod_ver_dir %{xml_mod_style_prod_dir}/%{version}
+
%prep
%setup -q
# unzip -q -a %{SOURCE0}
@@ -49,12 +50,11 @@
%install
%{INSTALL_DIR} $RPM_BUILD_ROOT%{xml_mod_dir}
-ls
make release
(cd release; tar cf - . ) | (cd $RPM_BUILD_ROOT/%{xml_mod_dir}; tar xf - )
mkdir -p $RPM_BUILD_ROOT%{_bindir} \
$RPM_BUILD_ROOT%{_mandir}/man1
-cp -p roma.sh $RPM_BUILD_ROOT%{_bindir}/roma
+%{INSTALL_SCRIPT} roma.sh $RPM_BUILD_ROOT%{_bindir}/roma
cp -p roma.1 $RPM_BUILD_ROOT%{_mandir}/man1
# chmod 755 $RPM_BUILD_ROOT%{_bindir}/roma
@@ -64,11 +64,15 @@
%files
%defattr(644, root, root, 755)
%dir %{xml_mod_dir}
+%attr(755, root, root) %{xml_mod_dir}/%name/roma.sh
+%attr(755, root, root) %{xml_mod_dir}/%name/roma/res/merge.pl
%{xml_mod_dir}/tei-roma
%attr(755, root, root) %{_bindir}/roma
%{_mandir}/man1/roma*
%changelog
+* Thu Nov 29 2007 - ke(a)suse.de
+- Update to version 2.11.
* Mon Apr 02 2007 - ke(a)suse.de
- Update to version 2.8.
- Install the roma man page.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package dita
checked in at Thu Nov 29 18:29:28 CET 2007.
--------
--- dita/dita.changes 2007-03-29 11:47:19.000000000 +0200
+++ /mounts/work_src_done/NOARCH/dita/dita.changes 2007-11-29 12:54:48.000000000 +0100
@@ -1,0 +2,6 @@
+Thu Nov 29 12:54:17 CET 2007 - ke(a)suse.de
+
+- Update to version 1.1.
+- Fix Requires and PreReq.
+
+-------------------------------------------------------------------
Old:
----
dita10.zip
dita-catalog.diff
New:
----
dita1.1.zip
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ dita.spec ++++++
--- /var/tmp/diff_new_pack.d31436/_old 2007-11-29 18:29:14.000000000 +0100
+++ /var/tmp/diff_new_pack.d31436/_new 2007-11-29 18:29:14.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package dita (Version 1.0.1)
+# spec file for package dita (Version 1.1)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,25 +12,25 @@
Name: dita
BuildRequires: sgml-skel unzip
-URL: http://www.oasis-open.org/committees/dita/
+Url: http://www.oasis-open.org/committees/dita/
License: Other uncritical OpenSource License
Group: Productivity/Publishing/XML
-Requires: sgml-skel libxml2
+Requires: sgml-skel
%define regcat /usr/bin/sgml-register-catalog
PreReq: %{regcat} /usr/bin/xmlcatalog /usr/bin/edit-xml-catalog
-PreReq: sed grep awk
-Autoreqprov: on
+PreReq: sed grep awk coreutils
+AutoReqProv: on
Summary: OASIS Darwin Information Typing Architecture (DITA)
-Version: 1.0.1
-Release: 42
-Source0: http://www.oasis-open.org/committees/download.php/15316/dita10.zip
+Version: 1.1
+Release: 1
+Source0: http://www.oasis-open.org/committees/download.php/24944/dita1.1.zip
Source1: http://www.oasis-open.org/committees/download.php/15396/dita-document-defin…
-Patch: dita-catalog.diff
+# Patch: dita-catalog.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildArchitectures: noarch
+BuildArch: noarch
%description
-The package contains the DITA specifications, DTDs, and schemas.
+This package contains the DITA specifications, DTDs, and schemas.
@@ -54,9 +54,12 @@
%define sgml_sysconf_dir %{_sysconfdir}/sgml
%define xml_config_dir /var/lib/xml
%define xml_sysconf_dir %{_sysconfdir}/xml
+
%prep
-%setup -n %{name}10
-for z in archspechtml.zip langspechtml.zip dtd.zip schema.zip; do
+%setup -c -n %{name}1.1
+source="archspec-source.zip langspec-source.zip"
+zip="archspec-html.zip langspec-html.zip ditadtd.zip ditaschema.zip"
+for z in $zip; do
unzip -a $z
done
unzip -a -o %{S:1}
@@ -69,13 +72,15 @@
$xmlcatbin --create --noout $CATALOG
%define FOR_ROOT_CAT for-catalog-%{name}-%{version}-%{release}.xml
CATALOG=etc/xml/$CATALOG
-cat42=%{xml_pack_dtd_dir}/1.0/catalog.xml
+cat42=%{xml_pack_dtd_dir}/1.1/catalog-dita.xml
rm -f %{FOR_ROOT_CAT}.tmp
$xmlcatbin --noout --create %{FOR_ROOT_CAT}.tmp
for s in \
"-//OASIS//DTD DITA" \
"-//OASIS//ELEMENTS DITA Concept//EN" \
- "-//OASIS//ENTITIES DITA Topic Class//EN"
+ "-//OASIS//ENTITIES DITA Topic Class//EN" \
+ "-//OASIS//ELEMENTS DITA" \
+ "-//OASIS//ENTITIES DITA"
do
$xmlcatbin --noout --add "delegatePublic" "$s" \
"file://$cat42" %{FOR_ROOT_CAT}.tmp
@@ -90,48 +95,30 @@
%install
#%{INSTALL_DIR} $RPM_BUILD_ROOT%{sgml_config_dir}
#%{INSTALL_DIR} $RPM_BUILD_ROOT%{xml_config_dir}
-%{INSTALL_DIR} $RPM_BUILD_ROOT{%{xml_pack_xsd_dir},%{xml_pack_dtd_dir}}/1.0
+%{INSTALL_DIR} $RPM_BUILD_ROOT{%{xml_pack_xsd_dir},%{xml_pack_dtd_dir}}/1.1
# catalog-dita.txt
# catalog-dita.xml
-cp dtd/* $RPM_BUILD_ROOT%{xml_pack_dtd_dir}/1.0
+cp dtd/* $RPM_BUILD_ROOT%{xml_pack_dtd_dir}/1.1
# DTDDECL "-//OASIS//DTD DocBook XML V4.1.2//EN" /usr/share/sgml/opensp/xml.dcl
{
echo OVERRIDE YES
grep '\.dtd\"' dtd/catalog-dita.txt \
| awk -F\" '{printf "DTDDECL \"%s\" /usr/share/sgml/opensp/xml.dcl\n", $2}'
cat dtd/catalog-dita.txt
-} > $RPM_BUILD_ROOT%{xml_pack_dtd_dir}/1.0/%{name}.cat
-ln -s %{xml_pack_dtd_dir}/1.0/catalog-dita.xml \
- $RPM_BUILD_ROOT%{xml_pack_dtd_dir}/1.0/catalog.xml
-cp schema/* $RPM_BUILD_ROOT%{xml_pack_xsd_dir}/1.0
+} > $RPM_BUILD_ROOT%{xml_pack_dtd_dir}/1.1/%{name}.cat
+ln -s %{xml_pack_dtd_dir}/1.1/catalog-dita.xml \
+ $RPM_BUILD_ROOT%{xml_pack_dtd_dir}/1.1/catalog.xml
+cp schema/* $RPM_BUILD_ROOT%{xml_pack_xsd_dir}/1.1
%{INSTALL_DIR} $RPM_BUILD_ROOT%{sgml_pack_dtd_dir}
-ln -s %{xml_pack_dtd_dir}/1.0 \
- $RPM_BUILD_ROOT%{sgml_pack_dtd_dir}/1.0
-# %{INSTALL_DATA} CATALOG.* $RPM_BUILD_ROOT%{sgml_config_dir}
-# # for CATALOG.* links
-# %define my_all_cat docbook_4 db41xml db42xml db43xml db44xml
-# for v in 4.1 4.2 4.3 4.4; do
-# vl=${v/\.}
-# %{INSTALL_DIR} $RPM_BUILD_ROOT%{sgml_docbook_dtd_dir}/$v
-# %{INSTALL_DATA} dtd/${v}/* $RPM_BUILD_ROOT%{sgml_docbook_dtd_dir}/${v}
-# %{INSTALL_DIR} $RPM_BUILD_ROOT%{xml_docbook_dtd_dir}/$v
-# cp -a ${v}xml/* $RPM_BUILD_ROOT%{xml_docbook_dtd_dir}/$v
-# ln -s %{xml_docbook_dtd_dir}/$v $RPM_BUILD_ROOT%{sgml_docbook_dtd_dir}/${v}xml
-# ln -sf %{sgml_config_dir}/CATALOG.db${vl}xml \
-# $RPM_BUILD_ROOT%{sgml_dir}/CATALOG.db${vl}xml
-# done
-# ln -sf %{sgml_docbook_dtd_dir}/4.1 $RPM_BUILD_ROOT%{sgml_dir}/%{name}.1
-# ln -sf %{sgml_config_dir}/CATALOG.%{name} \
-# $RPM_BUILD_ROOT%{sgml_dir}/CATALOG.%{name}
-# ln -sf %{sgml_config_dir}/CATALOG.%{name} \
-# $RPM_BUILD_ROOT%{sgml_dir}/CATALOG.docbk41
+ln -s %{xml_pack_dtd_dir}/1.1 \
+ $RPM_BUILD_ROOT%{sgml_pack_dtd_dir}/1.1
cat_dir=%{buildroot}/etc/xml
%{INSTALL_DIR} $cat_dir
%{INSTALL_DATA} %{FOR_ROOT_CAT} $cat_dir
%post
if [ -x %{regcat} ]; then
- %{regcat} -a %{xml_pack_dtd_dir}/1.0/%{name}.cat \
+ %{regcat} -a %{xml_pack_dtd_dir}/1.1/%{name}.cat \
>/dev/null 2>&1 || true
fi
edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \
@@ -140,7 +127,7 @@
%postun
if [ "$1" = "0" -a -x %{regcat} ]; then
- for c in %{xml_pack_dtd_dir}/1.0/%{name}.cat; do
+ for c in %{xml_pack_dtd_dir}/1.1/%{name}.cat; do
%{regcat} -r $c \
>/dev/null 2>&1 || true
done
@@ -154,7 +141,7 @@
%files
%defattr(-, root, root)
-%doc archspechtml langspechtml
+%doc archspec langspec
# %config %{sgml_config_dir}/CATALOG.*
# %doc README.SuSE
# %{sgml_dir}/CATALOG.*
@@ -163,6 +150,9 @@
%config %{xml_sysconf_dir}/%{FOR_ROOT_CAT}
%changelog
+* Thu Nov 29 2007 - ke(a)suse.de
+- Update to version 1.1.
+- Fix Requires and PreReq.
* Thu Mar 29 2007 - coolo(a)suse.de
- fix BuildRequires
* Thu Jan 11 2007 - ke(a)suse.de
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package cups-autoconfig
checked in at Thu Nov 29 18:29:23 CET 2007.
--------
--- cups-autoconfig/cups-autoconfig.changes 2007-07-30 19:03:26.000000000 +0200
+++ /mounts/work_src_done/STABLE/cups-autoconfig/cups-autoconfig.changes 2007-11-29 17:39:24.639657000 +0100
@@ -1,0 +2,9 @@
+Thu Nov 29 17:36:28 CET 2007 - crivera(a)suse.de
+
+- HAL fdi file fixes from Danny Kukawka.
+- Don't set the default policy for new printers.
+- Various cleanups.
+- Remove the debug option in the conf and always
+ have debug turned on.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cups-autoconfig.spec ++++++
--- /var/tmp/diff_new_pack.a31091/_old 2007-11-29 18:29:08.000000000 +0100
+++ /var/tmp/diff_new_pack.a31091/_new 2007-11-29 18:29:08.000000000 +0100
@@ -10,13 +10,13 @@
Name: cups-autoconfig
-URL: http://code.google.com/p/cups-autoconfig
+Url: http://code.google.com/p/cups-autoconfig
Version: 0.1.0
-Release: 4
+Release: 48
Group: System/Base
License: GPL v2 only
Summary: A Utility to Auto-configure Printers
-Autoreqprov: on
+AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: cups >= 1.2 glib2 >= 2.8 hal dbus-1
BuildRequires: cups-devel dbus-1-devel glib2-devel >= 2.8 hal hal-devel intltool
@@ -54,6 +54,12 @@
%{_datadir}/locale/en_US/LC_MESSAGES/cups-autoconfig.mo
%changelog
+* Thu Nov 29 2007 - crivera(a)suse.de
+- HAL fdi file fixes from Danny Kukawka.
+- Don't set the default policy for new printers.
+- Various cleanups.
+- Remove the debug option in the conf and always
+ have debug turned on.
* Mon Jul 30 2007 - crivera(a)suse.de
- Use HAL device properties instead of DBus signals
to inform policy applications about newly configured printers.
++++++ cups-autoconfig-0.1.0.tar.gz ++++++
++++ 5056 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-autoconfig-0.1.0/10-cups-autoconfig.fdi new/cups-autoconfig-0.1.0/10-cups-autoconfig.fdi
--- old/cups-autoconfig-0.1.0/10-cups-autoconfig.fdi 2007-07-27 18:05:42.000000000 +0200
+++ new/cups-autoconfig-0.1.0/10-cups-autoconfig.fdi 2007-11-29 18:39:52.000000000 +0100
@@ -3,8 +3,8 @@
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="printer">
- <append key="info.callouts.add" type="strlist">/opt/anus/lib/hal/hal-cups-autoconfig --add --migrate-hal-printers</append>
- <append key="info.callouts.remove" type="strlist">/opt/anus/lib/hal/hal-cups-autoconfig --disable</append>
+ <append key="info.callouts.add" type="strlist">hal-cups-autoconfig --add --migrate-hal-printers</append>
+ <append key="info.callouts.remove" type="strlist">hal-cups-autoconfig --disable</append>
</match>
</device>
</deviceinfo>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-autoconfig-0.1.0/10-cups-autoconfig.fdi.in new/cups-autoconfig-0.1.0/10-cups-autoconfig.fdi.in
--- old/cups-autoconfig-0.1.0/10-cups-autoconfig.fdi.in 2007-07-27 18:05:01.000000000 +0200
+++ new/cups-autoconfig-0.1.0/10-cups-autoconfig.fdi.in 1970-01-01 01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deviceinfo version="0.2">
- <device>
- <match key="info.capabilities" contains="printer">
- <append key="info.callouts.add" type="strlist">@LIBDIR@/hal/hal-cups-autoconfig --add --migrate-hal-printers</append>
- <append key="info.callouts.remove" type="strlist">@LIBDIR@/hal/hal-cups-autoconfig --disable</append>
- </match>
- </device>
-</deviceinfo>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-autoconfig-0.1.0/ChangeLog new/cups-autoconfig-0.1.0/ChangeLog
--- old/cups-autoconfig-0.1.0/ChangeLog 2007-07-30 18:53:50.000000000 +0200
+++ new/cups-autoconfig-0.1.0/ChangeLog 2007-11-29 18:39:52.000000000 +0100
@@ -1,3 +1,40 @@
+2007-11-29 Chris Rivera <crivera(a)novell.com>
+
+ * src/cups-autoconfig.c:
+
+ Don't use the absolute path in the hal callout
+ script.
+
+ Move the fdi file to the thirdparty directory
+ from the osvendor directory.
+
+ Patches from Danny Kukawka.
+
+2007-11-14 Chris Rivera <crivera(a)novell.com>
+
+ * src/cups-autoconfig.c:
+
+ Remove the debug option in favor of always logging
+ good debugging information.
+
+ Set the printer.configured_existing property on old
+ printers that have been plugged back in. This lets
+ gvm know that it doesn't need to do anything. This
+ should fix 304933.
+
+2007-09-28 Chris Rivera <crivera(a)novell.com>
+
+ * src/cups-autoconfig.c:
+
+ Default to not setting the CUPS policy for new printers.
+
+2007-09-28 Chris Rivera <crivera(a)novell.com>
+
+ * src/cups-autoconfig.c:
+
+ Use g_option_context_get_help() if no flags
+ are provided.
+
2007-07-30 Chris Rivera <crivera(a)novell.com>
* src/cups-autoconfig.c:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-autoconfig-0.1.0/configure.in new/cups-autoconfig-0.1.0/configure.in
--- old/cups-autoconfig-0.1.0/configure.in 2007-07-27 16:49:46.000000000 +0200
+++ new/cups-autoconfig-0.1.0/configure.in 2007-11-29 18:39:52.000000000 +0100
@@ -75,7 +75,6 @@
Makefile
po/Makefile.in
src/Makefile
-10-cups-autoconfig.fdi
])
echo
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-autoconfig-0.1.0/cups-autoconfig.conf new/cups-autoconfig-0.1.0/cups-autoconfig.conf
--- old/cups-autoconfig-0.1.0/cups-autoconfig.conf 2007-07-26 21:28:41.000000000 +0200
+++ new/cups-autoconfig-0.1.0/cups-autoconfig.conf 2007-11-29 18:39:52.000000000 +0100
@@ -1,5 +1,4 @@
[CUPS]
ConfigureNewPrinters=yes
-DisablePrintersOnRemoval=yes
-DefaultCUPSPolicy=relaxed
-Debug=yes
+DisablePrintersOnRemoval=no
+DefaultCUPSPolicy=
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-autoconfig-0.1.0/Makefile.am new/cups-autoconfig-0.1.0/Makefile.am
--- old/cups-autoconfig-0.1.0/Makefile.am 2007-07-27 16:54:44.000000000 +0200
+++ new/cups-autoconfig-0.1.0/Makefile.am 2007-11-29 18:39:52.000000000 +0100
@@ -1,6 +1,6 @@
SUBDIRS = src po
-fdidir=$(datadir)/hal/fdi/policy/10osvendor
+fdidir=$(datadir)/hal/fdi/policy/20thirdparty
fdi_DATA=10-cups-autoconfig.fdi
sysconfigdir = $(sysconfdir)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-autoconfig-0.1.0/src/cups-autoconfig.c new/cups-autoconfig-0.1.0/src/cups-autoconfig.c
--- old/cups-autoconfig-0.1.0/src/cups-autoconfig.c 2007-07-30 18:50:36.000000000 +0200
+++ new/cups-autoconfig-0.1.0/src/cups-autoconfig.c 2007-11-14 20:07:52.000000000 +0100
@@ -44,9 +44,7 @@
#define CUPS_BACKEND_DIR LIBDIR "/cups/backend"
#define LOGFILE LOCALSTATEDIR "/log/cups-autoconfig.log"
#define CONFIGFILE SYSCONFDIR "/cups-autoconfig.conf"
-
-#define dbg(fmt,arg...) log_it(TRUE, fmt, ##arg)
-#define err(fmt,arg...) log_it(FALSE, fmt, ##arg)
+#define MAX_LOG_SIZE 20971520
typedef enum {
PPD_NO_MATCH,
@@ -69,28 +67,22 @@
gchar *default_policy;
gboolean add;
gboolean remove;
- gboolean debug;
} ConfigInfo;
-FILE *log_file;
-ConfigInfo *config;
-GHashTable *alias_map;
-GHashTable *vendor_map;
-http_t *global_cups_connection;
-gboolean enable_debug = FALSE;
-LibHalContext *hal_ctx;
+static FILE *log_file;
+static ConfigInfo *config;
+static GHashTable *alias_map;
+static GHashTable *vendor_map;
+static http_t *global_cups_connection;
+static LibHalContext *hal_ctx;
-static void log_it (gboolean debug, const char *fmt, ...)
+static void log_it (const char *fmt, ...)
{
va_list args;
va_start (args, fmt);
-
g_vfprintf (stderr, fmt, args);
g_vfprintf (log_file, fmt, args);
- if (enable_debug && debug)
- g_vfprintf (log_file, fmt, args);
-
va_end (args);
}
@@ -104,7 +96,7 @@
config = g_malloc (sizeof (ConfigInfo));
if (!g_key_file_load_from_file (kf, CONFIGFILE, G_KEY_FILE_NONE, &error)) {
- err ("Error loading config file: %s\n", error->message);
+ log_it ("Error loading config file: %s\n", error->message);
g_error_free (error);
return FALSE;
}
@@ -117,10 +109,6 @@
config->remove = value && (!strcmp (value, "yes") || !strcmp (value, "y")) ? TRUE : FALSE;
g_free (value);
- value = g_key_file_get_value (kf, "CUPS", "Debug", NULL);
- config->debug = value && (!strcmp (value, "yes") || !strcmp (value, "y")) ? TRUE : FALSE;
- g_free (value);
-
value = g_key_file_get_value (kf, "CUPS", "DefaultCUPSPolicy", NULL);
if (!strcmp ("", value)) {
g_free (value);
@@ -154,7 +142,13 @@
static gboolean open_log (void)
{
- log_file = fopen (LOGFILE, "w");
+ struct stat info;
+ gboolean append = TRUE;
+
+ if (!stat (LOGFILE, &info) && info.st_size > MAX_LOG_SIZE)
+ append = FALSE;
+
+ log_file = fopen (LOGFILE, append ? "a" : "w");
if (!log_file) {
g_printerr ("Failed to open log file: %s\n", strerror (errno));
return FALSE;
@@ -225,7 +219,7 @@
{
global_cups_connection = httpConnectEncrypt (cupsServer (), ippPort (), cupsEncryption ());
if (!global_cups_connection) {
- err ("Failed to connect to cupsd\n");
+ log_it ("Failed to connect to cupsd\n");
return FALSE;
}
@@ -245,15 +239,26 @@
* Set the printer.configured property on new printers for policy
* applications like gvm.
*/
+static void set_printer_configured_existing_property (const gchar *udi, const gchar *name)
+{
+ if (!libhal_device_set_property_bool (hal_ctx, udi,
+ "printer.configured_existing", TRUE, NULL))
+ log_it ("Failed to set printer.configured_existing property for '%s'\n", udi);
+}
+
+/*
+ * Set the printer.configured property on new printers for policy
+ * applications like gvm.
+ */
static void set_printer_configured_property (const gchar *udi, const gchar *name)
{
if (!libhal_device_set_property_bool (hal_ctx, udi,
"printer.configured", TRUE, NULL))
- err ("Failed to set printer.configured property for '%s'\n", udi);
+ log_it ("Failed to set printer.configured property for '%s'\n", udi);
if (!libhal_device_set_property_string (hal_ctx, udi,
"printer.display_name", name, NULL))
- err ("Failed to set printer.display_name\n");
+ log_it ("Failed to set printer.display_name\n");
}
/*
@@ -465,9 +470,9 @@
model = libhal_device_get_property_string (hal_ctx, hal_udi, "printer.product", NULL);
serial = libhal_device_get_property_string (hal_ctx, hal_udi, "printer.serial", NULL);
- dbg ("HAL Printer properties make='%s' model='%s' serial='%s'\n"
- "Printer properties uri='%s' m_and_m='%s'\n",
- make, model, serial, pi->uri, pi->make_and_model);
+ log_it ("HAL Printer properties make='%s' model='%s' serial='%s'\n"
+ "Printer properties uri='%s' m_and_m='%s'\n",
+ make, model, serial, pi->uri, pi->make_and_model);
if (!model || !make)
goto done;
@@ -485,7 +490,7 @@
goto matched;
}
} else
- dbg ("couldn't find a serial number in the backend uri\n");
+ log_it ("couldn't find a serial number in the backend uri\n");
}
/* strip spaces */
@@ -501,7 +506,7 @@
/* check the model */
mdl = model_from_string (make, pi->make_and_model);
if (g_ascii_strcasecmp (mdl, model)) {
- dbg ("models '%s' and '%s' didn't match with make '%s'\n",
+ log_it ("models '%s' and '%s' didn't match with make '%s'\n",
mdl, model, make);
goto done;
}
@@ -535,7 +540,7 @@
request = ippNewRequest (CUPS_GET_PPDS);
response = cupsDoRequest (global_cups_connection, request, "/");
if (!response || response->request.status.status_code > IPP_OK_CONFLICT) {
- err ("Failed to get ppds for '%s'\n", pi->make);
+ log_it ("Failed to get ppds for '%s'\n", pi->make);
goto done;
}
@@ -568,25 +573,25 @@
gchar *pm;
/* match with ieee 1284 ids */
- dbg ("Matching with 1284 ids '%s' and '%s'\n", pi->device_id, id);
+ log_it ("Matching with 1284 ids '%s' and '%s'\n", pi->device_id, id);
get_1284_fields (pi->device_id, NULL, &pm, NULL);
get_1284_fields (id, NULL, &ppd_model, NULL);
- dbg ("Extracted models are '%s' and '%s'\n", pm, ppd_model);
+ log_it ("Extracted models are '%s' and '%s'\n", pm, ppd_model);
if (!ppd_model || !pm)
continue;
match = !g_ascii_strcasecmp (ppd_model, pm) ? TRUE : FALSE;
- dbg ("Result for matching '%s' and '%s' was %d\n\n", ppd_model, pm, match);
+ log_it ("Result for matching '%s' and '%s' was %d\n\n", ppd_model, pm, match);
} else {
/* match with model strings */
- dbg ("Matching with model strings '%s' and '%s'\n", pi->model, make_and_model);
+ log_it ("Matching with model strings '%s' and '%s'\n", pi->model, make_and_model);
ppd_model = model_from_string (pi->make, make_and_model);
- dbg ("Extracted model string from ppd was '%s'\n", ppd_model);
+ log_it ("Extracted model string from ppd was '%s'\n", ppd_model);
if (!ppd_model)
continue;
match = !g_ascii_strcasecmp (ppd_model, pi->model) ? TRUE : FALSE;
- dbg ("Result for matching '%s' and '%s' was %d\n\n", ppd_model, pi->model, match);
+ log_it ("Result for matching '%s' and '%s' was %d\n\n", ppd_model, pi->model, match);
}
if (match) {
@@ -639,7 +644,7 @@
G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_STDERR_TO_DEV_NULL,
NULL, NULL, &child, NULL, &std_out, NULL, &err);
if (!ret) {
- err ("%s\n", err->message);
+ log_it ("%s\n", err->message);
g_error_free (err);
g_free (path);
return FALSE;
@@ -648,7 +653,7 @@
g_free (path);
fp = fdopen (std_out, "r");
if (!fp) {
- err ("%s\n", strerror (errno));
+ log_it ("%s\n", strerror (errno));
return FALSE;
}
@@ -716,7 +721,7 @@
}
*list = g_slist_append (*list, pi);
- dbg ("local printer '%s' - '%s'\n", pi->uri, pi->make_and_model);
+ log_it ("local printer '%s' - '%s'\n", pi->uri, pi->make_and_model);
}
fclose (fp);
@@ -738,7 +743,7 @@
GSList *detected = NULL, *p;
if (!get_local_printers (&detected, backend)) {
- dbg ("Failed to list printers from '%s' backend\n", backend);
+ log_it ("Failed to list printers from '%s' backend\n", backend);
return FALSE;
}
@@ -805,7 +810,7 @@
int i;
if (!get_local_printers (&ret, "usb")) {
- err ("Failed to get printers from usb backend\n");
+ log_it ("Failed to get printers from usb backend\n");
return FALSE;
}
@@ -818,7 +823,7 @@
for (i = 0; i < sizeof(pref_list) / sizeof(pref_list[0]); i++) {
if (has_preferred_backend_match (pi, &match, pref_list[i])) {
- dbg ("preferring '%s' over '%s'\n", match->uri, pi->uri);
+ log_it ("preferring '%s' over '%s'\n", match->uri, pi->uri);
free_printer_info (pi, NULL);
p->data = match;
break;
@@ -841,7 +846,7 @@
request = ippNewRequest (CUPS_GET_PRINTERS);
response = cupsDoRequest (global_cups_connection, request, "/");
if (!response || response->request.status.status_code > IPP_OK_CONFLICT) {
- err ("Failed to get the list of printers from cupsd\n");
+ log_it ("Failed to get the list of printers from cupsd\n");
return FALSE;
}
@@ -870,7 +875,7 @@
free_printer_info (pi, NULL);
} else {
*list = g_slist_append (*list, pi);
- dbg ("CUPS printer '%s' - '%s'\n", pi->uri, pi->name);
+ log_it ("CUPS printer '%s' - '%s'\n", pi->uri, pi->name);
}
if (!attr)
@@ -890,7 +895,7 @@
gboolean ret = FALSE;
gchar local_uri [HTTP_MAX_URI + 1];
- dbg ("adding queue with uri='%s' ppd='%s' name='%s'\n",
+ log_it ("adding queue with uri='%s' ppd='%s' name='%s'\n",
uri, ppd_file, printer_name);
g_snprintf (local_uri, sizeof local_uri - 1,
"ipp://localhost/printers/%s", printer_name);
@@ -907,12 +912,14 @@
ippAddBoolean (request, IPP_TAG_PRINTER, "printer-is-accepting-jobs", 1);
ippAddInteger(request, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-state",
IPP_PRINTER_IDLE);
- ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_NAME,
- "printer-op-policy", NULL, g_strdup (config->default_policy));
+
+ if (config->default_policy)
+ ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_NAME,
+ "printer-op-policy", NULL, g_strdup (config->default_policy));
response = cupsDoRequest (global_cups_connection, request, "/");
if (!response || response->request.status.status_code > IPP_OK_CONFLICT) {
- err ("Failed to add new printer queue\n");
+ log_it ("Failed to add new printer queue\n");
goto done;
}
@@ -939,10 +946,10 @@
ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, local_uri);
- dbg ("attempting to remove '%s'\n", local_uri);
+ log_it ("attempting to remove '%s'\n", local_uri);
response = cupsDoRequest (global_cups_connection, request, "/");
if (!response || response->request.status.status_code > IPP_OK_CONFLICT) {
- err ("Failed to remove printer\n");
+ log_it ("Failed to remove printer\n");
goto done;
}
@@ -972,7 +979,7 @@
response = cupsDoRequest (global_cups_connection, request, "/");
if (!response || response->request.status.status_code > IPP_OK_CONFLICT) {
- err ("Failed to change printer state\n");
+ log_it ("Failed to change printer state\n");
goto done;
}
@@ -996,12 +1003,12 @@
fd = open (device, O_RDWR);
if (fd == -1) {
- err ("open failed: %s\n", strerror (errno));
+ log_it ("open failed: %s\n", strerror (errno));
return NULL;
}
if (ioctl (fd, LPIOC_GET_DEVICE_ID(1024), buff)) {
- err ("ioctl failed: %s\n", strerror (errno));
+ log_it ("ioctl failed: %s\n", strerror (errno));
close (fd);
return NULL;
}
@@ -1023,7 +1030,7 @@
get_detected_printers (&detected);
if (!detected) {
- err ("There are no local printers detected\n");
+ log_it ("There are no local printers detected\n");
return NULL;
}
@@ -1041,15 +1048,15 @@
if (ieee_id) {
gboolean match = match_by_1284 (pi->device_id, ieee_id);
- dbg ("Trying to match 1284 ids '%s' and '%s'\n", pi->device_id, ieee_id);
+ log_it ("Trying to match 1284 ids '%s' and '%s'\n", pi->device_id, ieee_id);
g_free (ieee_id);
if (match) {
- dbg ("1284 ids matched for '%s' and '%s'\n", pi->uri, hp->uri);
+ log_it ("1284 ids matched for '%s' and '%s'\n", pi->uri, hp->uri);
ret = g_strdup (pi->uri);
goto done;
} else {
- dbg ("1284 ids didn't match\n");
+ log_it ("1284 ids didn't match\n");
continue;
}
}
@@ -1057,9 +1064,9 @@
}
/* no 1284 id so we have to use string matching */
- dbg ("no 1284 ids, using string matching\n");
+ log_it ("no 1284 ids, using string matching\n");
if (printer_matches_hal_properties (pi, hp->uri + 6)) {
- dbg ("strings matched hal uri '%s'\n", hp->uri);
+ log_it ("strings matched hal uri '%s'\n", hp->uri);
ret = g_strdup (pi->uri);
break;
}
@@ -1091,7 +1098,7 @@
request = ippNewRequest (CUPS_GET_PPDS);
response = cupsDoRequest (global_cups_connection, request, "/");
if (!response || response->request.status.status_code > IPP_OK_CONFLICT) {
- err ("Failed to get ppds\n");
+ log_it ("Failed to get ppds\n");
goto done;
}
@@ -1115,7 +1122,7 @@
}
}
- dbg ("find_matching_ppd: comparing '%s' and '%s'\n", mm, make_and_model);
+ log_it ("find_matching_ppd: comparing '%s' and '%s'\n", mm, make_and_model);
if (!g_ascii_strcasecmp (mm, make_and_model)) {
ppd = g_strdup (name);
break;
@@ -1151,19 +1158,19 @@
if (!usb_uri)
continue;
- dbg ("hal uri '%s' matched uri '%s'\n", tmp->uri, usb_uri);
+ log_it ("hal uri '%s' matched uri '%s'\n", tmp->uri, usb_uri);
ppd_file = find_matching_ppd (tmp->make_and_model);
if (!ppd_file) {
- err ("Failed to find matching ppd for '%s' '%s'\n", tmp->uri, tmp->make_and_model);
+ log_it ("Failed to find matching ppd for '%s' '%s'\n", tmp->uri, tmp->make_and_model);
goto done;
}
- dbg ("Found matching ppd '%s'\n", ppd_file);
+ log_it ("Found matching ppd '%s'\n", ppd_file);
if (!remove_print_queue (tmp->name)) {
- err ("Failed to remove hal print queue\n");
+ log_it ("Failed to remove hal print queue\n");
} else {
if (!add_print_queue (usb_uri, ppd_file, tmp->name)) {
- err ("Failed to add usb print queue\n");
+ log_it ("Failed to add usb print queue\n");
}
}
@@ -1199,7 +1206,7 @@
get_cups_printers (&configured);
get_detected_printers (&detected);
if (!detected) {
- err ("Failed to detect backend printers\n");
+ log_it ("Failed to detect backend printers\n");
goto done;
}
@@ -1224,7 +1231,7 @@
}
if (!new_printer) {
- err ("Failed to find a printer that matches HAL properties\n");
+ log_it ("Failed to find a printer that matches HAL properties\n");
continue;
}
@@ -1239,24 +1246,25 @@
/* make sure this printer is enabled */
if (old_printer) {
- dbg ("Enabling old printer '%s'\n", old_printer->name);
+ log_it ("Enabling old printer '%s'\n", old_printer->name);
set_printer_status (old_printer->name, TRUE);
+ set_printer_configured_existing_property (printers[i], name);
continue;
}
/* try and find a ppd for the new printer */
ppd = get_best_ppd (new_printer);
if (!ppd) {
- err ("Failed to find PPD file for printer\n");
+ log_it ("Failed to find PPD file for printer\n");
continue;
}
- dbg ("selected ppd file is '%s'\n", ppd);
+ log_it ("selected ppd file is '%s'\n", ppd);
name = generate_printer_name (new_printer, configured);
if (add_print_queue (new_printer->uri, ppd, name)) {
set_printer_configured_property (printers[i], name);
} else {
- err ("Failed to add print queue\n");
+ log_it ("Failed to add print queue\n");
}
g_free (ppd);
@@ -1340,7 +1348,6 @@
{
GOptionContext *ctx = NULL;
GError *err = NULL;
- gchar *debug = NULL;
DBusError error;
gboolean add_cmd = FALSE, disable_cmd = FALSE;
gboolean ret = FALSE, is_add_enabled = FALSE, migrate = FALSE;
@@ -1349,7 +1356,6 @@
{ "add", 0, 0, G_OPTION_ARG_NONE, &add_cmd, "Add new printers", NULL },
{ "disable", 0, 0, G_OPTION_ARG_NONE, &disable_cmd,
"Disable printers that aren't connected", NULL },
- { "debug", 0, 0, G_OPTION_ARG_NONE, &enable_debug, "Enable debugging output", NULL },
{ "migrate-hal-printers", 0, 0, G_OPTION_ARG_NONE, &migrate, "Migrate HAL backend printers", NULL },
{ "is-add-enabled", 0, 0, G_OPTION_ARG_NONE, &is_add_enabled,
"Check if the ConfigureNewPrinters option is set", NULL },
@@ -1366,33 +1372,30 @@
ctx = g_option_context_new ("");
g_option_context_add_main_entries (ctx, entries, NULL);
if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
- err ("parsing failed: %s\n", err->message);
+ log_it ("parsing failed: %s\n", err->message);
g_error_free (err);
goto done;
}
if (geteuid () != 0) {
- err ("You must be root to run %s\n", argv[0]);
+ log_it ("You must be root to run %s\n", argv[0]);
goto done;
}
if (!load_config ()) {
- err ("Failed to load config file\n");
+ log_it ("Failed to load config file\n");
goto done;
}
load_vendor_mappings ();
- if (config->debug)
- enable_debug = TRUE;
-
if (!cups_connect ()) {
- err ("Failed to connect to CUPS\n");
+ log_it ("Failed to connect to CUPS\n");
goto done;
}
if (!(hal_ctx = libhal_ctx_new ())) {
- err ("Unable to create HAL context\n");
+ log_it ("Unable to create HAL context\n");
goto done;
}
@@ -1400,13 +1403,13 @@
libhal_ctx_set_dbus_connection (hal_ctx, dbus_bus_get (DBUS_BUS_SYSTEM, &error));
if (!libhal_ctx_init (hal_ctx, &error)) {
- err ("Unable to init HAL context: %s\n", error.message);
+ log_it ("Unable to init HAL context: %s\n", error.message);
dbus_error_free (&error);
goto done;
}
if (migrate && !migrate_hal_printers ())
- err ("Failed to migrate hal printers\n");
+ log_it ("Failed to migrate hal printers\n");
if (add_cmd) {
if (add_printers ())
@@ -1418,12 +1421,10 @@
} else if (migrate) {
/* we're only doing migration */
} else {
- /* GOption is a piece of shit */
- int ac = 2;
- argv[0] = g_strdup (argv[0]);
- argv[1] = "--help";
- g_option_context_parse (ctx, &ac, &argv, NULL);
- g_free (argv[0]);
+ /* just show the help */
+ gchar *help_txt = g_option_context_get_help (ctx, FALSE, NULL);
+ g_printerr ("%s\n", help_txt);
+ g_free (help_txt);
}
done:
@@ -1432,9 +1433,10 @@
libhal_ctx_free (hal_ctx);
}
- g_free (debug);
cups_disconnect ();
- g_option_context_free (ctx);
+
+ if (ctx)
+ g_option_context_free (ctx);
if (config)
free_config ();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-autoconfig-0.1.0/src/Makefile.am new/cups-autoconfig-0.1.0/src/Makefile.am
--- old/cups-autoconfig-0.1.0/src/Makefile.am 2007-07-27 17:48:11.000000000 +0200
+++ new/cups-autoconfig-0.1.0/src/Makefile.am 2007-09-28 09:00:13.000000000 +0200
@@ -11,7 +11,7 @@
cups_autoconfig_CFLAGS = $(AM_CFLAGS) $(WARNING_FLAGS) $(PROG_CFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) $(HAL_CFLAGS)
install-data-hook:
- mkdir $(DESTDIR)/$(libdir)/hal
+ mkdir -p $(DESTDIR)/$(libdir)/hal
ln -sf $(libdir)/cups-autoconfig/cups-autoconfig $(DESTDIR)$(libdir)/hal/hal-cups-autoconfig
CLEANFILES = $(sbin_PROGRAMS)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0