summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2011-06-05 16:27:38 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2011-06-05 16:27:38 +0000
commiteeca45ffcca5ab6068e824c0e59b31ffe6cb589a (patch)
tree1a7f583905b51fede897a57d923574e91f180bf8 /dev-lang/ghc/files
parentRemoved old. (diff)
downloadgentoo-2-eeca45ffcca5ab6068e824c0e59b31ffe6cb589a.tar.gz
gentoo-2-eeca45ffcca5ab6068e824c0e59b31ffe6cb589a.tar.bz2
gentoo-2-eeca45ffcca5ab6068e824c0e59b31ffe6cb589a.zip
Remove old ghc versions. Many of them are very hard to impossible to build/use.
(Portage version: 2.1.9.50/cvs/Linux x86_64)
Diffstat (limited to 'dev-lang/ghc/files')
-rw-r--r--dev-lang/ghc/files/10ghc2
-rw-r--r--dev-lang/ghc/files/depsort.py65
-rw-r--r--dev-lang/ghc/files/ghc-6.10.2-readline.patch216
-rw-r--r--dev-lang/ghc/files/ghc-6.4.2-sparc32plus.patch12
-rw-r--r--dev-lang/ghc/files/ghc-6.4.2-sparcmangler.patch13
-rw-r--r--dev-lang/ghc/files/ghc-6.5-norelax.patch15
-rw-r--r--dev-lang/ghc/files/ghc-6.6-nothreadedrts.patch24
-rwxr-xr-xdev-lang/ghc/files/ghc-updater335
8 files changed, 0 insertions, 682 deletions
diff --git a/dev-lang/ghc/files/10ghc b/dev-lang/ghc/files/10ghc
deleted file mode 100644
index 064cfb79d5bd..000000000000
--- a/dev-lang/ghc/files/10ghc
+++ /dev/null
@@ -1,2 +0,0 @@
-PATH=/opt/ghc/bin
-ROOTPATH=/opt/ghc/bin
diff --git a/dev-lang/ghc/files/depsort.py b/dev-lang/ghc/files/depsort.py
deleted file mode 100644
index 4c3cb7bc84ab..000000000000
--- a/dev-lang/ghc/files/depsort.py
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/python
-
-# tries to reorder the deps of a given list of packages so they
-# are merged in order - liquidx@g.o (09 Oct 03)
-
-import portage
-import sys, string
-
-fakedbapi = portage.fakedbapi()
-varapi = portage.db["/"]["vartree"].dbapi
-
-pkgs_to_reorder = sys.argv[1:]
-pkgs_ordered = []
-
-# key = catpkgver
-# value = dependencies
-dep_cache = {}
-
-
-# very simply, we extract the dependencies for each package
-for pkg in pkgs_to_reorder:
- try:
- deps, slot = varapi.aux_get(pkg, ["DEPEND", "SLOT"])
- except ValueError:
- sys.stderr.write("Error getting dependency information off " + pkg + "\n")
- continue
- try:
- realdeps = portage.dep_check(deps, fakedbapi)
- except TypeError:
- # we're probably running >=portage-2.0.50
- pkgsettings = portage.config(clone=portage.settings)
- realdeps = portage.dep_check(deps, fakedbapi, pkgsettings)
-
- vardeps = []
- # match() finds the versions of all those that are installed
- for dep in realdeps[1]:
- vardeps = vardeps + varapi.match(dep)
- dep_cache[pkg] = vardeps
-
-# topsort takes a graph (given as a dictionary with the nodes
-# as keys and the outgoing edges as values), and returns a
-# list of nodes that is topologically sorted
-def topsort (graph) :
- visited = dict([(node,False) for node in graph.keys()])
- result = []
-
- def dfs_single (node) :
- visited[node] = True
- for adj in graph[node]:
- # we ignore dependencies that are not nodes in the graph
- if adj in graph.keys() and not visited[adj]:
- dfs_single (adj)
- result.append(node)
-
- for node in graph.keys():
- if not visited[node]:
- dfs_single (node)
-
- return result
-
-pkgs_final_order = topsort(dep_cache)
-
-print string.join(pkgs_final_order, "\n")
-#print portage.dep_expand("=dev-python/sip-3.8", portage.portdb)
-#print portage.dep_check("X? ( >=dev-python/sip-3.8 )", fakedbapi)
diff --git a/dev-lang/ghc/files/ghc-6.10.2-readline.patch b/dev-lang/ghc/files/ghc-6.10.2-readline.patch
deleted file mode 100644
index 315d800ac57b..000000000000
--- a/dev-lang/ghc/files/ghc-6.10.2-readline.patch
+++ /dev/null
@@ -1,216 +0,0 @@
-Lennart Kolmodin <kolmodin@gentoo.org> 2009
-Make GHC 6.10.2 use readline instead of editline
-
-diff -rN -u old-ghc-6.10.2/aclocal.m4 new-ghc-6.10.2/aclocal.m4
---- old-ghc-6.10.2/aclocal.m4 2009-04-02 22:56:21.000000000 +0200
-+++ new-ghc-6.10.2/aclocal.m4 2009-04-02 22:56:23.000000000 +0200
-@@ -900,18 +900,18 @@
- fi])# FP_PROG_GHC_PKG
-
-
--# FP_GHC_HAS_EDITLINE
-+# FP_GHC_HAS_READLINE
- # -------------------
--AC_DEFUN([FP_GHC_HAS_EDITLINE],
-+AC_DEFUN([FP_GHC_HAS_READLINE],
- [AC_REQUIRE([FP_PROG_GHC_PKG])
--AC_CACHE_CHECK([whether ghc has editline package], [fp_cv_ghc_has_editline],
--[if "${GhcPkgCmd-ghc-pkg}" --show-package editline >/dev/null 2>&1; then
-- fp_cv_ghc_has_editline=yes
-+AC_CACHE_CHECK([whether ghc has readline package], [fp_cv_ghc_has_readline],
-+[if "${GhcPkgCmd-ghc-pkg}" describe readline >/dev/null 2>&1; then
-+ fp_cv_ghc_has_readline=yes
- else
-- fp_cv_ghc_has_editline=no
-+ fp_cv_ghc_has_readline=no
- fi])
--AC_SUBST([GhcHasEditline], [`echo $fp_cv_ghc_has_editline | sed 'y/yesno/YESNO/'`])
--])# FP_GHC_HAS_EDITLINE
-+AC_SUBST([GhcHasReadline], [`echo $fp_cv_ghc_has_readline | sed 'y/yesno/YESNO/'`])
-+])# FP_GHC_HAS_READLINE
-
-
- # FP_GCC_EXTRA_FLAGS
-diff -rN -u old-ghc-6.10.2/compiler/ghc.cabal.in new-ghc-6.10.2/compiler/ghc.cabal.in
---- old-ghc-6.10.2/compiler/ghc.cabal.in 2009-04-02 22:56:21.000000000 +0200
-+++ new-ghc-6.10.2/compiler/ghc.cabal.in 2009-04-02 22:56:23.000000000 +0200
-@@ -28,8 +28,8 @@
- Default: False
- Manual: True
-
--Flag editline
-- Description: Use editline
-+Flag readline
-+ Description: Use readline
- Default: False
- Manual: True
-
-@@ -71,8 +71,8 @@
- else
- Build-Depends: unix
-
-- if flag(editline)
-- Build-Depends: editline
-+ if flag(readline)
-+ Build-Depends: readline
- CPP-Options: -DUSE_EDITLINE
-
- GHC-Options: -Wall -fno-warn-name-shadowing -fno-warn-orphans
-diff -rN -u old-ghc-6.10.2/compiler/ghci/InteractiveUI.hs new-ghc-6.10.2/compiler/ghci/InteractiveUI.hs
---- old-ghc-6.10.2/compiler/ghci/InteractiveUI.hs 2009-04-02 22:56:21.000000000 +0200
-+++ new-ghc-6.10.2/compiler/ghci/InteractiveUI.hs 2009-04-02 22:56:23.000000000 +0200
-@@ -66,7 +66,7 @@
-
- #ifdef USE_EDITLINE
- import Control.Concurrent ( yield ) -- Used in readline loop
--import System.Console.Editline.Readline as Readline
-+import System.Console.Readline as Readline
- #endif
-
- --import SystemExts
-@@ -96,6 +96,10 @@
-
- import Data.IORef ( IORef, readIORef, writeIORef )
-
-+#ifdef USE_EDITLINE
-+import System.Posix.Internals ( setNonBlockingFD )
-+#endif
-+
- -----------------------------------------------------------------------------
-
- ghciWelcomeMsg :: String
-@@ -322,10 +326,6 @@
- when is_tty $ withReadline $ do
- Readline.initialize
-
-- withGhcAppData
-- (\dir -> Readline.readHistory (dir </> "ghci_history"))
-- (return True)
--
- Readline.setAttemptedCompletionFunction (Just completeWord)
- --Readline.parseAndBind "set show-all-if-ambiguous 1"
-
-@@ -360,9 +360,6 @@
-
- #ifdef USE_EDITLINE
- liftIO $ do
-- Readline.stifleHistory 100
-- withGhcAppData (\dir -> Readline.writeHistory (dir </> "ghci_history"))
-- (return True)
- Readline.resetTerminal Nothing
- #endif
-
-@@ -634,11 +631,9 @@
- return (Just str)
-
- withReadline :: IO a -> IO a
--withReadline = bracket_ stopTimer startTimer
-- -- editline doesn't handle some of its system calls returning
-- -- EINTR, so our timer signal confuses it, hence we turn off
-- -- the timer signal when making calls to editline. (#2277)
-- -- If editline is ever fixed, we can remove this.
-+withReadline = flip finally (setNonBlockingFD 0)
-+ -- 1. readline sometimes puts stdin into blocking mode,
-+ -- so we need to put it back for the IO library
-
- -- These come from the RTS
- foreign import ccall unsafe startTimer :: IO ()
-diff -rN -u old-ghc-6.10.2/compiler/ghci/Linker.lhs new-ghc-6.10.2/compiler/ghci/Linker.lhs
---- old-ghc-6.10.2/compiler/ghci/Linker.lhs 2009-04-02 22:56:21.000000000 +0200
-+++ new-ghc-6.10.2/compiler/ghci/Linker.lhs 2009-04-02 22:56:23.000000000 +0200
-@@ -953,7 +953,7 @@
- partOfGHCi
- | isWindowsTarget || isDarwinTarget = []
- | otherwise = map PackageName
-- ["base", "haskell98", "template-haskell", "editline"]
-+ ["base", "haskell98", "template-haskell", "readline"]
-
- showLS :: LibrarySpec -> String
- showLS (Object nm) = "(static) " ++ nm
-diff -rN -u old-ghc-6.10.2/compiler/Makefile new-ghc-6.10.2/compiler/Makefile
---- old-ghc-6.10.2/compiler/Makefile 2009-04-02 22:56:21.000000000 +0200
-+++ new-ghc-6.10.2/compiler/Makefile 2009-04-02 22:56:23.000000000 +0200
-@@ -118,15 +118,15 @@
- CONFIGURE_FLAGS_STAGE2 += --ghc-option=-DDEBUGGER
- endif
-
--# Enable editline if:
--# - we're building stage 2/3, and we have built the editline package
-+# Enable readline if:
-+# - we're building stage 2/3, and we have built the readline package
- #
--# But we don't enable editline on Windows, as Windows terminals have
--# editline-like support builtin.
-+# But we don't enable readline on Windows, as Windows terminals have
-+# readline-like support builtin.
- #
- ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
--ifeq "$(wildcard $(FPTOOLS_TOP_ABS)/libraries/editline/unbuildable)" ""
--CONFIGURE_FLAGS_STAGE2 += --flags=editline
-+ifeq "$(wildcard $(FPTOOLS_TOP_ABS)/libraries/readline/unbuildable)" ""
-+CONFIGURE_FLAGS_STAGE2 += --flags=readline
- endif
- endif
- endif
-diff -rN -u old-ghc-6.10.2/configure.ac new-ghc-6.10.2/configure.ac
---- old-ghc-6.10.2/configure.ac 2009-04-02 22:56:21.000000000 +0200
-+++ new-ghc-6.10.2/configure.ac 2009-04-02 22:56:23.000000000 +0200
-@@ -679,8 +679,8 @@
- AC_SUBST(ghc_ge_609)dnl
- fi
-
--# Check whether this GHC has editline installed
--FP_GHC_HAS_EDITLINE
-+# Check whether this GHC has readline installed
-+FP_GHC_HAS_READLINE
-
- # Dummy arguments to print help for --with-editline-* arguments.
- # Those are actually passed to the editline package's configure script
-diff -rN -u old-ghc-6.10.2/libraries/ifBuildable.hs new-ghc-6.10.2/libraries/ifBuildable.hs
---- old-ghc-6.10.2/libraries/ifBuildable.hs 2009-04-02 22:56:22.000000000 +0200
-+++ new-ghc-6.10.2/libraries/ifBuildable.hs 2009-04-02 22:56:23.000000000 +0200
-@@ -36,5 +36,5 @@
- requiredLines = filter ((3 == ) . length) $ map words nonCommentLines
- requiredLibraries = [ x | 'l':'i':'b':'r':'a':'r':'i':'e':'s':'/':x
- <- map head requiredLines ]
-- return $ filter ("editline" /=) requiredLibraries
-+ return $ filter ("readline" /=) requiredLibraries
-
-diff -rN -u old-ghc-6.10.2/libraries/Makefile new-ghc-6.10.2/libraries/Makefile
---- old-ghc-6.10.2/libraries/Makefile 2009-04-02 22:56:22.000000000 +0200
-+++ new-ghc-6.10.2/libraries/Makefile 2009-04-02 22:56:23.000000000 +0200
-@@ -46,7 +46,7 @@
- ifeq "$(Windows)" "YES"
- SUBDIRS += $(wildcard Win32)
- endif
--SUBDIRS += directory process pretty hpc template-haskell editline Cabal random haskell98
-+SUBDIRS += directory process pretty hpc template-haskell readline Cabal random haskell98
-
- # Set GhcBootLibs=YES from the command line to work with just the libraries
- # needed to bootstrap GHC.
-diff -rN -u old-ghc-6.10.2/Makefile new-ghc-6.10.2/Makefile
---- old-ghc-6.10.2/Makefile 2009-04-02 22:56:21.000000000 +0200
-+++ new-ghc-6.10.2/Makefile 2009-04-02 22:56:23.000000000 +0200
-@@ -393,7 +393,7 @@
- echo "HaveLibGmp = $(HaveLibGmp)" >> $(BIN_DIST_VARFILE)
- echo "GhcLibsWithUnix = $(GhcLibsWithUnix)" >> $(BIN_DIST_VARFILE)
- echo "GhcWithInterpreter = $(GhcWithInterpreter)" >> $(BIN_DIST_VARFILE)
-- echo "GhcHasEditline = $(GhcHasEditline)" >> $(BIN_DIST_VARFILE)
-+ echo "GhcHasReadline = $(GhcHasReadline)" >> $(BIN_DIST_VARFILE)
- echo "BootingFromHc = $(BootingFromHc)" >> $(BIN_DIST_VARFILE)
- echo "XMLDocWays = $(XMLDocWays)" >> $(BIN_DIST_VARFILE)
- # We won't actually use xsltproc, but we need to know if it's "" or not
-diff -rN -u old-ghc-6.10.2/mk/config.mk.in new-ghc-6.10.2/mk/config.mk.in
---- old-ghc-6.10.2/mk/config.mk.in 2009-04-02 22:56:22.000000000 +0200
-+++ new-ghc-6.10.2/mk/config.mk.in 2009-04-02 22:56:23.000000000 +0200
-@@ -891,8 +891,8 @@
- GHC = @WithGhc@
- GhcDir = $(dir $(GHC))
-
--# Set to YES if $(GHC) has the editline package installed
--GhcHasEditline = @GhcHasEditline@
-+# Set to YES if $(GHC) has the readline package installed
-+GhcHasReadline = @GhcHasReadline@
-
- HBC = @HBC@
- NHC = @NHC@
diff --git a/dev-lang/ghc/files/ghc-6.4.2-sparc32plus.patch b/dev-lang/ghc/files/ghc-6.4.2-sparc32plus.patch
deleted file mode 100644
index 709f3db52b1d..000000000000
--- a/dev-lang/ghc/files/ghc-6.4.2-sparc32plus.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- ghc-6.4.2/ghc/rts/Linker.c 2006-01-04 15:24:10.000000000 +0000
-+++ ghc-6.4.2.new/ghc/rts/Linker.c 2006-05-15 21:06:45.000000000 +0100
-@@ -2695,6 +2695,9 @@
- IF_DEBUG(linker,debugBelch( "Architecture is " ));
- switch (ehdr->e_machine) {
- case EM_386: IF_DEBUG(linker,debugBelch( "x86" )); break;
-+#ifdef EM_SPARC32PLUS
-+ case EM_SPARC32PLUS:
-+#endif
- case EM_SPARC: IF_DEBUG(linker,debugBelch( "sparc" )); break;
- #ifdef EM_IA_64
- case EM_IA_64: IF_DEBUG(linker,debugBelch( "ia64" )); break;
diff --git a/dev-lang/ghc/files/ghc-6.4.2-sparcmangler.patch b/dev-lang/ghc/files/ghc-6.4.2-sparcmangler.patch
deleted file mode 100644
index 7431ffb5a5fe..000000000000
--- a/dev-lang/ghc/files/ghc-6.4.2-sparcmangler.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- ghc/driver/mangler/ghc-asm.lprl- 2006-08-23 14:24:27.000000000 +0000
-+++ ghc/driver/mangler/ghc-asm.lprl 2006-08-23 14:25:46.000000000 +0000
-@@ -417,8 +417,8 @@
- $T_CONST_LBL = '^\.LLC(\d+):$'; # regexp for what such a lbl looks like
- $T_POST_LBL = ':';
-
-- $T_MOVE_DIRVS = '^((\s+\.align\s+\d+|\s+\.proc\s+\d+|\s+\.global\s+\S+|\.text|\.data|\.seg|\.stab.*|\s+?\.section.*|\s+\.type.*|\s+\.size.*)\n)';
-- $T_COPY_DIRVS = '\.(global|globl|proc|stab)';
-+ $T_MOVE_DIRVS = '^((\s+\.align\s+\d+|\s+\.proc\s+\d+|\s+\.global\s+\S+|\s+\.local\s+\S+|\.text|\.data|\.seg|\.stab.*|\s+?\.section.*|\s+\.type.*|\s+\.size.*)\n)';
-+ $T_COPY_DIRVS = '\.(global|local|globl|proc|stab)';
-
- $T_DOT_WORD = '\.(long|word|nword|xword|byte|half|short|skip|uahalf|uaword)';
- $T_DOT_GLOBAL = '^\t\.global';
diff --git a/dev-lang/ghc/files/ghc-6.5-norelax.patch b/dev-lang/ghc/files/ghc-6.5-norelax.patch
deleted file mode 100644
index 1941757b19f3..000000000000
--- a/dev-lang/ghc/files/ghc-6.5-norelax.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -rN -u old-ghc-1/compiler/main/DriverPipeline.hs new-ghc/compiler/main/DriverPipeline.hs
---- old-ghc-1/compiler/main/DriverPipeline.hs 2006-09-13 10:33:23.000000000 +0200
-+++ new-ghc/compiler/main/DriverPipeline.hs 2006-09-13 10:33:23.000000000 +0200
-@@ -1014,6 +1014,10 @@
- let ld_r args = SysTools.runLink dflags ([
- SysTools.Option "-nostdlib",
- SysTools.Option "-nodefaultlibs",
-+#ifdef sparc_TARGET_ARCH
-+ -- options '--relax' and '-r' are incompatible
-+ SysTools.Option "-mno-relax",
-+#endif
- SysTools.Option "-Wl,-r",
- SysTools.Option ld_x_flag,
- SysTools.Option "-o",
-
diff --git a/dev-lang/ghc/files/ghc-6.6-nothreadedrts.patch b/dev-lang/ghc/files/ghc-6.6-nothreadedrts.patch
deleted file mode 100644
index 24224203189f..000000000000
--- a/dev-lang/ghc/files/ghc-6.6-nothreadedrts.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- ghc-6.6/compiler/Makefile 2006-10-10 14:03:51.000000000 -0500
-+++ ghc-6.6.patched/compiler/Makefile 2007-04-04 11:57:06.000000000 -0500
-@@ -415,7 +415,9 @@
- PKG_DEPENDS += template-haskell
-
- # Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
-+ifneq "$(GhcNotThreaded)" "YES"
- SRC_HC_OPTS += -threaded
-+endif
-
- ALL_DIRS += ghci
-
---- ghc-6.6/compiler/Makefile.ghcbin 2006-10-10 14:03:52.000000000 -0500
-+++ ghc-6.6.patched/compiler/Makefile.ghcbin 2007-04-04 11:57:30.000000000 -0500
-@@ -26,7 +26,9 @@
- SRC_HC_OPTS += -DGHCI -DBREAKPOINT
- endif
-
-+ifneq "$(GhcNotThreaded)" "YES"
- SRC_HC_OPTS += -threaded
-+endif
-
- odir=stage$(stage)
-
diff --git a/dev-lang/ghc/files/ghc-updater b/dev-lang/ghc/files/ghc-updater
deleted file mode 100755
index 727089509eb6..000000000000
--- a/dev-lang/ghc/files/ghc-updater
+++ /dev/null
@@ -1,335 +0,0 @@
-#!/bin/sh
-#
-# This script has been modified by kosmikus and is based on
-# python-updater by liquidx.
-#
-# It tries to update any package that provides a ghc library.
-# This script can be run as many times as you like. It will log the
-# results in /var/log/ghc-updater.log
-#
-# NEW_GHC_VER = new ghc version we are upgrading to
-# PKGS_EXCEPTIONS = packages that should NOT be re-emerged for any reason
-# PKGS_MANUAL = packages that should be re-emerged even if they don't
-# fit the criteria
-#
-# Runtime Variables:
-#
-# PKGS_TO_REMERGE = list of packages we deem to need re-emerging
-# PKGS_OK = list of packages that should be merged without any problems
-# PKGS_MISSING = list of packages that are installed, but cannot be merged
-# because they have been pruned from portage
-# PKGS_MASKED = list of packages that are installed, but masked.
-#
-
-shopt -s nullglob
-
-# fix the PATH to include the dirs where portage installs ghc
-PATH="/usr/bin:/opt/ghc/bin:${PATH}"
-
-NEW_GHC_VER=$(ghc --version | sed 's:^.*version ::')
-NEW_GHC_LIBDIR=$(ghc --print-libdir)
-
-PKGS_EXCEPTIONS="dev-lang/ghc dev-lang/ghc-bin"
-PKGS_MANUAL=""
-LOGFILE="/var/log/ghc-updater.log"
-
-# portage variables
-PKG_DBDIR=/var/db/pkg
-
-# moved the portageq checks into a function to make command
-# line parsing immediate
-
-setup_portdir() {
- PORTDIR=`portageq portdir`
- PORTDIR_OVERLAYS=`portageq portdir_overlay`
-}
-
-PRETEND=0
-PKGS_TO_REMERGE=""
-PKGS_COUNT_REMERGE=0
-PORTAGE_PYTHON="/usr/bin/python"
-
-usage() {
- echo "usage: ghc-updater [options]"
- echo " -h, -?, --help help"
- echo " -p, --pretend pretend (don't do anything)"
-}
-
-#
-#
-# Command Line Parsing
-#
-#
-while [ -n "$1" ]; do
- case "$1" in
- -h | -\? | --help)
- usage
- exit 0
- ;;
- -p | --pretend)
- PRETEND=1
- ;;
- *)
- usage
- echo "unrecognised option: $1"
- ;;
- esac
- shift
-done
-
-# load the gentoo-style info macros, but hack to get around
-# it thinking this is an rc script
-EBUILD="1"
-
-# /etc/init.d/functions.sh always points to the correct functions.sh no
-# matter which version of baselayout
-source /etc/init.d/functions.sh
-
-# misc helper functions
-eloginfo() {
- einfo $*
- DATESTRING=`date +"%Y/%m/%d %H:%M:%S"`
- (echo "${DATESTRING} - ${*}" >> ${LOGFILE}) 2>/dev/null
-}
-
-elogecho() {
- echo -n " "
- echo $*
- DATESTRING=`date +"%Y/%m/%d %H:%M:%S"`
- (echo "${DATESTRING} - ${*}" >> ${LOGFILE}) 2>/dev/null
-}
-
-elogerr() {
- eerror $*
- DATESTRING=`date +"%Y/%m/%d %H:%M:%S"`
- (echo "${DATESTRING} ! ${*}" >> ${LOGFILE}) 2>/dev/null
-}
-
-elog() {
- DATESTRING=`date +"%Y/%m/%d %H:%M:%S"`
- (echo "${DATESTRING} - ${*}" >> ${LOGFILE}) 2>/dev/null
-}
-
-#
-# Sanity check
-#
-
-setup_portdir
-
-find_in_portdir() {
- local f
- for f in ${PORTDIR} ${PORTDIR_OVERLAYS}; do
- if [[ -f "${f}/${1}" ]]; then
- echo "${f}/${1}"
- return 0
- fi
- done
- return 1
-}
-
-if [ -z "${PORTDIR}" ]; then
- eerror "Unable to proceed. Can not find PORTDIR. Make sure the command:"
- eerror " "
- eerror " portageq portdir"
- eerror " "
- eerror "returns a value. If it doesn't, make sure you have updated to"
- eerror "latest portage version."
- eerror " "
- eerror "Report bugs to http://bugs.gentoo.org/"
- exit 1
-fi
-
-#
-#
-# Find all packages that have installed something in
-# directories of the form
-# /usr/lib/ghc-<version>
-# or similar.
-#
-# /usr/lib/ghc-bin-<version>
-# is included because an old ghc-bin ebuild was buggy and
-# installed to a wrong dir.
-#
-OLD_PACKAGES_DIR=""
-# Exclude new library dir and lib symlinks:
-for d in /{usr,opt/ghc}/lib{,64}/ghc{,-bin}-*; do
- [[ "${d}" == ${NEW_GHC_LIBDIR} ]] || [[ -L ${d%/*} ]] || OLD_PACKAGES_DIR="${OLD_PACKAGES_DIR}${d} "
-done
-
-eloginfo "Starting GHC Updater to $(which ghc), version ${NEW_GHC_VER} :"
-eloginfo "Searching for packages with files in the directories:"
-eloginfo "${OLD_PACKAGES_DIR}"
-
-# iterate thru all the installed package's contents
-for content in `find ${PKG_DBDIR} -name CONTENTS`; do
- # extract the category, package name and package version
- CATPKGVER=$(echo ${content} | sed "s:${PKG_DBDIR}/\(.*\)/CONTENTS:\1:")
-
- # exclude packages that are an exception, like portage and python itself.
- exception=0
- for exp in ${PKGS_EXCEPTIONS}; do
- if [ -n "$(echo ${CATPKGVER} | grep ${exp})" ]; then
- exception=1
- break;
- fi
- done
-
- if [ ${exception} = 1 ]; then
- continue;
- fi
-
- for d in ${OLD_PACKAGES_DIR}; do
- if fgrep "${d}/" ${content} > /dev/null; then
- PKGS_TO_REMERGE="${PKGS_TO_REMERGE} ${CATPKGVER}"
- elogecho "${CATPKGVER} has files in ${d}"
- fi
- done
-done
-
-# now we have to do each emerge seperately because if an installed version
-# does not have the corresponding ebuild in portage, then it will bail.
-
-eloginfo "Calculating Upgrade Package List .."
-
-PKGS_OK=""
-PKGS_MASKED=""
-PKGS_BLOCKED=""
-PKGS_MISSING=""
-
-MASKED_STRING="been masked"
-BLOCKED_STRING="is blocking"
-MISSING_STRING='there are no ebuilds to satisfy'
-
-for pkg in ${PKGS_TO_REMERGE}; do
- emerge_output="$(emerge -p '>='$pkg 2>&1)"
- if $(echo "${emerge_output}" | grep "${MASKED_STRING}" > /dev/null); then
- PKGS_MASKED="${PKGS_MASKED} $pkg"
- elogecho ">=$pkg is masked"
- elif $(echo "${emerge_output}" | grep "${BLOCKED_STRING}" > /dev/null); then
- PKGS_BLOCKED="${PKGS_BLOCKED} $pkg"
- elogecho ">=$pkg is blocked"
- elif $(echo "${emerge_output}" | grep "${MISSING_STRING}" > /dev/null); then
- PKGS_MISSING="${PKGS_MISSING} $pkg"
- elogecho ">=$pkg is missing from portage"
- else
- PKGS_OK="${PKGS_OK} $pkg"
- PKGS_COUNT_REMERGE=$((PKGS_COUNT_REMERGE + 1))
- fi
-done
-
-#
-# Use my super dumb package reordering algorithm that works most of the time
-#
-
-eloginfo "Re-ordering packages to merge .."
-
-DEPSORT=$(find_in_portdir "dev-lang/ghc/files/depsort.py")
-if [[ -z ${DEPSORT} ]]; then
- eerror "Fatal error: File dev-lang/ghc/files/depsort.py not in portage tree."
- exit 1
-fi
-PKGS_OK_SORTED="$(${PORTAGE_PYTHON} ${DEPSORT} ${PKGS_OK} | xargs)"
-
-if [[ -n ${PRETEND} ]]; then
- eloginfo "These are the packages that would be merged, in order:"
-else
- eloginfo "Preparing to merge these packages in this order:"
-fi
-for pkg in $PKGS_OK_SORTED; do
- elogecho ">=$pkg"
-done
-
-# we emerge each package seperately to ensure we know exactly which ones might
-# cause an error, and then report it at the end
-
-COUNT=1
-PKGS_FAILED=""
-if [ "${PRETEND}" != "1" ]; then
- for pkg in ${PKGS_OK_SORTED}; do
- eloginfo "Starting to merge ($COUNT/$PKGS_COUNT_REMERGE) $pkg .."
- if ! emerge --oneshot --nodeps '>='$pkg; then
- PKGS_FAILED="${PKGS_FAILED} $pkg"
- elogerr "Failed merging $pkg ($COUNT/$PKGS_COUNT_REMERGE)!"
- fi
- COUNT=$((COUNT+1))
- done
-fi
-
-# final output stuff
-OUTPUT_PKGS_MASKED=""
-for pkg in ${PKGS_MASKED}; do OUTPUT_PKGS_MASKED="${OUTPUT_PKGS_MASKED} '>='$pkg"; done
-OUTPUT_PKGS_BLOCKED=""
-for pkg in ${PKGS_BLOCKED}; do OUTPUT_PKGS_BLOCKED="${OUTPUT_PKGS_BLOCKED} $pkg"; done
-OUTPUT_PKGS_MISSING=""
-for pkg in ${PKGS_MISSING}; do OUTPUT_PKGS_MISSING="${OUTPUT_PKGS_MISSING} $pkg"; done
-OUTPUT_PKGS_FAILED=""
-for pkg in ${PKGS_FAILED}; do OUTPUT_PKGS_FAILED="${OUTPUT_PKGS_FAILED} '>='$pkg"; done
-
-if [ -n "${PKGS_FAILED}" -o -n "${PKGS_MISSING}" -o -n "${PKGS_MASKED}" ]; then
- echo
- ewarn "************************************************************"
- ewarn "* Packages that still need to be manually emerged : *"
- ewarn "************************************************************"
- if [ -n "${OUTPUT_PKGS_MASKED}" ]; then
- echo
- ewarn " Masked Packages:"
- ewarn " ----------------"
- ewarn " Unmask the following packages (at your own risk) and "
- ewarn " emerge them using this command after removing the '-p'"
- ewarn " parameter."
- echo
- ewarn " emerge -p ${OUTPUT_PKGS_MASKED}"
- echo
- fi
- if [ -n "${OUTPUT_PKGS_BLOCKED}" ]; then
- echo
- ewarn " Blocked Packages:"
- ewarn " -----------------"
- ewarn " These packages are currently blocked; they might not yet"
- ewarn " be compatible with the current ghc. You can run ghc-updater"
- ewarn " again at a later time."
- echo
- for x in ${OUTPUT_PKGS_BLOCKED}; do
- echo " ${x}"
- done
- fi
- if [ -n "${OUTPUT_PKGS_MISSING}" ]; then
- echo
- ewarn " Missing Packages:"
- ewarn " -----------------"
- ewarn " These packages cannot be updated because they do not exist"
- ewarn " in portage anymore."
- echo
- for x in ${OUTPUT_PKGS_MISSING}; do
- echo " ${x}"
- done
- fi
- if [ -n "${OUTPUT_PKGS_FAILED}" ]; then
- echo
- ewarn " Failed Packages:"
- ewarn " ----------------"
- ewarn " These packages have failed and need to be re-emerged again."
- ewarn " Alternatively, try re-running this script again to see if it"
- ewarn " can be fixed."
- echo
- ewarn " emerge -p ${OUTPUT_PKGS_FAILED}"
- echo
- fi
-
- elog "GHC update completed with errors."
- elog "Masked Packages:"
- for x in ${PKGS_MASKED}; do
- elog $x
- done
- elog "Missing Packages:"
- for x in ${PKGS_MISSING}; do
- elog $x
- done
- elog "Failed Packages:"
- for x in ${PKGS_FAILED}; do
- elog $x
- done
- elog "Update script completed."
-else
- eloginfo "GHC update completed successfully."
-fi