make, scripts: Rename list-cvs-files.sh to list-vcs-files.sh
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
d125b20fad
commit
9b532fd601
8 changed files with 7 additions and 7 deletions
|
|
@ -6,7 +6,7 @@ DAV_SERVER ?= cvs.jannet.de
|
||||||
DAV_RSYNC_SERVER ?= $(DAV_SERVER)
|
DAV_RSYNC_SERVER ?= $(DAV_SERVER)
|
||||||
DAV_RSYNC_DIR ?= /srv/dav/pub/groups/$(DAV_GROUP)/$(DAV_GROUP_PROJECT)
|
DAV_RSYNC_DIR ?= /srv/dav/pub/groups/$(DAV_GROUP)/$(DAV_GROUP_PROJECT)
|
||||||
DAV_RSYNC_URL = $(DAV_RSYNC_SERVER):$(DAV_RSYNC_DIR)
|
DAV_RSYNC_URL = $(DAV_RSYNC_SERVER):$(DAV_RSYNC_DIR)
|
||||||
DAV_RSYNC_EXCLUDE ?= $(shell bash $(MOD_SCRIPT_DIR)/list-cvs-files.sh)
|
DAV_RSYNC_EXCLUDE ?= $(shell bash $(MOD_SCRIPT_DIR)/list-vcs-files.sh)
|
||||||
DAV_RSYNC_EXCLUDE_OPTS = $(addprefix --exclude , $(DAV_RSYNC_EXCLUDE) '*.done')
|
DAV_RSYNC_EXCLUDE_OPTS = $(addprefix --exclude , $(DAV_RSYNC_EXCLUDE) '*.done')
|
||||||
DAV_RSYNC_EXTRA_OPTS ?=
|
DAV_RSYNC_EXTRA_OPTS ?=
|
||||||
DAV_RSYNC ?= rsync $(DAV_RSYNC_EXCLUDE_OPTS)
|
DAV_RSYNC ?= rsync $(DAV_RSYNC_EXCLUDE_OPTS)
|
||||||
|
|
|
||||||
|
|
@ -749,7 +749,7 @@ define install_local_cfg
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define cvs_files
|
define cvs_files
|
||||||
sh $(MOD_SCRIPT_DIR)/list-cvs-files.sh -f
|
sh $(MOD_SCRIPT_DIR)/list-vcs-files.sh -f
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define add_flavour_prefix
|
define add_flavour_prefix
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ PROJECTS_PY_BUILD = $(PROJECTS_PY) build $(PROJECTS_PY_EXTRA_BUILD_OPTS)
|
||||||
PURGE_SH = /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/purge-stale-projects.sh /opt/jw-build/bin/purge-stale-projects.sh) purge-not-found)
|
PURGE_SH = /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/purge-stale-projects.sh /opt/jw-build/bin/purge-stale-projects.sh) purge-not-found)
|
||||||
PKG_MANAGER_SH ?= /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/pkg-manager.sh /opt/jw-build/bin/pkg-manager.sh) pkg-manager-not-found)
|
PKG_MANAGER_SH ?= /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/pkg-manager.sh /opt/jw-build/bin/pkg-manager.sh) pkg-manager-not-found)
|
||||||
CREATE_PROJECT_SH ?= /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/jw-build-create-project.sh /opt/jw-build/bin/jw-build-create-project.sh) jw-build-create-project-not-found)
|
CREATE_PROJECT_SH ?= /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/jw-build-create-project.sh /opt/jw-build/bin/jw-build-create-project.sh) jw-build-create-project-not-found)
|
||||||
LIST_VCS_FILES = /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/list-cvs-files.sh /opt/jw-build/bin/list-cvs-files.sh) list-cvs-files-not-found)
|
LIST_VCS_FILES = /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/list-vcs-files.sh /opt/jw-build/bin/list-vcs-files.sh) list-vcs-files-not-found)
|
||||||
JW_PKG = /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/jw-pkg /opt/jw-build/bin/jw-pkg) jw-pkg-not-found)
|
JW_PKG = /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/jw-pkg /opt/jw-build/bin/jw-pkg) jw-pkg-not-found)
|
||||||
BROWSER ?= xdg-open
|
BROWSER ?= xdg-open
|
||||||
EDITOR ?= xdg-open
|
EDITOR ?= xdg-open
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,7 @@ define increase_build_number
|
||||||
echo -n "+ increasing build number to " ;\
|
echo -n "+ increasing build number to " ;\
|
||||||
echo $(MAJOR_MINOR_RELEASE)-$(shell expr $(BUILD_NUMBER) + 1)-dev | tee VERSION ;\
|
echo $(MAJOR_MINOR_RELEASE)-$(shell expr $(BUILD_NUMBER) + 1)-dev | tee VERSION ;\
|
||||||
echo $(HASH) > HASH ;\
|
echo $(HASH) > HASH ;\
|
||||||
if ! /bin/bash $(MOD_SCRIPT_DIR)/list-cvs-files.sh | grep -q '^HASH$$'; then \
|
if ! /bin/bash $(MOD_SCRIPT_DIR)/list-vcs-files.sh | grep -q '^HASH$$'; then \
|
||||||
$(SCM_ADD) HASH ;\
|
$(SCM_ADD) HASH ;\
|
||||||
fi ;\
|
fi ;\
|
||||||
$(SCM_COMMIT) -m "$(MAJOR_MINOR_RELEASE)-$(shell expr $(BUILD_NUMBER) + 1)-dev" HASH VERSION
|
$(SCM_COMMIT) -m "$(MAJOR_MINOR_RELEASE)-$(shell expr $(BUILD_NUMBER) + 1)-dev" HASH VERSION
|
||||||
|
|
|
||||||
|
|
@ -406,7 +406,7 @@ $(INSTALLED_PROFILE_PATH_SCRIPT): $(TOPDIR)/profiledir.done
|
||||||
$(INSTALL) -p -o $(PROFILEOWNER) -g $(PROFILEGROUP) -m $(PROFILEMODE) path_script.sh $@
|
$(INSTALL) -p -o $(PROFILEOWNER) -g $(PROFILEGROUP) -m $(PROFILEMODE) path_script.sh $@
|
||||||
|
|
||||||
find:
|
find:
|
||||||
@bash $(MOD_SCRIPT_DIR)/list-cvs-files.sh
|
@bash $(MOD_SCRIPT_DIR)/list-vcs-files.sh
|
||||||
|
|
||||||
collect:
|
collect:
|
||||||
bash $(MOD_SCRIPT_DIR)/collect-installed-pkg-changes.sh -t $(TOPDIR)
|
bash $(MOD_SCRIPT_DIR)/collect-installed-pkg-changes.sh -t $(TOPDIR)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ SUBDIRS ?= $(wildcard inst/pre make scripts contrib src libsrc \
|
||||||
images htdocs tmpl doc test inst/post)
|
images htdocs tmpl doc test inst/post)
|
||||||
PROJECT_DESCR = $(TOPDIR)/make/project.conf
|
PROJECT_DESCR = $(TOPDIR)/make/project.conf
|
||||||
GIT_DESCR = $(TOPDIR)/.git/description
|
GIT_DESCR = $(TOPDIR)/.git/description
|
||||||
LIST_VCS_FILES = /bin/bash $(MOD_SCRIPT_DIR)/list-cvs-files.sh
|
LIST_VCS_FILES = /bin/bash $(MOD_SCRIPT_DIR)/list-vcs-files.sh
|
||||||
|
|
||||||
OPT_JANWARE_PROJECT ?= -j
|
OPT_JANWARE_PROJECT ?= -j
|
||||||
|
|
||||||
|
|
|
||||||
97
scripts/list-vcs-files.sh
Normal file
97
scripts/list-vcs-files.sh
Normal file
|
|
@ -0,0 +1,97 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
export LANG=POSIX
|
||||||
|
|
||||||
|
filter_deleted()
|
||||||
|
{
|
||||||
|
local rc_file="$1"
|
||||||
|
shift
|
||||||
|
local cand
|
||||||
|
for cand in "$@"; do
|
||||||
|
grep -q "^R ./$cand/" $rc_file && continue
|
||||||
|
echo $cand
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
output()
|
||||||
|
{
|
||||||
|
if [ "$zero_terminate" = 1 ]; then
|
||||||
|
echo -en "$*\x00"
|
||||||
|
else
|
||||||
|
echo "$*"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
list_dirents_cvs()
|
||||||
|
{
|
||||||
|
local dirs=`sed '/^D\// !d; s%^D/%%; s%/.*%%' $1/CVS/Entries`
|
||||||
|
dirs="`filter_deleted $1/CVS/Entries $dirs`"
|
||||||
|
local cands
|
||||||
|
if [ -f $1/CVS/Entries.Log ]; then
|
||||||
|
cands="`sed '/^A D\// !d; s%^A D/%%; s%/.*%%' $1/CVS/Entries.Log`"
|
||||||
|
dirs="$dirs `filter_deleted $1/CVS/Entries.Log $cands`"
|
||||||
|
fi
|
||||||
|
local files=`sed '/^\// !d; s%/%%; s%/.*%%; s%^%%' $1/CVS/Entries`
|
||||||
|
files="`filter_deleted $1/CVS/Entries $files`"
|
||||||
|
local d f
|
||||||
|
for f in $files; do
|
||||||
|
output "$1/$f"
|
||||||
|
done
|
||||||
|
for d in $dirs; do
|
||||||
|
[ "$opt_only_regular_files" = 1 ] || output $1/$d
|
||||||
|
list_dirents_cvs $1/$d
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
list_dirents_git()
|
||||||
|
{
|
||||||
|
local opts="$git_ls_files_opts"
|
||||||
|
[ "$opt_no_submodules" = 1 ] || opts="$opts --recurse-submodules"
|
||||||
|
git ls-files $opts $1
|
||||||
|
}
|
||||||
|
|
||||||
|
list_dirents()
|
||||||
|
{
|
||||||
|
if [ -d $1/CVS ]; then
|
||||||
|
list_dirents_cvs $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
git status >/dev/null 2>&1 || {
|
||||||
|
echo "failed to list versioned files in $1: no VCS" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
list_dirents_git $1
|
||||||
|
}
|
||||||
|
|
||||||
|
set -- `getopt fnzt "$@"`
|
||||||
|
|
||||||
|
while [ "$1" != -- ]; do
|
||||||
|
case $1 in
|
||||||
|
-f)
|
||||||
|
opt_only_regular_files=1
|
||||||
|
;;
|
||||||
|
-n)
|
||||||
|
opt_no_submodules=1
|
||||||
|
;;
|
||||||
|
-z)
|
||||||
|
zero_terminate=1
|
||||||
|
git_ls_files_opts="$git_ls_files_opts -z"
|
||||||
|
opt_sort="$opt_sort -z"
|
||||||
|
;;
|
||||||
|
-t)
|
||||||
|
text_files=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
shift
|
||||||
|
|
||||||
|
proj_dir="$1"
|
||||||
|
[ "$proj_dir" ] && cd $proj_dir
|
||||||
|
|
||||||
|
if [ "$text_files" ]; then
|
||||||
|
list_dirents . | sort $opt_sort | xargs file -N | grep ":.*text" | cut -d: -f1
|
||||||
|
else
|
||||||
|
list_dirents . | sort $opt_sort
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
@ -90,7 +90,7 @@ scm_files()
|
||||||
{
|
{
|
||||||
(
|
(
|
||||||
cd $TOPDIR
|
cd $TOPDIR
|
||||||
/bin/bash $MOD_SCRIPT_DIR/list-cvs-files.sh -f $@
|
/bin/bash $MOD_SCRIPT_DIR/list-vcs-files.sh -f $@
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue