Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Feb 2021 18:25:25 +0000 (UTC)
From:      Gleb Popov <arrowd@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r565321 - in head/x11-wm/hs-xmonad: . files
Message-ID:  <202102151825.11FIPPEI031261@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arrowd
Date: Mon Feb 15 18:25:25 2021
New Revision: 565321
URL: https://svnweb.freebsd.org/changeset/ports/565321

Log:
  x11-wm/hs-xmonad: Improve the sample build script.
  
  PR:		253167

Modified:
  head/x11-wm/hs-xmonad/Makefile
  head/x11-wm/hs-xmonad/files/example_buildscript

Modified: head/x11-wm/hs-xmonad/Makefile
==============================================================================
--- head/x11-wm/hs-xmonad/Makefile	Mon Feb 15 17:23:14 2021	(r565320)
+++ head/x11-wm/hs-xmonad/Makefile	Mon Feb 15 18:25:25 2021	(r565321)
@@ -3,7 +3,7 @@
 
 PORTNAME=	xmonad
 PORTVERSION=	0.15
-PORTREVISION=	7
+PORTREVISION=	8
 CATEGORIES=	x11-wm haskell
 
 MAINTAINER=	haskell@FreeBSD.org

Modified: head/x11-wm/hs-xmonad/files/example_buildscript
==============================================================================
--- head/x11-wm/hs-xmonad/files/example_buildscript	Mon Feb 15 17:23:14 2021	(r565320)
+++ head/x11-wm/hs-xmonad/files/example_buildscript	Mon Feb 15 18:25:25 2021	(r565321)
@@ -6,16 +6,24 @@ EXE_NAME=xmonad-config
 # xmonad tells us how it want resulting executable to be named
 output_file=$1; shift
 
-CFG_DIR=$HOME/.xmonad
+CFG_DIR="$HOME/.xmonad"
 
+if [ ! -f "$HOME/.cabal/config" ]; then
+cabal new-update
+fi
+
 # build the config
 cd $CFG_DIR
-cabal new-clean || true
 cabal new-configure --enable-optimization --enable-executable-stripping
 cabal new-build
 
 if [ "$output_file" != "" ]; then
 # move resulting binary where it was requested to reside
-find $CFG_DIR/dist-newstyle -type f -perm +111 -name $EXE_NAME \
-     -exec mv '{}' $output_file ';'
+res=`find $CFG_DIR/dist-newstyle -type f -perm +111 -name $EXE_NAME`
+if [ "$res" == "" ]; then
+    return 1
+fi
+# use "mv" to be able to replace a running executable
+mv -f "$res" "$output_file"
+cp "$output_file" "$res"
 fi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102151825.11FIPPEI031261>