mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-22 07:06:22 +00:00
scripts: Remove non-Git VCS support
Mercurial branches remain in source-listing and cleanup helpers after Subversion support was retired. SCST development now uses Git. Remove Mercurial detection and commands together with stale Subversion wording. Preserve the existing no-VCS source-list fallback and all Git behavior.
This commit is contained in:
@@ -7,20 +7,10 @@ usage() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
word_in_list() {
|
||||
local a word=$1
|
||||
|
||||
shift
|
||||
for a in "$@"; do
|
||||
[ "$word" = "$a" ] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
remove_empty_directories() {
|
||||
find . -depth -type d |
|
||||
sed 's|^\./||' |
|
||||
grep -Ev '^\.$|^\.svn/|/\.svn/|/\.svn$|^\.hg/|^\.hg$|^\.git/|^\.git$' |
|
||||
grep -Ev '^\.$|^\.git/|^\.git$' |
|
||||
while read -r d; do
|
||||
for f in "$d"/{*,.*}; do
|
||||
if ! [ -e "$f" ]; then
|
||||
@@ -31,13 +21,11 @@ remove_empty_directories() {
|
||||
done
|
||||
}
|
||||
|
||||
exclude=("TAGS")
|
||||
git_options=(-e TAGS)
|
||||
|
||||
while [ "${1#-}" != "$1" ]; do
|
||||
case "$1" in
|
||||
-x)
|
||||
exclude+=("$2")
|
||||
git_options+=(-e "$2")
|
||||
shift; shift;;
|
||||
*)
|
||||
@@ -55,14 +43,8 @@ for d in "${@-.}"; do
|
||||
fi
|
||||
git clean -f -d -x "${git_options[@]}" >/dev/null
|
||||
remove_empty_directories
|
||||
elif [ -e .hg ] || [ -e ../.hg ]; then
|
||||
if ! type -p hg >&/dev/null; then
|
||||
echo "$0: hg: not found."
|
||||
exit 0
|
||||
fi
|
||||
hg purge --all
|
||||
else
|
||||
echo "$0: $d: not administered by Subversion, Git or Mercurial."
|
||||
echo "$0: $d: not administered by Git."
|
||||
fi
|
||||
fi
|
||||
)
|
||||
|
||||
@@ -4,7 +4,7 @@ set -o pipefail
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Script for converting the SCST source tree as it exists in the Subversion
|
||||
# Script for converting the SCST source tree as it exists in the Git
|
||||
# repository to a Linux kernel patch.
|
||||
#
|
||||
# Copyright (C) 2008-2020 Bart Van Assche <bvanassche@acm.org>
|
||||
@@ -214,7 +214,7 @@ srpt="true"
|
||||
|
||||
if [ ! -e scst ] || [ ! -e iscsi-scst ] || [ ! -e srpt ] ||
|
||||
[ ! -e scst_local ]; then
|
||||
echo "Please run this script from inside the SCST subversion source tree."
|
||||
echo "Please run this script from inside the SCST Git source tree."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -2,19 +2,6 @@
|
||||
|
||||
export LC_ALL=C
|
||||
|
||||
prefix_matches() {
|
||||
local f
|
||||
|
||||
f="$1"
|
||||
shift
|
||||
for s in "$@"; do
|
||||
if [ "$f" = "$s" ] || [ "${f#"$s/"}" != "$f" ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
for d in "${@-.}"; do
|
||||
(
|
||||
cd "$d" &&
|
||||
@@ -26,23 +13,6 @@ for d in "${@-.}"; do
|
||||
done
|
||||
while { read -r g; } <&3; do echo "$g"; done
|
||||
exec 3<&-
|
||||
elif hg branch >&/dev/null; then
|
||||
subrepos=$(if [ -e .hgsub ]; then sed 's/ = .*//' .hgsub; fi)""
|
||||
exec 3< <(find . -type f | cut -c3- | grep -Ev '^$|^\.hg/' | sort)
|
||||
hg locate |
|
||||
sort |
|
||||
while read -r f; do
|
||||
while { read -r g; } <&3 && [ "$g" '<' "$f" ]; do
|
||||
if ! prefix_matches "$g" "$subrepos"; then
|
||||
echo "$g"
|
||||
fi
|
||||
done
|
||||
done
|
||||
while { read -r g; } <&3; do echo "$g"; done
|
||||
exec 3<&-
|
||||
for s in $subrepos; do
|
||||
$0 "$s"
|
||||
done
|
||||
else
|
||||
echo "Ignored directory $PWD"
|
||||
fi
|
||||
|
||||
@@ -5,8 +5,7 @@ list_source_files() {
|
||||
|
||||
d="$(cd "$1" && echo "$PWD")"
|
||||
r="$d"
|
||||
while [ "$r" != "/" ] && [ ! -e "$r/.git" ] &&
|
||||
[ ! -e "$r/.hg" ]; do
|
||||
while [ "$r" != "/" ] && [ ! -e "$r/.git" ]; do
|
||||
r="$(dirname "$r")"
|
||||
done
|
||||
|
||||
@@ -17,14 +16,6 @@ list_source_files() {
|
||||
else
|
||||
echo "Ignored directory $1" >&2
|
||||
fi
|
||||
elif [ -e "$r/.hg" ]; then
|
||||
subdir="${d#"${r}"}"
|
||||
if [ -n "${subdir}" ]; then
|
||||
subdir="${subdir#/}/"
|
||||
hg manifest | sed -n "s|^$subdir||p"
|
||||
else
|
||||
hg manifest
|
||||
fi
|
||||
else
|
||||
(
|
||||
cd "$d" &&
|
||||
|
||||
@@ -90,7 +90,7 @@ function test_scst_tree_patches {
|
||||
}
|
||||
|
||||
# Copy the entire SCST source code tree from "$1" into the current directory.
|
||||
# Only copy those files which are administered by Subversion.
|
||||
# Only copy files tracked by Git.
|
||||
function duplicate_scst_source_tree {
|
||||
if [ -e "$1/AskingQuestions" ]; then
|
||||
( set -o pipefail
|
||||
@@ -564,7 +564,7 @@ function run_make_htmldocs {
|
||||
export LC_ALL=C
|
||||
|
||||
if [ ! -e scst ] || [ ! -e iscsi-scst ] || [ ! -e srpt ]; then
|
||||
echo "Please run this script from inside the SCST subversion source tree."
|
||||
echo "Please run this script from inside the SCST Git source tree."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user