Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a tag with proper version to generated ebuilds.

  • Loading branch information...
commit 60a5406dc04dfa60acda3547d55d86b1ed4ca5b9 1 parent 3807f0e
@jkarlson jkarlson authored
Showing with 12 additions and 0 deletions.
  1. +11 −0 Portage/EBuild.hs
  2. +1 −0  hackport.cabal
View
11 Portage/EBuild.hs
@@ -10,9 +10,13 @@ import Portage.Dependency
import Distribution.License as Cabal
+import Data.Version(Version(..))
+import qualified Paths_hackport(version)
+
data EBuild = EBuild {
name :: String,
version :: String,
+ hackportVersion :: String,
description :: String,
homepage :: String,
src_uri :: String,
@@ -28,10 +32,15 @@ data EBuild = EBuild {
my_pn :: Maybe String --If the package's name contains upper-case
}
+getHackportVersion :: Version -> String
+getHackportVersion Version {versionBranch=(x:s)} = foldl (\y z -> y ++ "." ++ (show z)) (show x) s
+getHackportVersion Version {versionBranch=[]} = ""
+
ebuildTemplate :: EBuild
ebuildTemplate = EBuild {
name = "foobar",
version = "0.1",
+ hackportVersion = getHackportVersion Paths_hackport.version,
description = "",
homepage = "",
src_uri = "",
@@ -56,6 +65,8 @@ showEBuild ebuild =
ss "# Distributed under the terms of the GNU General Public License v2". nl.
ss "# $Header: $". nl.
nl.
+ ss ("# ebuild generated by hackport " ++ hackportVersion ebuild). nl.
+ nl.
ss "CABAL_FEATURES=". quote' (sepBy " " $ features ebuild). nl.
ss "inherit haskell-cabal". nl.
nl.
View
1  hackport.cabal
@@ -56,6 +56,7 @@ Executable hackport
CacheFile
Diff
Error
+ Paths_hackport
Main
MaybeRead
Overlays
Please sign in to comment.
Something went wrong with that request. Please try again.