head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.74 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.72 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.70 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.68 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.66 pkgsrc-2025Q1-base:1.1 pkgsrc-2024Q4:1.1.0.64 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.62 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.60 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.58 pkgsrc-2024Q1-base:1.1 pkgsrc-2023Q4:1.1.0.56 pkgsrc-2023Q4-base:1.1 pkgsrc-2023Q3:1.1.0.54 pkgsrc-2023Q3-base:1.1 pkgsrc-2023Q2:1.1.0.52 pkgsrc-2023Q2-base:1.1 pkgsrc-2023Q1:1.1.0.50 pkgsrc-2023Q1-base:1.1 pkgsrc-2022Q4:1.1.0.48 pkgsrc-2022Q4-base:1.1 pkgsrc-2022Q3:1.1.0.46 pkgsrc-2022Q3-base:1.1 pkgsrc-2022Q2:1.1.0.44 pkgsrc-2022Q2-base:1.1 pkgsrc-2022Q1:1.1.0.42 pkgsrc-2022Q1-base:1.1 pkgsrc-2021Q4:1.1.0.40 pkgsrc-2021Q4-base:1.1 pkgsrc-2021Q3:1.1.0.38 pkgsrc-2021Q3-base:1.1 pkgsrc-2021Q2:1.1.0.36 pkgsrc-2021Q2-base:1.1 pkgsrc-2021Q1:1.1.0.34 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.32 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.30 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.26 pkgsrc-2020Q2-base:1.1 pkgsrc-2020Q1:1.1.0.6 pkgsrc-2020Q1-base:1.1 pkgsrc-2019Q4:1.1.0.28 pkgsrc-2019Q4-base:1.1 pkgsrc-2019Q3:1.1.0.24 pkgsrc-2019Q3-base:1.1 pkgsrc-2019Q2:1.1.0.22 pkgsrc-2019Q2-base:1.1 pkgsrc-2019Q1:1.1.0.20 pkgsrc-2019Q1-base:1.1 pkgsrc-2018Q4:1.1.0.18 pkgsrc-2018Q4-base:1.1 pkgsrc-2018Q3:1.1.0.16 pkgsrc-2018Q3-base:1.1 pkgsrc-2018Q2:1.1.0.14 pkgsrc-2018Q2-base:1.1 pkgsrc-2018Q1:1.1.0.12 pkgsrc-2018Q1-base:1.1 pkgsrc-2017Q4:1.1.0.10 pkgsrc-2017Q4-base:1.1 pkgsrc-2017Q3:1.1.0.8 pkgsrc-2017Q3-base:1.1 pkgsrc-2017Q2:1.1.0.4 pkgsrc-2017Q2-base:1.1 pkgsrc-2017Q1:1.1.0.2; locks; strict; comment @# @; 1.1 date 2017.03.30.20.14.16; author roy; state Exp; branches 1.1.2.1; next ; commitid DqIcBZVILpy05CLz; 1.1.2.1 date 2017.03.30.20.14.16; author spz; state dead; branches; next 1.1.2.2; commitid SIrm7yFYHwMDF6Mz; 1.1.2.2 date 2017.04.03.16.22.38; author spz; state Exp; branches; next ; commitid SIrm7yFYHwMDF6Mz; desc @@ 1.1 log @arcanist should not rely on bash. @ text @$NetBSD$ commit dcf167cba8294310d03c29b2eec82c2aea8aa9b4 Author: Roy Marples 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 @ 1.1.2.1 log @file patch-bin_arc was added on branch pkgsrc-2017Q1 on 2017-04-03 16:22:38 +0000 @ text @d1 53 @ 1.1.2.2 log @Pullup ticket #5230 - requested by sevan devel/arcanist: dependency fix Revisions pulled up: - devel/arcanist/Makefile 1.7 - devel/arcanist/distinfo 1.3 - devel/arcanist/patches/patch-bin_arc 1.1 ------------------------------------------------------------------- Module Name: pkgsrc Committed By: roy Date: Thu Mar 30 20:14:16 UTC 2017 Modified Files: pkgsrc/devel/arcanist: Makefile distinfo Added Files: pkgsrc/devel/arcanist/patches: patch-bin_arc Log Message: arcanist should not rely on bash. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 pkgsrc/devel/arcanist/Makefile cvs rdiff -u -r1.2 -r1.3 pkgsrc/devel/arcanist/distinfo cvs rdiff -u -r0 -r1.1 pkgsrc/devel/arcanist/patches/patch-bin_arc @ text @a0 53 $NetBSD$ commit dcf167cba8294310d03c29b2eec82c2aea8aa9b4 Author: Roy Marples 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 @