From owner-dev-commits-ports-main@freebsd.org Tue Apr 6 10:40:04 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08EC75CA68F; Tue, 6 Apr 2021 10:40:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FF3v76TBVz4TDS; Tue, 6 Apr 2021 10:40:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC64E2168; Tue, 6 Apr 2021 10:40:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 136Ae3hJ086474; Tue, 6 Apr 2021 10:40:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 136Ae3MR086471; Tue, 6 Apr 2021 10:40:03 GMT (envelope-from git) Date: Tue, 6 Apr 2021 10:40:03 GMT Message-Id: <202104061040.136Ae3MR086471@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Rene Ladan Subject: git: a4c3b6f622b8 - main - Remove two tools that are no longer useful with Git. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rene X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4c3b6f622b81ac9a0848c782b4645e0e9dcfcd0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Apr 2021 10:40:04 -0000 The branch main has been updated by rene: URL: https://cgit.FreeBSD.org/ports/commit/?id=a4c3b6f622b81ac9a0848c782b4645e0e9dcfcd0 commit a4c3b6f622b81ac9a0848c782b4645e0e9dcfcd0 Author: Rene Ladan AuthorDate: 2021-04-06 10:28:35 +0000 Commit: Rene Ladan CommitDate: 2021-04-06 10:39:46 +0000 Remove two tools that are no longer useful with Git. - mfh: this is replaced by 'git cherry-pick -x HASH' - psvn: unlike svn, git has no per-file properties Adjust README accordingly. Differential Revision: https://reviews.freebsd.org/D29451 With hat: portmgr --- Tools/scripts/README | 1 - Tools/scripts/mfh | 195 --------------------------------------------------- Tools/scripts/psvn | 191 ------------------------------------------------- 3 files changed, 387 deletions(-) diff --git a/Tools/scripts/README b/Tools/scripts/README index af5771794569..079a78a29b58 100644 --- a/Tools/scripts/README +++ b/Tools/scripts/README @@ -32,7 +32,6 @@ getpatch.sh - downloads patch attachments from a Bug Tracking Systems (plain she gnomedepends - Analyse pkg/PLIST and give an advice as to which GNOME ports should be listes in {RUN,LIB}_DEPENDS for this port mark_safe.pl - utility to set subsets of ports to MAKE_JOBS_(UN)SAFE=yes -mfh - Merge from head to a given branch neededlibs.sh - Extract direct library dependencies from binaries. portsearch - A utility for searching the ports tree. It allows more detailed search criteria than ``make search key='' and accepts diff --git a/Tools/scripts/mfh b/Tools/scripts/mfh deleted file mode 100755 index 85427a48fe7e..000000000000 --- a/Tools/scripts/mfh +++ /dev/null @@ -1,195 +0,0 @@ -#!/bin/sh -# -# mfh - Merge from head to a given branch -# -# Usage: mfh [] [] -# is optional and defaults to latest branch -# If supplying multiple revnumbers, put them in chronological order -# (111111 111112 111113) -# -# Copyright 2013 Baptiste Daroussin -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# MAINTAINER= portmgr@FreeBSD.org - -set -eu - -LF=$(printf '\nX') -LF=${LF%X} -IFS="${LF}" - -# defaults from here --------------------------- - -: ${svnserver:="svn+ssh://repo.FreeBSD.org"} -: ${EDITOR:=vi} - -# implementation from here --------------------- - -err() { - echo "$@" >&2 - exit 1 -} - -ask() { - question=${1} - - answer=x - while [ "${answer}" != "y" -a "${answer}" != "n" ] ; do - printf "%s [y/n] " "${question}" - read -r answer - done - - [ "${answer}" = "y" ] && return 0 - return 1 -} - -# -- find svn and diff coloring command -- - -if [ -n "$(command -v svn 2>/dev/null)" ]; then - svn=svn -elif [ -n "$(command -v svnlite 2>/dev/null)" ]; then - svn=svnlite -else - err "Neither svn(1) nor svnlite(1) found. Please install devel/subversion." -fi - -latest_branch=$("${svn}" ls ${svnserver}/ports/branches/|sed -ne '/^2.*Q./s|/$||p'|tail -1) - -[ $# -lt 1 ] && err "$(basename "$0") requires at least 1 arguments: [] [...]" -branch=$1 - -if [ -n "$(command -v ydiff)" ] ; then cdiffcmd=ydiff -elif [ -n "$(command -v colordiff)" ] ; then cdiffcmd=colordiff -else cdiffcmd=cat -fi - -# I sure hope by 2030 we'll be doing something else. Yes, famous last words. -if expr -- "${branch}" : '20[12][0-9]Q[1-4]' > /dev/null; then - shift - if [ "${latest_branch}" != "${branch}" ]; then - ask "/!\\ The latest branch is ${latest_branch}, do you really want to commit to ${branch}?" || exit 1 - fi -else - branch=${latest_branch} -fi - -## -- parse revisions -- - -for rev in "$@" -do - rev=${rev##r} # remove a leading "r" - case ${rev} in - ''|*[!-0-9]*) err "revision \"${rev}\" should be a number" ;; - esac -done - -## -- set up tmpdir and auto-clean -- - -dir=$(mktemp -d /tmp/mfh.XXXXXX) -trap "rc=\$? ; echo '+ rm -rf \"${dir}\"' ; rm -rf \"\${dir}\" ; trap - EXIT ; exit \$rc" EXIT INT QUIT TERM -cd "${dir}" - -## -- check out, merge, generate commit log -- - -printf "MFH:" > commit.txt -for rev in "$@" -do - rev=${rev##r} - printf " r%s" "${rev}" >> commit.txt -done -echo >> commit.txt - -# iterate over revisions to assemble dirlist (for checkout) -# and accumulate log messages -dirlist="" -for rev in "$@" -do - rev=${rev##r} - for f in $("${svn}" diff --summarize -c "r${rev}" "${svnserver}/ports/head"); do - # ignore top-level filenames without slash - case ${f} in - */*) ;; - *) continue ;; - esac - f=${f#*/ports/head/} - # strip down f to the first two components (CATEGORY/PORTNAME), - # so that if the MFH only addresses files/, we still get the - # full port to review, and, for instance, bump PORTREVISION - # separately if the patch was broken out from a larger lump. - while :; do - case ${f} in - */*/*) f=${f%/*} ;; - *) break ;; - esac - done - dirlist="${dirlist}${f}${LF}" - done - "${svn}" log "-r${rev##-}" ${svnserver}/ports/head | sed '1,2d;$d;/^MFH:/d' \ - | sed '$d' >> commit.txt -done -dirlist=$(printf '%s' "${dirlist}" | sort -u | sed "s}^}${branch}/}") - -"${svn}" co --quiet --depth=empty ${svnserver}/ports/branches/"${branch}" -"${svn}" up --parents --set-depth=infinity $dirlist -"${svn}" up --quiet "${branch}" -for rev in "$@" -do - rev=${rev##r} - "${svn}" merge -c "r${rev}" ^/head/ "${branch}" -done -"${svn}" up --quiet "${branch}" - -## -- present final result to user -- -svnstat=$("${svn}" status "${branch}") -if [ -z "${svnstat}" ] ; then - err "The MFH came up empty - already merged? Wrong revision given?" -fi - -echo -printf '%s\n' "${svnstat}" -"${svn}" diff "${branch}" | $cdiffcmd -printf '\nSee the status/diff above: all the merge work was done on %s.\n' "${dir}/${branch}" -ask "Do you want to commit? (no = start a shell)" || ( - echo "Dropping you to a shell so you can investigate. Exit the shell to resume this script." - cd "${branch}" - pwd - su -m $(id -un) || : - ask "Do you want to commit now? (no = clean up and abort)" || err "User-requested abort." -) -echo >> commit.txt - -## -- edit pre-assembled log message and commit -- -${EDITOR} commit.txt -while ! "${svn}" ci -F commit.txt "${branch}"; do - if ! ask "Commit failed. Re-edit message and try again?"; then - save_log="$(mktemp -t mfh)" - cp -f commit.txt "${save_log}" - echo "Saving commit log to ${save_log}" - break - fi - ${EDITOR} commit.txt -done - -# the trap will clean up for us -exit 0 diff --git a/Tools/scripts/psvn b/Tools/scripts/psvn deleted file mode 100755 index 74368cdbd452..000000000000 --- a/Tools/scripts/psvn +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/sh -eu -# -# psvn - Wrapper to set Subversion properties automatically -# -# Copyright (c) 2012 Beat Gaetzi -# Copyright (c) 2012,2014 Matthias Andree -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# -# $FreeBSD$ -# -# MAINTAINER= mandree@FreeBSD.org -# beat@ has implicit approval to change this script. -# - -# -# The psvn wrapper checkes from replaced, conflicting, missing or -# untracked files. When committing it adds the needed Subversion -# properties and removes unneeded ones. -# There is also adds a check subcommand which just executes the -# checks. -# - -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:${PATH} -export PATH - -SVN="$(which svn)" -LF="$(printf '\nX')" -LF="${LF%X}" - -VERSION=$("${SVN}" --version --quiet | sed -e 's,^\(.*\)\.\(.*\)\..*,\1\2,') -if [ ${VERSION} -lt 17 ] ; -then - echo "===> Please consider upgrading to Subversion 1.7 (or newer)" -fi - -checkstatus () { - local IFS _error _file _status _statusline - - _error=0 - eval "set -- $@" - IFS="$LF" - set -- $("${SVN}" status -- "$@") - - for _statusline - do - _status="$(printf '%.7s' "${_statusline}")" - _file="${_statusline##????????}" - - case "${_status}" in - R*) - printf >&2 '===> Do not replace files as this may lose history: "%s"\n' "${_file}" - _error=1 - ;; - C*|?C*) - printf >&2 '===> Conflict detected: \"%s\"\n' "${_file}" - _error=1 - ;; - \~*) - printf >&2 '===> Versioned item \"%s\" obstructed.\n' "${_file}" - _error=1 - ;; - \?*) - printf >&2 '===> Untracked new file "%s". Consider svn adding or deleting it.\n' "${_file}" - _error=1 - ;; - \!*) - printf >&2 '===> Missing file "%s". Consider re-adding or svn deleting it.\n' "${_file}" - _error=1 - ;; - esac - done - - if [ ${_error} -ne 0 ] ; - then - exit 1 - fi -} - -setprop () { - local _file - - eval "set -- $1" - - for _file - do - if [ -d "${_file}" -o ! -e "${_file}" ] ; - then - continue - fi - printf >&2 '=> Adding svn keywords to "%s"\n' "${_file}" - case $(egrep -- '\$FreeBSD\$|\$[BDFSer]+:' "${_file}" >/dev/null || echo $?) in - "") # matched pattern - "${SVN}" -q -- propset svn:keywords "FreeBSD=%H" "${_file}" - "${SVN}" -q -- propdel fbsd:nokeywords "${_file}" - ;; - 1) # no match - "${SVN}" -q -- propset fbsd:nokeywords yes "${_file}" - "${SVN}" -q -- propdel svn:keywords "${_file}" - ;; - *) # egrep failed - exit 1 - ;; - esac - if [ "${_file##/*}" != "bsd.port.mk" ] ; then - "${SVN}" -q -- propset svn:eol-style native "${_file}" - fi - "${SVN}" -q -- propset svn:mime-type text/plain "${_file}" - "${SVN}" -q -- propdel cvs2svn:cvs-rev "${_file}" - done -} - -# taken from "Rich's sh (POSIX shell) tricks", -# a "Programming Guide[...]" at http://www.etalabs.net/sh_tricks.html -savearray() { - for i do - printf %s\\n "$i" | sed -e "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" - done - echo " " -} - -getfilequotedarray() { - local varname IFS - varname="$1" - shift - IFS="$LF" - set -- $("${SVN}" status -- "$@" | grep -v '^ ' | sed 's/^....... //') - eval "$varname=\$(savearray "\$@")" -} - -for opt ; do - case "${opt}" in - -*) continue ;; - esac - case "${opt}" in - check) - shift - if [ $# -gt 0 ] ; then - echo >&2 "===> Unsupported option before, or garbage after command" - exit 1 - fi - getfilequotedarray "files" "$@" - checkstatus "${files}" - exit 0 - ;; - ci|commit) - savedargs=$(savearray "$@") - shift - while getopts :qm:F: opt - do - case "$opt" in - q) ;; - m) ;; - F) ;; - \?) echo >&2 "===> Unsupported option -$OPTARG encountered. Abort." - exit 1 ;; - :) echo >&2 "===> Missing argument to option -$OPTARG. Abort." - exit 1 ;; - esac - done - shift $(($OPTIND - 1)) - - getfilequotedarray "files" "$@" - checkstatus "${files}" - setprop "${files}" - - eval "set -- $savedargs" - exec "${SVN}" "$@" - ;; - *) - exec "${SVN}" "$@" - ;; - esac -done