Compare commits

...

15 Commits
rawhide ... el6

Author SHA1 Message Date
Jens Petersen e4a792a038 Merge remote-tracking branch 'origin/f17' into el6 2013-07-22 22:22:21 +09:00
Jens Petersen 98b3b016c7 bump release 2013-07-22 21:53:11 +09:00
Jens Petersen 0be1c97f27 backport patch from 0.11.2 to sanitize DynamicLog output (potential vulnerability) 2013-07-22 21:21:25 +09:00
Jens Petersen 276d271e84 Merge remote-tracking branch 'origin/f16' into el6 2013-01-22 17:24:42 +09:00
Jens Petersen 75dbc0186d revert el6 ppc64 changes to make it easier to merge newer changes
Reverting "revert dropping ppc64 and instead don't build .o file for ghci for ppc64"
Reverting "exclude ppc64 completely and revert last change"
Reverting "disable prof on ppc64 to avoid linker error"

ppc64 should build now with current ghc-rpm-macros
2013-01-22 17:24:22 +09:00
Jens Petersen 598d795170 revert dropping ppc64 and instead don't build .o file for ghci for ppc64 2012-05-22 19:37:16 +09:00
Jens Petersen f5c5c1ad7d exclude ppc64 completely and revert last change
- non-prof build also fails to link!!
2012-05-21 15:18:57 +09:00
Jens Petersen 35c8a755ee disable prof on ppc64 to avoid linker error
/usr/bin/ld: TOC section size exceeds 64k
2012-05-21 13:52:50 +09:00
Jens Petersen 19b1af31af Merge remote-tracking branch 'origin/master' into el6 2012-05-20 21:08:12 +09:00
Jens Petersen 1a7bf41edd Merge ../f17 into el6 2012-05-13 19:27:14 +09:00
Jens Petersen 50f4ba5762 backport current f14 packaging 2010-11-15 12:48:59 +10:00
Fedora Release Engineering 6c437b1394 dist-git conversion 2010-07-28 15:35:06 +00:00
Jens Petersen 6d55f3e7db backport 0.9 from rawhide 2009-12-10 09:43:18 +00:00
Bill Nottingham 88e31326d0 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:56:09 +00:00
Jesse Keating 0a4ec21a58 Initialize branch F-12 for ghc-xmonad-contrib 2009-09-29 04:56:21 +00:00
2 changed files with 91 additions and 2 deletions

View File

@ -18,7 +18,7 @@ your own extensions.
Name: ghc-%{pkg_name}
Version: 0.10
Release: 7%{?dist}
Release: 7.1%{?dist}
Summary: %{common_summary}
License: BSD
@ -31,6 +31,7 @@ Patch3: xmonad-contrib-0.10-BorderResize-smaller.patch
Patch4: xmonad-contrib-0.10-PositionStore-dont-rescale-with-screen.patch
Patch5: xmonad-contrib-0.10-X11-1.6.patch
Patch6: xmonad-contrib-0.10-takeFocus-core.patch
Patch7: xmonad-contrib-DynamicLog-0.11.2.patch
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
@ -65,7 +66,7 @@ BuildRequires: ghc-xmonad-devel
%patch5 -p1 -b .orig-X11
%endif
%patch6 -p1 -b .orig-Focus
%patch7 -p1 -b .orig-sanitize
%build
%ghc_lib_build
@ -88,6 +89,10 @@ BuildRequires: ghc-xmonad-devel
%changelog
* Mon Jul 22 2013 Jens Petersen <petersen@redhat.com> - 0.10-7.1
- backport patch from 0.11.2 to sanitize DynamicLog output
(potential vulnerability)
* Sat Nov 17 2012 Jens Petersen <petersen@redhat.com> - 0.10-7
- add ICCCMFocus patch from upstream for WM_TAKE_FOCUS move to core (#874855)
- use a patch for use_xft flag

View File

@ -0,0 +1,84 @@
diff --git a/XMonad/Hooks/DynamicLog.hs b/XMonad/Hooks/DynamicLog.hs
index 0547c80..1d256c6 100644
--- a/XMonad/Hooks/DynamicLog.hs
+++ b/XMonad/Hooks/DynamicLog.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleContexts, PatternGuards #-}
-----------------------------------------------------------------------------
-- |
@@ -57,10 +57,10 @@ module XMonad.Hooks.DynamicLog (
-- Useful imports
import Codec.Binary.UTF8.String (encodeString)
-import Control.Monad (liftM2)
+import Control.Monad (liftM2, msum)
import Data.Char ( isSpace, ord )
-import Data.List (intersperse, isPrefixOf, sortBy)
-import Data.Maybe ( isJust, catMaybes )
+import Data.List (intersperse, stripPrefix, isPrefixOf, sortBy)
+import Data.Maybe ( isJust, catMaybes, mapMaybe )
import Data.Ord ( comparing )
import qualified Data.Map as M
import qualified XMonad.StackSet as S
@@ -279,7 +279,7 @@ dynamicLogString pp = do
return $ encodeString . sepBy (ppSep pp) . ppOrder pp $
[ ws
, ppLayout pp ld
- , ppTitle pp wt
+ , ppTitle pp $ ppTitleSanitize pp wt
]
++ catMaybes extras
@@ -396,14 +396,26 @@ xmobarColor fg bg = wrap t "</fc>"
-- | Strip xmobar markup.
xmobarStrip :: String -> String
-xmobarStrip = strip [] where
+xmobarStrip = xmobarStripTags ["fc","icon","action"] where
+
+xmobarStripTags :: [String] -- ^ tags
+ -> String -> String -- ^ with all <tag>...</tag> removed
+xmobarStripTags tags = strip [] where
+ strip keep [] = keep
strip keep x
- | null x = keep
- | "<fc=" `isPrefixOf` x = strip keep (drop 1 . dropWhile (/= '>') $ x)
- | "</fc>" `isPrefixOf` x = strip keep (drop 5 x)
- | '<' == head x = strip (keep ++ "<") (tail x)
- | otherwise = let (good,x') = span (/= '<') x
- in strip (keep ++ good) x'
+ | rest: _ <- mapMaybe dropTag tags = strip keep rest
+
+
+ | '<':xs <- x = strip (keep ++ "<") xs
+ | (good,x') <- span (/= '<') x = strip (keep ++ good) x' -- this is n^2 bad... but titles have few tags
+ where dropTag :: String -> Maybe String
+ dropTag tag = msum [fmap dropTilClose (openTag tag `stripPrefix` x),
+ closeTag tag `stripPrefix` x]
+
+ dropTilClose, openTag, closeTag :: String -> String
+ dropTilClose = drop 1 . dropWhile (/= '>')
+ openTag str = "<" ++ str ++ "="
+ closeTag str = "</" ++ str ++ ">"
-- | The 'PP' type allows the user to customize the formatting of
-- status information.
@@ -427,6 +439,8 @@ data PP = PP { ppCurrent :: WorkspaceId -> String
-- ^ separator to use between workspace tags
, ppTitle :: String -> String
-- ^ window title format
+ , ppTitleSanitize :: String -> String
+ -- ^ escape / sanitizes input to 'ppTitle'
, ppLayout :: String -> String
-- ^ layout name format
, ppOrder :: [String] -> [String]
@@ -468,6 +482,7 @@ defaultPP = PP { ppCurrent = wrap "[" "]"
, ppSep = " : "
, ppWsSep = " "
, ppTitle = shorten 80
+ , ppTitleSanitize = xmobarStrip . dzenEscape
, ppLayout = id
, ppOrder = id
, ppOutput = putStrLn