Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add some AllOf functions (Wall fix)

  • Loading branch information...
commit 618e828d07f991d1ac3871aa41e98da47a43c2a8 1 parent 3d4443f
Alexander Vershilov authored May 05, 2012

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  Portage/Dependency.hs
4  Portage/Dependency.hs
@@ -48,6 +48,7 @@ showDepend (DependIfUse        useflag dep) = disp useflag <> Disp.text "? " <>
48 48
           pp_deps (AllOf _) =                               disp dep
49 49
           pp_deps         _ = Disp.parens (Disp.text " " <> disp dep <> Disp.text " ")
50 50
 showDepend (ThisMajorOf        v p u) = Disp.char '=' <> disp p <-> disp v <> Disp.char '*' <> dispUses u
  51
+showDepend (AllOf []) = Disp.empty
51 52
 showDepend (AllOf              (d:dp) ) =
52 53
     Disp.text "( " <> showDepend d <> line
53 54
     <> Disp.hcat (map (\x -> Disp.text "\t\t\t" <> (showDepend x) <> line) dp)
@@ -149,6 +150,7 @@ simplify_deps deps = (concatMap (simplify_group.nub) $
149 150
           cmpMaybe _         _         = False
150 151
           --
151 152
 getPackage :: Dependency -> Maybe PackageName
  153
+getPackage (AllOf _dependency) = Nothing
152 154
 getPackage (AnyVersionOf package _uses) = Just package
153 155
 getPackage (ThisVersionOf      _version package _uses) = Just package
154 156
 getPackage (LaterVersionOf     _version package _uses) = Just package
@@ -160,6 +162,7 @@ getPackage (DependIfUse  _useFlag    _Dependency) = Nothing
160 162
 getPackage (ThisMajorOf        _version package _uses) = Just package
161 163
 
162 164
 getUses  :: Dependency -> Maybe [UseFlag]
  165
+getUses (AllOf _d) = Nothing
163 166
 getUses (AnyVersionOf _p u) = Just u
164 167
 getUses (ThisVersionOf _v _p u) = Just u
165 168
 getUses (LaterVersionOf _v _p u) = Just u
@@ -176,6 +179,7 @@ getPackagePart dep = fromJust (getPackage dep)
176 179
 
177 180
 --
178 181
 addDepUseFlag :: Dependency -> UseFlag -> Dependency
  182
+addDepUseFlag (AllOf d) n = AllOf $ map (flip addDepUseFlag n) d
179 183
 addDepUseFlag (AnyVersionOf p u) n = AnyVersionOf p (n:u)
180 184
 addDepUseFlag (ThisVersionOf v p u) n = ThisVersionOf v p (n:u)
181 185
 addDepUseFlag (LaterVersionOf v p u) n = LaterVersionOf v p (n:u)

0 notes on commit 618e828

Please sign in to comment.
Something went wrong with that request. Please try again.