pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/arcanist arcanist should not rely on bash.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b6099fe613a4
branches:  trunk
changeset: 360502:b6099fe613a4
user:      roy <roy%pkgsrc.org@localhost>
date:      Thu Mar 30 20:14:16 2017 +0000

description:
arcanist should not rely on bash.

diffstat:

 devel/arcanist/Makefile              |  12 ++++---
 devel/arcanist/distinfo              |   3 +-
 devel/arcanist/patches/patch-bin_arc |  53 ++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+), 6 deletions(-)

diffs (104 lines):

diff -r 7e2a811564fc -r b6099fe613a4 devel/arcanist/Makefile
--- a/devel/arcanist/Makefile   Thu Mar 30 19:23:53 2017 +0000
+++ b/devel/arcanist/Makefile   Thu Mar 30 20:14:16 2017 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.6 2017/03/17 12:40:58 roy Exp $
+# $NetBSD: Makefile,v 1.7 2017/03/30 20:14:16 roy Exp $
 
 DISTNAME=              arcanist-20170225
+PKGREVISION=           1
 CATEGORIES=            devel
 MASTER_SITES=          ${MASTER_SITE_GITHUB:=phacility/}
 GITHUB_PROJECT=                arcanist
@@ -20,8 +21,6 @@
 
 CONFLICTS+=            arc-[0-9]*:../../archivers/arc
 
-REPLACE_BASH+=         bin/arc
-
 SUBST_CLASSES+=                php
 SUBST_MESSAGE.php=     Fixing PHP path
 SUBST_STAGE.php=       post-configure
@@ -40,8 +39,11 @@
 INSTALLATION_DIRS+=    ${ARCANISTDIR} bin
 
 do-install:
-       cd ${WRKSRC} && ${PAX} -rw * ${DESTDIR}${PREFIX}/${ARCANISTDIR}
-       ln -s ${PREFIX}/${ARCANISTDIR}/bin/arc ${DESTDIR}${PREFIX}/bin/arc
+       cd ${WRKSRC} && \
+               ${PAX} -rw * -s',.*\.orig$$,,' \
+               ${DESTDIR}${PREFIX}/${ARCANISTDIR}
+       ln -s ${PREFIX}/${ARCANISTDIR}/scripts/arcanist.php \
+               ${DESTDIR}${PREFIX}/bin/arc
 
 .include "../../lang/python/application.mk"
 .include "../../lang/php/phpversion.mk"
diff -r 7e2a811564fc -r b6099fe613a4 devel/arcanist/distinfo
--- a/devel/arcanist/distinfo   Thu Mar 30 19:23:53 2017 +0000
+++ b/devel/arcanist/distinfo   Thu Mar 30 20:14:16 2017 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.2 2017/03/17 12:40:58 roy Exp $
+$NetBSD: distinfo,v 1.3 2017/03/30 20:14:16 roy Exp $
 
 SHA1 (arcanist-20170225-822bc53ca306e06314560d8a76f68771d732e8e0.tar.gz) = 34fb6fce4e5f9dc3b924274ddff0fa9c423fbb0c
 RMD160 (arcanist-20170225-822bc53ca306e06314560d8a76f68771d732e8e0.tar.gz) = 0e78dccc79c10a8f63caf2af4427d658c3ae48b0
 SHA512 (arcanist-20170225-822bc53ca306e06314560d8a76f68771d732e8e0.tar.gz) = 
1ae4d5585c434ef9c83df9b22b9a2d142f85d751251c8d5c225ea051516efab9e4aa307aa3079ac28c20cd68a0281d95fbc17025f0c7089c4b6e0ef3403ad786
 Size (arcanist-20170225-822bc53ca306e06314560d8a76f68771d732e8e0.tar.gz) = 501506 bytes
+SHA1 (patch-bin_arc) = 91c261f720efe6f6783e9a3e4044f50e74d4b425
diff -r 7e2a811564fc -r b6099fe613a4 devel/arcanist/patches/patch-bin_arc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/arcanist/patches/patch-bin_arc      Thu Mar 30 20:14:16 2017 +0000
@@ -0,0 +1,53 @@
+$NetBSD: patch-bin_arc,v 1.1 2017/03/30 20:14:16 roy Exp $
+
+commit dcf167cba8294310d03c29b2eec82c2aea8aa9b4
+Author: Roy Marples <roy%marples.name@localhost>
+Date:   Thu Mar 30 12:20:19 2017 +0100
+
+    arcanist: arc should work with any POSIX shell
+    
+    Summary:
+    Currently arc requires bash for `$BASH_SOURCE[0]` and
+    substring range removal, both of which are bash specific features.
+    
+    This patch gets the same result with `$0` and string prefix removal,
+    both of are are POSIX features and as such all shells should support.
+    
+    Fixes T12477.
+    
+    Test Plan:
+      *  Run `bin/arc` on systems with bash and other shells as `/bin/sh`
+    
+    Reviewers: #blessed_reviewers!
+    
+    Subscribers: epriestley
+    
+    Maniphest Tasks: T12477
+    
+    Differential Revision: https://secure.phabricator.com/D17582
+
+diff --git a/bin/arc b/bin/arc
+index e125698b..96f321a3 100755
+--- bin/arc
++++ bin/arc
+@@ -1,14 +1,16 @@
+-#!/usr/bin/env bash
++#!/bin/sh
+ 
+ # NOTE: This file is a wrapper script instead of a symlink so it will work in
+ # the Git Bash environment in Windows.
+ 
+-# Do bash magic to resolve the real location of this script through aliases,
++# Do shell magic to resolve the real location of this script through aliases,
+ # symlinks, etc.
+-SOURCE="${BASH_SOURCE[0]}";
++SOURCE="$0";
+ while [ -h "$SOURCE" ]; do
+   LINK="$(readlink "$SOURCE")";
+-  if [ "${LINK:0:1}" == "/" ]; then
++  # Test if the first character of $LINK is / by removing it from the front
++  # and testing equality
++  if [ "${LINK#/}" != "$LINK" ]; then
+     # absolute symlink
+     SOURCE="$LINK"
+   else



Home | Main Index | Thread Index | Old Index