[PATCH] Expand the use of ANACONDA_WIDGETS_DATADIR.
by David Shea
Moved all the pixmaps into widgets/data, since it's the widgets that use
them. Added a check for $ANACONDA_WIDGETS_DATADIR wherever the pixmap
names are referenced, using the function that was in tz.c. Added a
missing g_free to tz.c while I was at it.
---
configure.ac | 1 -
data/Makefile.am | 2 +-
data/pixmaps/Makefile.am | 23 ----
data/pixmaps/anaconda-selected-icon.svg | 136 ---------------------
data/pixmaps/anaconda_spoke_header.png | Bin 183 -> 0 bytes
data/pixmaps/dialog-warning-symbolic.svg | 30 -----
data/pixmaps/left-arrow-icon.png | Bin 286 -> 0 bytes
data/pixmaps/right-arrow-icon.png | Bin 499 -> 0 bytes
.../ui/gui/spokes/lib/lang_locale_handler.py | 6 +-
scripts/makeupdates | 2 +
widgets/configure.ac | 1 +
widgets/data/Makefile.am | 2 +-
widgets/data/pixmaps/Makefile.am | 23 ++++
widgets/data/pixmaps/anaconda-selected-icon.svg | 136 +++++++++++++++++++++
widgets/data/pixmaps/anaconda_spoke_header.png | Bin 0 -> 183 bytes
widgets/data/pixmaps/dialog-warning-symbolic.svg | 30 +++++
widgets/data/pixmaps/left-arrow-icon.png | Bin 0 -> 286 bytes
widgets/data/pixmaps/right-arrow-icon.png | Bin 0 -> 499 bytes
widgets/src/DiskOverview.c | 6 +-
widgets/src/Makefile.am | 4 +-
widgets/src/MountpointSelector.c | 9 +-
widgets/src/SpokeSelector.c | 6 +-
widgets/src/SpokeWindow.c | 6 +-
widgets/src/tz.c | 16 +--
widgets/src/widgets-common.c | 38 ++++++
widgets/src/widgets-common.h | 31 +++++
26 files changed, 293 insertions(+), 215 deletions(-)
delete mode 100644 data/pixmaps/Makefile.am
delete mode 100644 data/pixmaps/anaconda-selected-icon.svg
delete mode 100644 data/pixmaps/anaconda_spoke_header.png
delete mode 100644 data/pixmaps/dialog-warning-symbolic.svg
delete mode 100644 data/pixmaps/left-arrow-icon.png
delete mode 100644 data/pixmaps/right-arrow-icon.png
create mode 100644 widgets/data/pixmaps/Makefile.am
create mode 100644 widgets/data/pixmaps/anaconda-selected-icon.svg
create mode 100644 widgets/data/pixmaps/anaconda_spoke_header.png
create mode 100644 widgets/data/pixmaps/dialog-warning-symbolic.svg
create mode 100644 widgets/data/pixmaps/left-arrow-icon.png
create mode 100644 widgets/data/pixmaps/right-arrow-icon.png
create mode 100644 widgets/src/widgets-common.c
create mode 100644 widgets/src/widgets-common.h
diff --git a/configure.ac b/configure.ac
index 9199354..9fbc2fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -233,7 +233,6 @@ AC_CONFIG_FILES([Makefile
data/liveinst/console.apps/Makefile
data/liveinst/gnome/Makefile
data/liveinst/pam.d/Makefile
- data/pixmaps/Makefile
data/icons/Makefile
data/icons/hicolor/Makefile
data/icons/hicolor/16x16/Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
index 1c08ed2..cfafb47 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -17,7 +17,7 @@
#
# Author: Martin Sivak <msivak(a)redhat.com>
-SUBDIRS = command-stubs icons liveinst pixmaps systemd post-scripts
+SUBDIRS = command-stubs icons liveinst systemd post-scripts
CLEANFILES = *~
diff --git a/data/pixmaps/Makefile.am b/data/pixmaps/Makefile.am
deleted file mode 100644
index 2b95c4d..0000000
--- a/data/pixmaps/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-# pixmaps/Makefile.am for anaconda
-#
-# Copyright (C) 2009 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published
-# by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author: David Cantrell <dcantrell(a)redhat.com>
-
-pixmapsdir = $(datadir)/$(PACKAGE_NAME)/pixmaps
-dist_pixmaps_DATA = $(srcdir)/*.png $(srcdir)/*.svg
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/data/pixmaps/anaconda-selected-icon.svg b/data/pixmaps/anaconda-selected-icon.svg
deleted file mode 100644
index 32c90fd..0000000
--- a/data/pixmaps/anaconda-selected-icon.svg
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- id="svg7384"
- sodipodi:docname="anaconda-selected-icon.svg"
- version="1.1"
- inkscape:version="0.48+devel r11963"
- height="16"
- width="16">
- <metadata
- id="metadata90">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title>Gnome Symbolic Icon Theme</dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <sodipodi:namedview
- inkscape:cy="6.5413406"
- pagecolor="#ffffff"
- borderopacity="1"
- showborder="true"
- inkscape:bbox-paths="false"
- guidetolerance="10"
- inkscape:object-paths="true"
- inkscape:window-width="1145"
- showguides="true"
- inkscape:object-nodes="true"
- inkscape:snap-bbox="true"
- inkscape:pageshadow="2"
- inkscape:guide-bbox="true"
- inkscape:snap-nodes="false"
- bordercolor="#666666"
- objecttolerance="10"
- id="namedview88"
- showgrid="false"
- inkscape:window-maximized="0"
- inkscape:window-x="201"
- inkscape:snap-global="true"
- inkscape:window-y="27"
- gridtolerance="10"
- inkscape:window-height="709"
- inkscape:snap-to-guides="true"
- inkscape:current-layer="layer15"
- inkscape:snap-bbox-midpoints="false"
- inkscape:zoom="16"
- inkscape:cx="6.9516857"
- inkscape:snap-grids="true"
- inkscape:pageopacity="0"
- borderlayer="true">
- <inkscape:grid
- spacingx="1px"
- spacingy="1px"
- id="grid4866"
- empspacing="2"
- enabled="true"
- type="xygrid"
- snapvisiblegridlinesonly="true"
- visible="true" />
- </sodipodi:namedview>
- <title
- id="title9167">Gnome Symbolic Icon Theme</title>
- <defs
- id="defs7386" />
- <g
- inkscape:label="status"
- transform="translate(-482,-381.99998)"
- inkscape:groupmode="layer"
- id="layer9"
- style="display:inline" />
- <g
- inkscape:label="devices"
- transform="translate(-482,-381.99998)"
- inkscape:groupmode="layer"
- id="layer10" />
- <g
- inkscape:label="apps"
- transform="translate(-482,-381.99998)"
- inkscape:groupmode="layer"
- id="layer11" />
- <g
- inkscape:label="actions"
- transform="translate(-482,-381.99998)"
- inkscape:groupmode="layer"
- id="layer12" />
- <g
- inkscape:label="places"
- transform="translate(-482,-381.99998)"
- inkscape:groupmode="layer"
- id="layer13" />
- <g
- inkscape:label="mimetypes"
- transform="translate(-482,-381.99998)"
- inkscape:groupmode="layer"
- id="layer14" />
- <g
- inkscape:label="emblems"
- transform="translate(-482,-381.99998)"
- inkscape:groupmode="layer"
- id="layer15"
- style="display:inline">
- <g
- inkscape:label="emblem-important"
- transform="translate(135.8093,-581.17812)"
- id="g17779" />
- <path
- style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- d="M 11.53125 4.3125 C 11.784964 4.3148534 12.043986 4.3496993 12.28125 4.40625 C 12.035802 4.3478581 11.794428 4.3125 11.53125 4.3125 z M 12.28125 4.40625 C 12.505761 4.4597611 12.733193 4.5282014 12.9375 4.625 C 12.73111 4.5265635 12.508413 4.460292 12.28125 4.40625 z M 13.6875 5.125 C 13.850992 5.2667533 13.991932 5.4225624 14.125 5.59375 C 13.993811 5.4260074 13.847799 5.2645304 13.6875 5.125 z M 14.125 5.59375 L 11.71875 7.90625 L 10.8125 6.90625 L 9.78125 7.90625 L 11.71875 9.84375 L 14.78125 7.09375 C 14.688509 6.5295894 14.461839 6.0244437 14.125 5.59375 z M 14.84375 7.625 C 14.84375 8.544865 14.444846 9.3969938 13.84375 10 C 14.452893 9.395735 14.84375 8.5537662 14.84375 7.625 z "
- transform="translate(482,381.99998)"
- id="path1012" />
- <path
- inkscape:connector-curvature="0"
- d="m 493.51417,386.30805 c -1.82723,0 -3.30412,1.49216 -3.30412,3.33188 0,1.83973 1.47689,3.33189 3.30412,3.33189 1.82723,0 3.318,-1.49216 3.318,-3.33189 0,-0.18508 -0.0267,-0.36456 -0.0555,-0.54143 l -3.06223,2.74335 -1.92929,-1.93014 1.01176,-0.99284 0.91795,0.98022 2.40931,-2.31382 C 495.51856,386.80617 494.57294,386.30805 493.51417,386.30805 Z"
- id="path74"
- sodipodi:nodetypes="ssssccccccs"
- style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline" />
- </g>
- <g
- inkscape:label="categories"
- transform="translate(-482,-381.99998)"
- inkscape:groupmode="layer"
- id="g4953"
- style="display:inline" />
-</svg>
diff --git a/data/pixmaps/anaconda_spoke_header.png b/data/pixmaps/anaconda_spoke_header.png
deleted file mode 100644
index 492be50..0000000
Binary files a/data/pixmaps/anaconda_spoke_header.png and /dev/null differ
diff --git a/data/pixmaps/dialog-warning-symbolic.svg b/data/pixmaps/dialog-warning-symbolic.svg
deleted file mode 100644
index d89a442..0000000
--- a/data/pixmaps/dialog-warning-symbolic.svg
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' version='1.1' inkscape:version='0.47 r22583' height='16' sodipodi:docname='dialog-warning-symbolic.svg' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'>
- <metadata id='metadata90'>
- <rdf:RDF>
- <cc:Work rdf:about=''>
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/>
- <dc:title>Gnome Symbolic Icon Theme</dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <sodipodi:namedview inkscape:cy='-15.45876' inkscape:current-layer='layer9' inkscape:window-width='1310' pagecolor='#555753' showborder='false' showguides='true' inkscape:snap-nodes='true' objecttolerance='10' showgrid='false' inkscape:object-nodes='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:window-x='58' inkscape:snap-bbox='true' bordercolor='#666666' id='namedview88' inkscape:window-maximized='0' inkscape:snap-global='true' inkscape:window-y='353' gridtolerance='10' inkscape:zoom='1' inkscape:window-height='690' borderopacity='1' guidetolerance='10' inkscape:cx='-6.85259' inkscape:bbox-paths='false' inkscape:snap-grids='true' inkscape:pageopacity='1' inkscape:snap-to-guides='true'>
- <inkscape:grid visible='true' spacingx='1px' type='xygrid' spacingy='1px' id='grid4866' empspacing='2' enabled='true' snapvisiblegridlinesonly='true'/>
- </sodipodi:namedview>
- <title id='title9167'>Gnome Symbolic Icon Theme</title>
- <defs id='defs7386'/>
- <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline'>
-
- <path inkscape:connector-curvature='0' class='warning' d='m 308.91905,257.09375 c -0.5255,-0.0286 -1.03823,0.28305 -1.4375,0.96875 l -6.25,11.59375 C 300.69808,270.61964 301.27977,272 302.3253,272 l 13.15625,0 c 0.98172,0 1.90311,-1.15939 1.21875,-2.34375 L 310.3878,258.125 c -0.39872,-0.64617 -0.94325,-1.00262 -1.46875,-1.03125 z m -0.0313,3.9375 c 0.54448,-0.0172 1.04849,0.48677 1.03125,1.03125 l 0,3.9375 c 0.007,0.52831 -0.47163,1.01424 -1,1.01424 -0.52836,0 -1.00747,-0.48593 -1,-1.01424 l 0,-3.9375 c -0.008,-0.4666 0.3541,-0.91253 0.8125,-1 0.0511,-0.0145 0.10345,-0.025 0.15625,-0.0313 z m -0.9687,6.96875 2,0 0,2 -2,0 0,-2 z' id='path18112' sodipodi:nodetypes='cccccccccccsccscccccc' style='color:#bebebe;fill:#f57900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new'/>
- </g>
- <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer10' inkscape:label='devices'/>
- <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer11' inkscape:label='apps'/>
- <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer12' inkscape:label='actions'/>
- <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer13' inkscape:label='places'/>
- <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes'/>
- <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline'/>
- <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline'/>
-</svg>
diff --git a/data/pixmaps/left-arrow-icon.png b/data/pixmaps/left-arrow-icon.png
deleted file mode 100644
index fc25a91..0000000
Binary files a/data/pixmaps/left-arrow-icon.png and /dev/null differ
diff --git a/data/pixmaps/right-arrow-icon.png b/data/pixmaps/right-arrow-icon.png
deleted file mode 100644
index 371f503..0000000
Binary files a/data/pixmaps/right-arrow-icon.png and /dev/null differ
diff --git a/pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py b/pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py
index 22dbbce..598851c 100644
--- a/pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py
+++ b/pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py
@@ -24,6 +24,7 @@ screens handling languages or locales configuration.
"""
+import os
from gi.repository import Gtk, Pango
from pyanaconda import localization
from pyanaconda.iutil import strip_accents
@@ -54,10 +55,11 @@ class LangLocaleHandler(object):
def initialize(self):
# Render an arrow for the chosen language
+ datadir = os.environ.get("ANACONDA_WIDGETS_DATADIR", "/usr/share/anaconda")
if get_default_widget_direction() == Gtk.TextDirection.LTR:
- self._arrow = Gtk.Image.new_from_file("/usr/share/anaconda/pixmaps/right-arrow-icon.png")
+ self._arrow = Gtk.Image.new_from_file(os.path.join(datadir, "pixmaps", "right-arrow-icon.png"))
else:
- self._arrow = Gtk.Image.new_from_file("/usr/share/anaconda/pixmaps/left-arrow-icon.png")
+ self._arrow = Gtk.Image.new_from_file(os.path.join(datadir, "pixmaps", "left-arrow-icon.png"))
self._langSelectedColumn.set_cell_data_func(self._langSelectedRenderer,
self._render_lang_selected)
diff --git a/scripts/makeupdates b/scripts/makeupdates
index dbb86c5..c87ffc8 100755
--- a/scripts/makeupdates
+++ b/scripts/makeupdates
@@ -267,6 +267,8 @@ def copyUpdatedFiles(tag, updates, cwd):
install_to_dir(gitfile, "usr/sbin")
elif gitfile.startswith("data/pixmaps"):
install_to_dir(gitfile, "usr/share/anaconda/pixmaps")
+ elif gitfile.startswith("widgets/data/pixmaps"):
+ install_to_dir(gitfile, "usr/share/anaconda/pixmaps")
elif gitfile.startswith("data/ui/"):
install_to_dir(gitfile, "usr/share/anaconda/ui")
elif gitfile.startswith("data/post-scripts/"):
diff --git a/widgets/configure.ac b/widgets/configure.ac
index a87e79f..fe8ab9f 100644
--- a/widgets/configure.ac
+++ b/widgets/configure.ac
@@ -69,5 +69,6 @@ AC_CONFIG_FILES([Makefile
src/Makefile
python/Makefile
data/Makefile
+ data/pixmaps/Makefile
data/tzmapdata/Makefile])
AC_OUTPUT
diff --git a/widgets/data/Makefile.am b/widgets/data/Makefile.am
index 0f106d5..fb25e03 100644
--- a/widgets/data/Makefile.am
+++ b/widgets/data/Makefile.am
@@ -18,6 +18,6 @@
# Red Hat Author(s): Vratislav Podzimek <vpodzime(a)redhat.com>
#
-SUBDIRS = tzmapdata
+SUBDIRS = tzmapdata pixmaps
MAINTAINERCLEANFILES = Makefile.in
diff --git a/widgets/data/pixmaps/Makefile.am b/widgets/data/pixmaps/Makefile.am
new file mode 100644
index 0000000..fb9ee01
--- /dev/null
+++ b/widgets/data/pixmaps/Makefile.am
@@ -0,0 +1,23 @@
+# pixmaps/Makefile.am for anaconda
+#
+# Copyright (C) 2009 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published
+# by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Author: David Cantrell <dcantrell(a)redhat.com>
+
+pixmapsdir = $(datadir)/anaconda/pixmaps
+dist_pixmaps_DATA = $(srcdir)/*.png $(srcdir)/*.svg
+
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/widgets/data/pixmaps/anaconda-selected-icon.svg b/widgets/data/pixmaps/anaconda-selected-icon.svg
new file mode 100644
index 0000000..32c90fd
--- /dev/null
+++ b/widgets/data/pixmaps/anaconda-selected-icon.svg
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ id="svg7384"
+ sodipodi:docname="anaconda-selected-icon.svg"
+ version="1.1"
+ inkscape:version="0.48+devel r11963"
+ height="16"
+ width="16">
+ <metadata
+ id="metadata90">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title>Gnome Symbolic Icon Theme</dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:cy="6.5413406"
+ pagecolor="#ffffff"
+ borderopacity="1"
+ showborder="true"
+ inkscape:bbox-paths="false"
+ guidetolerance="10"
+ inkscape:object-paths="true"
+ inkscape:window-width="1145"
+ showguides="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-bbox="true"
+ inkscape:pageshadow="2"
+ inkscape:guide-bbox="true"
+ inkscape:snap-nodes="false"
+ bordercolor="#666666"
+ objecttolerance="10"
+ id="namedview88"
+ showgrid="false"
+ inkscape:window-maximized="0"
+ inkscape:window-x="201"
+ inkscape:snap-global="true"
+ inkscape:window-y="27"
+ gridtolerance="10"
+ inkscape:window-height="709"
+ inkscape:snap-to-guides="true"
+ inkscape:current-layer="layer15"
+ inkscape:snap-bbox-midpoints="false"
+ inkscape:zoom="16"
+ inkscape:cx="6.9516857"
+ inkscape:snap-grids="true"
+ inkscape:pageopacity="0"
+ borderlayer="true">
+ <inkscape:grid
+ spacingx="1px"
+ spacingy="1px"
+ id="grid4866"
+ empspacing="2"
+ enabled="true"
+ type="xygrid"
+ snapvisiblegridlinesonly="true"
+ visible="true" />
+ </sodipodi:namedview>
+ <title
+ id="title9167">Gnome Symbolic Icon Theme</title>
+ <defs
+ id="defs7386" />
+ <g
+ inkscape:label="status"
+ transform="translate(-482,-381.99998)"
+ inkscape:groupmode="layer"
+ id="layer9"
+ style="display:inline" />
+ <g
+ inkscape:label="devices"
+ transform="translate(-482,-381.99998)"
+ inkscape:groupmode="layer"
+ id="layer10" />
+ <g
+ inkscape:label="apps"
+ transform="translate(-482,-381.99998)"
+ inkscape:groupmode="layer"
+ id="layer11" />
+ <g
+ inkscape:label="actions"
+ transform="translate(-482,-381.99998)"
+ inkscape:groupmode="layer"
+ id="layer12" />
+ <g
+ inkscape:label="places"
+ transform="translate(-482,-381.99998)"
+ inkscape:groupmode="layer"
+ id="layer13" />
+ <g
+ inkscape:label="mimetypes"
+ transform="translate(-482,-381.99998)"
+ inkscape:groupmode="layer"
+ id="layer14" />
+ <g
+ inkscape:label="emblems"
+ transform="translate(-482,-381.99998)"
+ inkscape:groupmode="layer"
+ id="layer15"
+ style="display:inline">
+ <g
+ inkscape:label="emblem-important"
+ transform="translate(135.8093,-581.17812)"
+ id="g17779" />
+ <path
+ style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 11.53125 4.3125 C 11.784964 4.3148534 12.043986 4.3496993 12.28125 4.40625 C 12.035802 4.3478581 11.794428 4.3125 11.53125 4.3125 z M 12.28125 4.40625 C 12.505761 4.4597611 12.733193 4.5282014 12.9375 4.625 C 12.73111 4.5265635 12.508413 4.460292 12.28125 4.40625 z M 13.6875 5.125 C 13.850992 5.2667533 13.991932 5.4225624 14.125 5.59375 C 13.993811 5.4260074 13.847799 5.2645304 13.6875 5.125 z M 14.125 5.59375 L 11.71875 7.90625 L 10.8125 6.90625 L 9.78125 7.90625 L 11.71875 9.84375 L 14.78125 7.09375 C 14.688509 6.5295894 14.461839 6.0244437 14.125 5.59375 z M 14.84375 7.625 C 14.84375 8.544865 14.444846 9.3969938 13.84375 10 C 14.452893 9.395735 14.84375 8.5537662 14.84375 7.625 z "
+ transform="translate(482,381.99998)"
+ id="path1012" />
+ <path
+ inkscape:connector-curvature="0"
+ d="m 493.51417,386.30805 c -1.82723,0 -3.30412,1.49216 -3.30412,3.33188 0,1.83973 1.47689,3.33189 3.30412,3.33189 1.82723,0 3.318,-1.49216 3.318,-3.33189 0,-0.18508 -0.0267,-0.36456 -0.0555,-0.54143 l -3.06223,2.74335 -1.92929,-1.93014 1.01176,-0.99284 0.91795,0.98022 2.40931,-2.31382 C 495.51856,386.80617 494.57294,386.30805 493.51417,386.30805 Z"
+ id="path74"
+ sodipodi:nodetypes="ssssccccccs"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline" />
+ </g>
+ <g
+ inkscape:label="categories"
+ transform="translate(-482,-381.99998)"
+ inkscape:groupmode="layer"
+ id="g4953"
+ style="display:inline" />
+</svg>
diff --git a/widgets/data/pixmaps/anaconda_spoke_header.png b/widgets/data/pixmaps/anaconda_spoke_header.png
new file mode 100644
index 0000000..492be50
Binary files /dev/null and b/widgets/data/pixmaps/anaconda_spoke_header.png differ
diff --git a/widgets/data/pixmaps/dialog-warning-symbolic.svg b/widgets/data/pixmaps/dialog-warning-symbolic.svg
new file mode 100644
index 0000000..8349c5d
--- /dev/null
+++ b/widgets/data/pixmaps/dialog-warning-symbolic.svg
@@ -0,0 +1,30 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' version='1.1' inkscape:version='0.47 r22583' height='16' sodipodi:docname='dialog-warning-symbolic.svg' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'>
+ <metadata id='metadata90'>
+ <rdf:RDF>
+ <cc:Work rdf:about=''>
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/>
+ <dc:title>Gnome Symbolic Icon Theme</dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview inkscape:cy='-15.45876' inkscape:current-layer='layer9' inkscape:window-width='1310' pagecolor='#555753' showborder='false' showguides='true' inkscape:snap-nodes='true' objecttolerance='10' showgrid='false' inkscape:object-nodes='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:window-x='58' inkscape:snap-bbox='true' bordercolor='#666666' id='namedview88' inkscape:window-maximized='0' inkscape:snap-global='true' inkscape:window-y='353' gridtolerance='10' inkscape:zoom='1' inkscape:window-height='690' borderopacity='1' guidetolerance='10' inkscape:cx='-6.85259' inkscape:bbox-paths='false' inkscape:snap-grids='true' inkscape:pageopacity='1' inkscape:snap-to-guides='true'>
+ <inkscape:grid visible='true' spacingx='1px' type='xygrid' spacingy='1px' id='grid4866' empspacing='2' enabled='true' snapvisiblegridlinesonly='true'/>
+ </sodipodi:namedview>
+ <title id='title9167'>Gnome Symbolic Icon Theme</title>
+ <defs id='defs7386'/>
+ <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline'>
+
+ <path inkscape:connector-curvature='0' class='warning' d='m 308.91905,257.09375 c -0.5255,-0.0286 -1.03823,0.28305 -1.4375,0.96875 l -6.25,11.59375 C 300.69808,270.61964 301.27977,272 302.3253,272 l 13.15625,0 c 0.98172,0 1.90311,-1.15939 1.21875,-2.34375 L 310.3878,258.125 c -0.39872,-0.64617 -0.94325,-1.00262 -1.46875,-1.03125 z m -0.0313,3.9375 c 0.54448,-0.0172 1.04849,0.48677 1.03125,1.03125 l 0,3.9375 c 0.007,0.52831 -0.47163,1.01424 -1,1.01424 -0.52836,0 -1.00747,-0.48593 -1,-1.01424 l 0,-3.9375 c -0.008,-0.4666 0.3541,-0.91253 0.8125,-1 0.0511,-0.0145 0.10345,-0.025 0.15625,-0.0313 z m -0.9687,6.96875 2,0 0,2 -2,0 0,-2 z' id='path18112' sodipodi:nodetypes='cccccccccccsccscccccc' style='color:#bebebe;fill:#f57900;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new'/>
+ </g>
+ <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer10' inkscape:label='devices'/>
+ <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer11' inkscape:label='apps'/>
+ <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer12' inkscape:label='actions'/>
+ <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer13' inkscape:label='places'/>
+ <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes'/>
+ <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline'/>
+ <g transform='translate(-301,-257)' inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline'/>
+</svg>
diff --git a/widgets/data/pixmaps/left-arrow-icon.png b/widgets/data/pixmaps/left-arrow-icon.png
new file mode 100644
index 0000000..fc25a91
Binary files /dev/null and b/widgets/data/pixmaps/left-arrow-icon.png differ
diff --git a/widgets/data/pixmaps/right-arrow-icon.png b/widgets/data/pixmaps/right-arrow-icon.png
new file mode 100644
index 0000000..371f503
Binary files /dev/null and b/widgets/data/pixmaps/right-arrow-icon.png differ
diff --git a/widgets/src/DiskOverview.c b/widgets/src/DiskOverview.c
index 52d12ab..aa39538 100644
--- a/widgets/src/DiskOverview.c
+++ b/widgets/src/DiskOverview.c
@@ -23,6 +23,7 @@
#include "DiskOverview.h"
#include "intl.h"
+#include "widgets-common.h"
/**
* SECTION: DiskOverview
@@ -210,6 +211,7 @@ static void set_icon(AnacondaDiskOverview *widget, const char *icon_name) {
GError *err = NULL;
GIcon *base_icon, *emblem_icon, *icon;
GEmblem *emblem = NULL;
+ gchar *file;
if (!icon_name)
return;
@@ -225,7 +227,9 @@ static void set_icon(AnacondaDiskOverview *widget, const char *icon_name) {
return;
}
- emblem_icon = g_icon_new_for_string("/usr/share/anaconda/pixmaps/anaconda-selected-icon.svg", &err);
+ file = g_strdup_printf("%s/pixmaps/anaconda-selected-icon.svg", get_widgets_datadir());
+ emblem_icon = g_icon_new_for_string(file, &err);
+ g_free(file);
if (!emblem_icon) {
fprintf(stderr, "could not create emblem: %s\n", err->message);
g_error_free(err);
diff --git a/widgets/src/Makefile.am b/widgets/src/Makefile.am
index 689207e..81885c2 100644
--- a/widgets/src/Makefile.am
+++ b/widgets/src/Makefile.am
@@ -47,9 +47,9 @@ GIHDRS = BaseWindow.h \
LayoutIndicator.h \
Lightbox.h
-NONGISOURCES = tz.c
+NONGISOURCES = tz.c widgets-common.c
-NONGIHDRS = tz.h
+NONGIHDRS = tz.h widgets-common.h
SOURCES = $(GISOURCES) $(NONGISOURCES)
diff --git a/widgets/src/MountpointSelector.c b/widgets/src/MountpointSelector.c
index d4945ca..e14072b 100644
--- a/widgets/src/MountpointSelector.c
+++ b/widgets/src/MountpointSelector.c
@@ -25,6 +25,7 @@
#include "MountpointSelector.h"
#include "intl.h"
+#include "widgets-common.h"
/**
* SECTION: MountpointSelector
@@ -176,6 +177,8 @@ static GtkTextDirection get_default_widget_direction() {
}
static void anaconda_mountpoint_selector_init(AnacondaMountpointSelector *mountpoint) {
+ gchar *file;
+
mountpoint->priv = G_TYPE_INSTANCE_GET_PRIVATE(mountpoint,
ANACONDA_TYPE_MOUNTPOINT_SELECTOR,
AnacondaMountpointSelectorPrivate);
@@ -200,9 +203,11 @@ static void anaconda_mountpoint_selector_init(AnacondaMountpointSelector *mountp
* case. That's good enough error notification.
*/
if (get_default_widget_direction() == GTK_TEXT_DIR_LTR)
- mountpoint->priv->arrow = gtk_image_new_from_file("/usr/share/anaconda/pixmaps/right-arrow-icon.png");
+ file = g_strdup_printf("%s/pixmaps/right-arrow-icon.png", get_widgets_datadir());
else
- mountpoint->priv->arrow = gtk_image_new_from_file("/usr/share/anaconda/pixmaps/left-arrow-icon.png");
+ file = g_strdup_printf("%s/pixmaps/left-arrow-icon.png", get_widgets_datadir());
+ mountpoint->priv->arrow = gtk_image_new_from_file(file);
+ g_free(file);
gtk_widget_set_no_show_all(GTK_WIDGET(mountpoint->priv->arrow), TRUE);
/* Set some properties. */
diff --git a/widgets/src/SpokeSelector.c b/widgets/src/SpokeSelector.c
index 8d3b645..4786f11 100644
--- a/widgets/src/SpokeSelector.c
+++ b/widgets/src/SpokeSelector.c
@@ -24,6 +24,7 @@
#include "SpokeSelector.h"
#include "intl.h"
+#include "widgets-common.h"
/**
* SECTION: SpokeSelector
@@ -193,6 +194,7 @@ static void set_icon(AnacondaSpokeSelector *widget, const char *icon_name) {
GtkIconTheme *icon_theme;
GtkIconInfo *icon_info;
GdkPixbuf *pixbuf;
+ gchar *file;
if (!icon_name)
return;
@@ -208,7 +210,9 @@ static void set_icon(AnacondaSpokeSelector *widget, const char *icon_name) {
return;
}
- emblem_icon = g_icon_new_for_string("/usr/share/anaconda/pixmaps/dialog-warning-symbolic.svg", &err);
+ file = g_strdup_printf("%s/pixmaps/dialog-warning-symbolic.svg", get_widgets_datadir());
+ emblem_icon = g_icon_new_for_string(file, &err);
+ g_free(file);
if (!emblem_icon) {
fprintf(stderr, "could not create emblem: %s\n", err->message);
g_error_free(err);
diff --git a/widgets/src/SpokeWindow.c b/widgets/src/SpokeWindow.c
index 02779ba..6b87785 100644
--- a/widgets/src/SpokeWindow.c
+++ b/widgets/src/SpokeWindow.c
@@ -20,6 +20,7 @@
#include "BaseWindow.h"
#include "SpokeWindow.h"
#include "intl.h"
+#include "widgets-common.h"
#include <gdk/gdkkeysyms.h>
@@ -139,6 +140,7 @@ static void anaconda_spoke_window_realize(GtkWidget *widget, gpointer user_data)
cairo_pattern_t *pattern;
cairo_surface_t *surface;
cairo_t *cr;
+ gchar *file;
AnacondaSpokeWindow *window = ANACONDA_SPOKE_WINDOW(widget);
@@ -147,7 +149,9 @@ static void anaconda_spoke_window_realize(GtkWidget *widget, gpointer user_data)
* header without an image.
*/
error = NULL;
- pixbuf = gdk_pixbuf_new_from_file("/usr/share/anaconda/pixmaps/anaconda_spoke_header.png", &error);
+ file = g_strdup_printf("%s/pixmaps/anaconda_spoke_header.png", get_widgets_datadir());
+ pixbuf = gdk_pixbuf_new_from_file(file, &error);
+ g_free(file);
if (!pixbuf) {
fprintf(stderr, "could not load header background: %s\n", error->message);
g_error_free(error);
diff --git a/widgets/src/tz.c b/widgets/src/tz.c
index 54c0da5..bf551b8 100644
--- a/widgets/src/tz.c
+++ b/widgets/src/tz.c
@@ -31,6 +31,7 @@
#include <math.h>
#include <string.h>
#include "tz.h"
+#include "widgets-common.h"
/* Forward declarations for private functions */
@@ -41,20 +42,6 @@ static void sort_locations_by_country (GPtrArray *locations);
static gchar * tz_data_file_get (void);
static void load_backward_tz (TzDB *tz_db);
-/* Returns path to anaconda widgets data directory using the value of the
- * environment variable ANACONDA_WIDGETS_DATA or WIDGETS_DATADIR macro
- * (defined in Makefile.am) if the environment variable is not defined.
- */
-gchar *get_widgets_datadir() {
- gchar *env_value;
-
- env_value = getenv("ANACONDA_WIDGETS_DATA");
- if (env_value == NULL)
- return WIDGETS_DATADIR;
- else
- return env_value;
-}
-
/* ---------------- *
* Public interface *
* ---------------- */
@@ -402,6 +389,7 @@ load_backward_tz (TzDB *tz_db)
file = g_strdup_printf ("%s/" TZMAP_DATADIR "/timezones_backward", get_widgets_datadir());
if (g_file_get_contents (file, &contents, NULL, &error) == FALSE) {
g_warning ("Failed to load 'backward' file: %s", error->message);
+ g_free(file);
return;
}
g_free(file);
diff --git a/widgets/src/widgets-common.c b/widgets/src/widgets-common.c
new file mode 100644
index 0000000..c66f7ff
--- /dev/null
+++ b/widgets/src/widgets-common.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2013 Red Hat, Inc
+ *
+ * Common functions for AnacondaWidgets
+ *
+ * This program 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Author: David Shea <dshea(a)redhat.com>
+ *
+ */
+
+#include <glib.h>
+#include <stdlib.h>
+
+/* Returns path to anaconda widgets data directory using the value of the
+ * environment variable ANACONDA_WIDGETS_DATA or WIDGETS_DATADIR macro
+ * (defined in Makefile.am) if the environment variable is not defined.
+ */
+gchar *get_widgets_datadir() {
+ gchar *env_value;
+
+ env_value = getenv("ANACONDA_WIDGETS_DATA");
+ if (env_value == NULL)
+ return WIDGETS_DATADIR;
+ else
+ return env_value;
+}
diff --git a/widgets/src/widgets-common.h b/widgets/src/widgets-common.h
new file mode 100644
index 0000000..268ef13
--- /dev/null
+++ b/widgets/src/widgets-common.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2013 Red Hat, Inc.
+ *
+ * This program 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: David Shea <dshea(a)redhat.com>
+ */
+
+#ifndef _WIDGETS_COMMON_H
+#define _WIDGETS_COMMON_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+gchar *get_widgets_datadir();
+
+G_END_DECLS
+
+#endif
--
1.8.4.2
10 years, 6 months
[livecd] Changes to live image boot menus
by Adam Williamson
1/3 stops setting 'xdriver=vesa' when booting in 'basic graphics mode' -
according to ajax, this is no longer needed or desired (for BIOS or UEFI).
2/3 changes the boot menu seen when booting a live image in UEFI mode to
resemble the BIOS mode menu and the non-live menus more closely: it uses
the 'product name' to name the entries (rather than the kernel name) and
makes the 'mediacheck, then boot' entry rather than the 'just boot' entry
the default (as it is for all other cases).
3/3 adds a Troubleshooting submenu with a 'basic graphics mode' entry to
the UEFI boot menu: live UEFI boots were previously lacking this capability.
See https://bugzilla.redhat.com/show_bug.cgi?id=1009828 .
--
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net
http://www.happyassassin.net
10 years, 6 months
[master][PATCH] Run pylint in multiple processes
by Vratislav Podzimek
<not-in-the-commit-msg>
NEEDS TESTING
</not-in-the-commit-msg>
This speeds up running runpylint.sh a lot
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
tests/pylint/pylint-one.sh | 38 +++++++++++++++++++++++++++++
tests/pylint/runpylint.sh | 61 +++++++++++++++++-----------------------------
2 files changed, 61 insertions(+), 38 deletions(-)
create mode 100755 tests/pylint/pylint-one.sh
diff --git a/tests/pylint/pylint-one.sh b/tests/pylint/pylint-one.sh
new file mode 100755
index 0000000..05532e2
--- /dev/null
+++ b/tests/pylint/pylint-one.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+#
+# $1 -- python source to run pylint on
+#
+
+if [ $# -lt 1 ]; then
+ # no source, just exit
+ exit 1
+fi
+
+file_suffix="$(echo $1|sed s?/?_?g)"
+
+exec > pylint-out_$file_suffix
+
+pylint_output="$(pylint \
+ --msg-template='{msg_id}:{line:3d},{column}: {obj}: {msg}' \
+ -r n --disable=C,R --rcfile=/dev/null \
+ --dummy-variables-rgx=_ \
+ --ignored-classes=DefaultInstall,Popen,QueueFactory,TransactionSet \
+ --defining-attr-methods=__init__,_grabObjects,initialize,reset,start,setUp \
+ --load-plugins=intl \
+ $DISABLED_WARN_OPTIONS \
+ $DISABLED_ERR_OPTIONS \
+ $NON_STRICT_OPTIONS $1 2>&1 | \
+ egrep -v "$(tr '\n' '|' < "$FALSE_POSITIVES") \
+ ")"
+
+# I0011 is the informational "Locally disabling ...." message
+if [ -n "$(echo "$pylint_output" | fgrep -v '************* Module ' |\
+ grep -v '^I0011:')" ]; then
+ # Replace the Module line with the actual filename
+ pylint_output="$(echo "$pylint_output" | sed "s|\* Module .*|* Module $1|")"
+
+ if [ "$pylint_log" -ne 0 ]; then
+ echo "$pylint_output" > pylint-out_$file_suffix
+ fi
+ touch "pylint-$file_suffix-failed"
+fi
diff --git a/tests/pylint/runpylint.sh b/tests/pylint/runpylint.sh
index b0f82b7..050e58e 100755
--- a/tests/pylint/runpylint.sh
+++ b/tests/pylint/runpylint.sh
@@ -10,9 +10,9 @@
# If $top_srcdir is set, assume this is being run from automake and we don't
# need to keep a separate log
-pylint_log=0
+export pylint_log=0
if [ -z "$top_srcdir" ]; then
- pylint_log=1
+ export pylint_log=1
fi
# Unset TERM so that things that use readline don't output terminal garbage
@@ -27,15 +27,15 @@ fi
srcdir="${top_srcdir}/tests/pylint"
# Need to add the pylint module directory to PYTHONPATH as well.
-PYTHONPATH="${PYTHONPATH}:${srcdir}"
+export PYTHONPATH="${PYTHONPATH}:${srcdir}"
-FALSE_POSITIVES="${srcdir}"/pylint-false-positives
+export FALSE_POSITIVES="${srcdir}"/pylint-false-positives
# W0212 - Access to a protected member %s of a client class
-NON_STRICT_OPTIONS="--disable=W0212"
+export NON_STRICT_OPTIONS="--disable=W0212"
# E1103 - %s %r has no %r member (but some types could not be inferred)
-DISABLED_ERR_OPTIONS="--disable=E1103"
+export DISABLED_ERR_OPTIONS="--disable=E1103"
# W0110 - map/filter on lambda could be replaced by comprehension
# W0141 - Used builtin function %r
@@ -46,7 +46,7 @@ DISABLED_ERR_OPTIONS="--disable=E1103"
# W0604 - Using the global statement at the module level
# W0613 - Unused argument %r
# W0614 - Unused import %s from wildcard import
-DISABLED_WARN_OPTIONS="--disable=W0110,W0141,W0142,W0223,W0511,W0603,W0604,W0613,W0614"
+export DISABLED_WARN_OPTIONS="--disable=W0110,W0141,W0142,W0223,W0511,W0603,W0604,W0613,W0614"
usage () {
echo "usage: `basename $0` [--strict] [--help] [files...]"
@@ -57,7 +57,7 @@ FILES=
while [ $# -gt 0 ]; do
case $1 in
--strict)
- NON_STRICT_OPTIONS=
+ export NON_STRICT_OPTIONS=
;;
--help)
usage 0
@@ -76,9 +76,6 @@ if [ "`tail -c 1 $FALSE_POSITIVES`" == "`echo`" ]; then
fi
exit_status=0
-if [ "$pylint_log" -ne 0 ]; then
- > pylint-log
-fi
# run pylint one file / module at a time, otherwise it sometimes gets
# confused
@@ -87,35 +84,23 @@ if [ -z "$FILES" ]; then
# or contains #!/usr/bin/python in the first line.
FILES="$(find "${top_srcdir}"/{anaconda,pyanaconda,tests,widgets,utils,scripts} -type f \( -name '*.py' -o -exec awk -e 'NR==1 { if ($0 ~ /^#!\/usr\/bin\/python/) exit 0; else exit 1; }' -e 'END { if (NR == 0) exit 1; }' {} \; \) -print)"
fi
-for i in $FILES; do
- pylint_output="$(pylint \
- --msg-template='{msg_id}:{line:3d},{column}: {obj}: {msg}' \
- -r n --disable=C,R --rcfile=/dev/null \
- --dummy-variables-rgx=_ \
- --ignored-classes=DefaultInstall,Popen,QueueFactory,TransactionSet \
- --defining-attr-methods=__init__,_grabObjects,initialize,reset,start,setUp \
- --load-plugins=intl \
- $DISABLED_WARN_OPTIONS \
- $DISABLED_ERR_OPTIONS \
- $NON_STRICT_OPTIONS $i 2>&1 | \
- egrep -v "$(tr '\n' '|' < "$FALSE_POSITIVES") \
- ")"
-
- # I0011 is the informational "Locally disabling ...." message
- if [ -n "$(echo "$pylint_output" | fgrep -v '************* Module ' |\
- grep -v '^I0011:')" ]; then
- # Replace the Module line with the actual filename
- pylint_output="$(echo "$pylint_output" | sed "s|\* Module .*|* Module $i|")"
-
- if [ "$pylint_log" -ne 0 ]; then
- echo "$pylint_output" >> pylint-log
- else
- echo "$pylint_output"
- fi
- exit_status=1
- fi
+
+num_cpus=$(getconf _NPROCESSORS_ONLN)
+# run pylint in paralel
+echo $FILES | xargs --max-procs=$num_cpus -n 1 "$srcdir"/pylint-one.sh
+
+for file in $(find -name 'pylint-out*'); do
+ cat "$file" >> pylint-log
+ rm "$file"
done
+fails=$(find -name 'pylint*failed' -print -exec rm '{}' \;)
+if [ -z "$fails" ]; then
+ exit_status=0
+else
+ exit_status=1
+fi
+
if [ "$pylint_log" -ne 0 ]; then
if [ -s pylint-log ]; then
echo "pylint reports the following issues:"
--
1.8.4.2
10 years, 6 months
[lorax-rhel7] Add SB lockdown to EFI grub menu (#1030495)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
Resolves: rhbz#1030495
---
share/config_files/x86/grub2-efi.cfg | 3 +++
share/efi.tmpl | 1 +
share/live/config_files/x86/grub2-efi.cfg | 3 +++
share/live/efi.tmpl | 2 ++
4 files changed, 9 insertions(+)
diff --git a/share/config_files/x86/grub2-efi.cfg b/share/config_files/x86/grub2-efi.cfg
index 3301bc1..74888fc 100644
--- a/share/config_files/x86/grub2-efi.cfg
+++ b/share/config_files/x86/grub2-efi.cfg
@@ -37,4 +37,7 @@ submenu 'Troubleshooting -->' {
linuxefi @KERNELPATH@ @ROOT@ rescue quiet
initrdefi @INITRDPATH@
}
+ menuentry '@PRODUCT@ @VERSION@ Secure Boot Lockdown' {
+ chainloader /EFI/BOOT/lockdown.efi
+ }
}
diff --git a/share/efi.tmpl b/share/efi.tmpl
index dee095f..4e29ec9 100644
--- a/share/efi.tmpl
+++ b/share/efi.tmpl
@@ -9,6 +9,7 @@ mkdir ${EFIBOOTDIR}
mkdir ${EFIBOOTDIR}/fonts/
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
install boot/efi/EFI/*/MokManager.efi ${EFIBOOTDIR}/
+install usr/share/shim/lockdown.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
diff --git a/share/live/config_files/x86/grub2-efi.cfg b/share/live/config_files/x86/grub2-efi.cfg
index f99f459..aa003bd 100644
--- a/share/live/config_files/x86/grub2-efi.cfg
+++ b/share/live/config_files/x86/grub2-efi.cfg
@@ -37,4 +37,7 @@ submenu 'Troubleshooting -->' {
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rescue quiet
initrdefi @INITRDPATH@
}
+ menuentry '@PRODUCT@ @VERSION@ Secure Boot Lockdown' {
+ chainloader /EFI/BOOT/lockdown.efi
+ }
}
diff --git a/share/live/efi.tmpl b/share/live/efi.tmpl
index cc1c2ec..f6cf173 100644
--- a/share/live/efi.tmpl
+++ b/share/live/efi.tmpl
@@ -8,6 +8,8 @@ APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
mkdir ${EFIBOOTDIR}
mkdir ${EFIBOOTDIR}/fonts/
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
+install boot/efi/EFI/*/MokManager.efi ${EFIBOOTDIR}/
+install boot/efi/EFI/*/lockdown.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
--
1.8.3.1
10 years, 6 months
[master/f20-branch/rhel7-branch][v2][PATCH] Make thread manager operations even more atomic
by Martin Kolman
Turns out there was yet another race condition in the wait() function; it was
also decided that the raise_error function has a really confusing name for what it does.
Both are fixed in v2.
Martin Kolman (1):
Make thread manager operations atomic (#1029898)
pyanaconda/threads.py | 56 ++++++++++++++++++++++++++++++++++++---------------
1 file changed, 40 insertions(+), 16 deletions(-)
--
1.8.4.2
10 years, 6 months
[master][PATCH] Put yum_lock logging to a separate file and just attach it
by Vratislav Podzimek
In some cases, yum_lock logs may grow to megabytes (especially with slow
Internet connection) which makes anaconda-tb file generation take at least tens
of seconds (i. e. it takes tens of seconds for the exception dialog to appear)
and the resulting file is so big that it is considered a binary attachement by
libreport/bugzilla.
This change makes exception dialog appear in a few seconds with the anaconda-tb
size reduced to hundreds of kilobytes.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/anaconda_log.py | 7 +++++++
pyanaconda/exception.py | 10 ++++++++++
pyanaconda/packaging/yumpayload.py | 7 ++++---
3 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/anaconda_log.py b/pyanaconda/anaconda_log.py
index c71181f..e52d826 100644
--- a/pyanaconda/anaconda_log.py
+++ b/pyanaconda/anaconda_log.py
@@ -43,6 +43,7 @@ PROGRAM_LOG_FILE = "/tmp/program.log"
PROGRAM_LOG_TTY = "/dev/tty5"
STORAGE_LOG_FILE = "/tmp/storage.log"
PACKAGING_LOG_FILE = "/tmp/packaging.log"
+YUM_LOCK_LOG_FILE = "/tmp/yum_lock.log"
SENSITIVE_INFO_LOG_FILE = "/tmp/sensitive-info.log"
ANACONDA_SYSLOG_FACILITY = SysLogHandler.LOG_LOCAL1
@@ -128,6 +129,12 @@ class AnacondaLog:
minLevel=logging.DEBUG)
self.forwardToSyslog(packaging_logger)
+ # Create the yum_lock logger.
+ yum_lock_logger = logging.getLogger("yum_lock")
+ yum_lock_logger.setLevel(logging.DEBUG)
+ self.addFileHandler(YUM_LOCK_LOG_FILE, yum_lock_logger,
+ minLevel=logging.DEBUG)
+
# Create the yum logger and link it to packaging
yum_logger = logging.getLogger("yum")
yum_logger.setLevel(logging.DEBUG)
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index e61cce0..cd46064 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -38,6 +38,7 @@ from pyanaconda.constants import ROOT_PATH, THREAD_EXCEPTION_HANDLING_TEST
from pyanaconda.threads import threadMgr
from pyanaconda.i18n import _
from pyanaconda import flags
+from pyanaconda import product
from gi.repository import GLib
@@ -236,6 +237,9 @@ def initExceptionHandling(anaconda):
# anaconda-tb file
conf.register_callback("journalctl", journalctl_callback, attchmnt_only=False)
+ if not product.isFinal:
+ conf.register_callback("yum_lock.log", yum_lock_log_callback, attchmnt_only=True)
+
handler = AnacondaExceptionHandler(conf, anaconda.intf.meh_interface,
ReverseExceptionDump, anaconda.intf.tty_num)
handler.install(anaconda)
@@ -266,6 +270,12 @@ def journalctl_callback():
return ret
+def yum_lock_log_callback():
+ """Callback to get our yum_lock log."""
+
+ with open("/tmp/yum_lock.log", "r") as fobj:
+ return fobj.read()
+
def test_exception_handling():
"""
Function that can be used for testing exception handling in anaconda. It
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 2f2813a..7323b8a 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -45,6 +45,7 @@ from functools import wraps
import logging
log = logging.getLogger("packaging")
+yum_lock_log = logging.getLogger("yum_lock")
try:
import rpm
@@ -103,16 +104,16 @@ class YumLock(object):
frame = inspect.stack()[2]
threadName = threading.currentThread().name
- log.info("about to acquire _yum_lock for %s at %s:%s (%s)", threadName, frame[1], frame[2], frame[3])
+ yum_lock_log.info("about to acquire _yum_lock for %s at %s:%s (%s)", threadName, frame[1], frame[2], frame[3])
_private_yum_lock.acquire()
- log.info("have _yum_lock for %s", threadName)
+ yum_lock_log.info("have _yum_lock for %s", threadName)
return _private_yum_lock
def __exit__(self, exc_type, exc_val, exc_tb):
_private_yum_lock.release()
if not isFinal:
- log.info("gave up _yum_lock for %s", threading.currentThread().name)
+ yum_lock_log.info("gave up _yum_lock for %s", threading.currentThread().name)
def invalidates_br_cache(cond_fn=None):
"""
--
1.8.3.1
10 years, 6 months
[f20-branch][rhel7-branch] handle nested btrfs subvolumes
by David Lehman
Subvolumes are nested, which means that the long-standing rule that
only leaf devices can be mounted (or used as swap) does not apply.
This patch handles the case of a user deleting the foo subvolume when
the foo/bar/baz subvolume is still around. Previously, we let this
happen and then there was a crash when we tried to make the change
using the btrfs tools. Now the user will confirm that they wish to
remove any subvolumes, snapshots, &c and we will account for them
correctly, preventing any disagreement with the btrfs tools.
10 years, 6 months
[master/f20-branch/rhel7-branch][PATCH] Make thread manager operations atomic
by Martin Kolman
So looks like there was a race condition in the way thread manager is adding
new threads and someone finally managed to hit it. :)
Martin Kolman (1):
Make thread manager operations atomic (#1029898)
pyanaconda/threads.py | 43 ++++++++++++++++++++++++++++++-------------
1 file changed, 30 insertions(+), 13 deletions(-)
--
1.8.3.1
10 years, 6 months
[master][PATCH] Fix how "changed" signal is emitted on the TreeSelection
by Vratislav Podzimek
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/ui/gui/spokes/keyboard.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py
index 1294072..5a8ad51 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.py
+++ b/pyanaconda/ui/gui/spokes/keyboard.py
@@ -458,7 +458,7 @@ class KeyboardSpoke(NormalSpoke):
self._removeLayout(store, itr)
# Re-emit the selection changed signal now that the backing store is updated
# in order to update the first/last/only-based button sensitivities
- self._selection.change("changed")
+ self._selection.emit("changed")
return
#nothing left, run AddLayout dialog to replace the current layout
--
1.8.4.2
10 years, 6 months