Hello community, here is the log from the commit of package ghc-gitrev for openSUSE:Factory checked in at 2016-07-20 09:21:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-gitrev (Old) and /work/SRC/openSUSE:Factory/.ghc-gitrev.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-gitrev" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-gitrev/ghc-gitrev.changes 2015-11-26 17:02:29.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-gitrev.new/ghc-gitrev.changes 2016-07-20 09:21:35.000000000 +0200 @@ -1,0 +2,5 @@ +Sun Jul 10 17:07:18 UTC 2016 - [email protected] + +- Update to version 1.2.0 revision 0 with cabal2obs. + +------------------------------------------------------------------- Old: ---- gitrev-1.1.0.tar.gz New: ---- gitrev-1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-gitrev.spec ++++++ --- /var/tmp/diff_new_pack.HOIr1w/_old 2016-07-20 09:21:38.000000000 +0200 +++ /var/tmp/diff_new_pack.HOIr1w/_new 2016-07-20 09:21:38.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-gitrev # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,26 +15,24 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -%global pkg_name gitrev -Name: ghc-gitrev -Version: 1.1.0 +%global pkg_name gitrev +Name: ghc-%{pkg_name} +Version: 1.2.0 Release: 0 Summary: Compile git revision info into Haskell projects -Group: System/Libraries - License: BSD-3-Clause +Group: System/Libraries Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-build - BuildRequires: ghc-Cabal-devel -BuildRequires: ghc-rpm-macros # Begin cabal-rpm deps: BuildRequires: ghc-directory-devel BuildRequires: ghc-filepath-devel BuildRequires: ghc-process-devel +BuildRequires: ghc-rpm-macros BuildRequires: ghc-template-haskell-devel +BuildRoot: %{_tmppath}/%{name}-%{version}-build # End cabal-rpm deps %description @@ -42,19 +40,17 @@ branch in the code of your project. Useful for including in panic messages, '--version' output, or diagnostic info for more informative bug reports. - %package devel Summary: Haskell %{pkg_name} library development files Group: Development/Libraries/Other +Requires: %{name} = %{version}-%{release} Requires: ghc-compiler = %{ghc_version} Requires(post): ghc-compiler = %{ghc_version} Requires(postun): ghc-compiler = %{ghc_version} -Requires: %{name} = %{version}-%{release} %description devel This package provides the Haskell %{pkg_name} library development files. - %prep %setup -q -n %{pkg_name}-%{version} @@ -70,18 +66,14 @@ %post devel %ghc_pkg_recache - %postun devel %ghc_pkg_recache - %files -f %{name}.files %defattr(-,root,root,-) %doc LICENSE - %files devel -f %{name}-devel.files %defattr(-,root,root,-) - %changelog ++++++ gitrev-1.1.0.tar.gz -> gitrev-1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gitrev-1.1.0/gitrev.cabal new/gitrev-1.2.0/gitrev.cabal --- old/gitrev-1.1.0/gitrev.cabal 2015-08-11 19:40:20.000000000 +0200 +++ new/gitrev-1.2.0/gitrev.cabal 2016-01-11 23:53:59.000000000 +0100 @@ -1,5 +1,5 @@ name: gitrev -version: 1.1.0 +version: 1.2.0 synopsis: Compile git revision info into Haskell projects homepage: https://github.com/acfoltzer/gitrev license: BSD3 @@ -16,7 +16,7 @@ location: https://github.com/acfoltzer/gitrev.git library - build-depends: base >= 4.7 && < 5, + build-depends: base >= 4.6 && < 5, directory, filepath, template-haskell, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gitrev-1.1.0/src/Development/GitRev.hs new/gitrev-1.2.0/src/Development/GitRev.hs --- old/gitrev-1.1.0/src/Development/GitRev.hs 2015-08-11 19:40:20.000000000 +0200 +++ new/gitrev-1.2.0/src/Development/GitRev.hs 2016-01-11 23:53:59.000000000 +0100 @@ -18,6 +18,7 @@ -- > panic msg = error panicMsg -- > where panicMsg = -- > concat [ "[panic ", $(gitBranch), "@", $(gitHash) +-- > , " (", $(gitCommitDate), ")" -- > , " (", $(gitCommitCount), " commits in HEAD)" -- > , dirty, "] ", msg ] -- > dirty | $(gitDirty) = " (uncommitted files present)" @@ -26,9 +27,9 @@ -- > main = panic "oh no!" -- -- > % cabal exec runhaskell Example.hs --- > Example.hs: [panic master@2702e69355c978805064543489c351b61ac6760b (6 commits in HEAD) (uncommitted files present)] oh no! +-- > Example.hs: [panic master@2ae047ba5e4a6f0f3e705a43615363ac006099c1 (Mon Jan 11 11:50:59 2016 -0800) (14 commits in HEAD) (uncommitted files present)] oh no! -module Development.GitRev (gitHash, gitBranch, gitDirty, gitCommitCount) where +module Development.GitRev (gitHash, gitBranch, gitDirty, gitCommitCount, gitCommitDate) where import Control.Applicative import Control.Exception @@ -44,8 +45,8 @@ -- | Run git with the given arguments and no stdin, returning the -- stdout output. If git isn't available or something goes wrong, -- return the second argument. -runGit :: [String] -> String -> Q String -runGit args def = do +runGit :: [String] -> String -> IndexUsed -> Q String +runGit args def useIdx = do let oops :: SomeException -> IO (ExitCode, String, String) oops _e = return (ExitFailure 1, def, "") gitFound <- runIO $ isJust <$> findExecutable "git" @@ -71,7 +72,7 @@ _hash -> addDependentFile hd -- add the index if it exists to set the dirty flag indexExists <- runIO $ doesFileExist index - when indexExists $ addDependentFile index + when (indexExists && useIdx == IdxUsed) $ addDependentFile index -- if the refs have been packed, the info we're looking for -- might be in that file rather than the one-file-per-ref case -- handled above @@ -84,29 +85,39 @@ ExitFailure _ -> return def else return def +-- | Type to flag if the git index is used or not in a call to runGit +data IndexUsed = IdxUsed -- ^ The git index is used + | IdxNotUsed -- ^ The git index is /not/ used + deriving (Eq) + -- | Return the hash of the current git commit, or @UNKNOWN@ if not in -- a git repository gitHash :: ExpQ gitHash = - stringE =<< runGit ["rev-parse", "HEAD"] "UNKNOWN" + stringE =<< runGit ["rev-parse", "HEAD"] "UNKNOWN" IdxNotUsed -- | Return the branch (or tag) name of the current git commit, or @UNKNOWN@ -- if not in a git repository. For detached heads, this will just be -- "HEAD" gitBranch :: ExpQ gitBranch = - stringE =<< runGit ["rev-parse", "--abbrev-ref", "HEAD"] "UNKNOWN" + stringE =<< runGit ["rev-parse", "--abbrev-ref", "HEAD"] "UNKNOWN" IdxNotUsed -- | Return @True@ if there are non-committed files present in the -- repository gitDirty :: ExpQ gitDirty = do - output <- runGit ["status", "--porcelain"] "" + output <- runGit ["status", "--porcelain"] "" IdxUsed case output of - "" -> conE $ mkName "Prelude.False" - _ -> conE $ mkName "Prelude.True" + "" -> conE falseName + _ -> conE trueName -- | Return the number of commits in the current head gitCommitCount :: ExpQ gitCommitCount = - stringE =<< runGit ["rev-list", "HEAD", "--count"] "UNKNOWN" + stringE =<< runGit ["rev-list", "HEAD", "--count"] "UNKNOWN" IdxNotUsed + +-- | Return the commit date of the current head +gitCommitDate :: ExpQ +gitCommitDate = + stringE =<< runGit ["log", "HEAD", "-1", "--format=%cd"] "UNKNOWN" IdxNotUsed
