. ./.jprojects.sh || exit 255
for project in ${LIST}; do
- if [ -f "${project}/dist.sh" ]
+ if [ "${project}" = "jprojects-scripts" ]
+ then
+ echo "$0: Skipping jprojects-scripts ..."
+ continue
+ elif [ -f "${project}/dist.sh" ]
then
echo "$0: Copying dist.sh to '${project}' ..."
cp -v dist.sh "${project}/" || exit 255
if [ ! -d "${project}/docs" -o "$1" = "f" ]
then
echo "$0: GNU-ifying project '${project}' ..."
- cp -rv docs "${project}/" || exit 255
+ mkdir --parent "${project}/docs" || exit 255
+ cp -rpv docs/* "${project}/docs/" || exit 255
cd "${JPROJECTS_HOME}/${project}"
echo "$0: git add ..."
git add docs || exit 255
UNWANTED_NAME="stick"
WANTED_NAME1="upstream"
WANTED_NAME2="daedalus"
+WANTED_NAME3="transport"
GIT_USER="quix0r"
GIT_SERVER="git.mxchange.org"
GIT_BRANCH="master"
GIT_ORIGIN="origin"
-MEDIA_NAME="INTENSO"
-MEDIA_PATH="Java Project"
MEDIA_BASE="/media"
+MEDIA_NAME1="INTENSO"
+MEDIA_NAME2="Transport"
+MEDIA_PATH="Java Project"
for project in ${LIST}; do
GIT_URL1="${GIT_USER}@${GIT_SERVER}:${GIT_PATH}/${project}.git"
GIT_URL2="${GIT_PATH}/${project}.git"
- echo "$0: GIT_URL1='${GIT_URL1}',GIT_URL2='${GIT_URL2}'"
+ GIT_URL3="${MEDIA_BASE}/${USER}/${MEDIA_NAME2}/${MEDIA_PATH}/${project}.git"
+ echo "$0: GIT_URL1='${GIT_URL1}',GIT_URL2='${GIT_URL2}',GIT_URL3='${GIT_URL3}'"
cd "${project}"
REMOTE_PUSH=`git remote -v | grep "push"`
echo "$0: REMOTE='${REMOTE}',REMOTE_PUSH='${REMOTE_PUSH}'"
- MEDIA=`echo "${REMOTE_PUSH}" | grep "${MEDIA_BASE}/"`
- echo "$0: MEDIA='${MEDIA}'"
+ MEDIA1=`echo "${REMOTE_PUSH}" | grep "${MEDIA_BASE}/${USER}/${MEDIA_NAME1}/"`
+ echo "$0: MEDIA1='${MEDIA1}'"
- if [ -n "${MEDIA}" ]
+ if [ -n "${MEDIA1}" ]
then
- echo "$0: Found ${MEDIA_BASE}/ remote for '${project}'."
+ echo "$0: Found '${MEDIA_BASE}/${USER}/${MEDIA_NAME1}' remote for '${project}'."
if [ "${REMOTE}" = "${GIT_ORIGIN}" ]
then
echo "$0: Project '${project}' has already fixed '${GIT_ORIGIN}'."
fi
echo "$0: Adding '${GIT_ORIGIN}' to '${project}' ..."
- git remote add "${GIT_ORIGIN}" "${MEDIA_BASE}/${USER}/${MEDIA_NAME}/${MEDIA_PATH}/${project}.git" --track "${GIT_BRANCH}" || exit 255
+ git remote add "${GIT_ORIGIN}" "${MEDIA_BASE}/${USER}/${MEDIA_NAME1}/${MEDIA_PATH}/${project}.git" --track "${GIT_BRANCH}" || exit 255
else
echo "$0: Unknown remote '${REMOTE_PUSH}' found. Exiting ..."
exit 1
if [ -n "${UNWANTED_REMOTE}" ]
then
- echo "$0: Found remote '${UNWANTED_NAME1}' in '${project}'. Renaming '${GIT_ORIGIN}'->'${WANTED_NAME1}' and '${UNWANTED_NAME1}'->'${GIT_ORIGIN}' ..."
+ echo "$0: Found remote '${UNWANTED_NAME}' in '${project}'. Renaming '${GIT_ORIGIN}'->'${WANTED_NAME1}' and '${UNWANTED_NAME}'->'${GIT_ORIGIN}' ..."
UPSTREAM_REMOTE=`git remote | grep "${WANTED_NAME1}"`
echo "$0: UPSTREAM_REMOTE='${UPSTREAM_REMOTE}'"
if [ -n "${UPSTREAM_REMOTE}" ]
then
- echo "$0: Remotes '${UNWANTED_NAME1}' and '${WANTED_NAME1}' exist! Removing '${WANTED_NAME1}' ..."
+ echo "$0: Remotes '${UNWANTED_NAME}' and '${WANTED_NAME1}' exist! Removing '${WANTED_NAME1}' ..."
git remote rm "${WANTED_NAME1}" || exit 255
fi
git remote rename "${GIT_ORIGIN}" "${WANTED_NAME1}" || exit 255
- git remote rename "${UNWANTED_NAME1}" "${GIT_ORIGIN}" || exit 255
+ git remote rename "${UNWANTED_NAME}" "${GIT_ORIGIN}" || exit 255
else
- echo "$0: No unwanted '${UNWANTED_NAME1}' remote in '${project}' ..."
+ echo "$0: No unwanted '${UNWANTED_NAME}' remote in '${project}' ..."
UPSTREAM_REMOTE1=`git remote | grep "${WANTED_NAME1}"`
UPSTREAM_REMOTE2=`git remote | grep "${WANTED_NAME2}"`
- echo "$0: UPSTREAM_REMOTE1='${UPSTREAM_REMOTE1}',UPSTREAM_REMOTE2='${UPSTREAM_REMOTE2}'"
+ UPSTREAM_REMOTE3=`git remote | grep "${WANTED_NAME3}"`
+ echo "$0: UPSTREAM_REMOTE1='${UPSTREAM_REMOTE1}',UPSTREAM_REMOTE2='${UPSTREAM_REMOTE2}',UPSTREAM_REMOTE3='${UPSTREAM_REMOTE3}'"
if [ -n "${UPSTREAM_REMOTE1}" ]
then
if [ -n "${UPSTREAM_REMOTE2}" ]
then
echo "$0: Remote '${WANTED_NAME2}' found in '${project}'."
+ elif [ ! -d "${GIT_URL2}" ]
+ then
+ echo "$0: Remote '${WANTED_NAME2}' cannot be created, path '${GIT_URL2}' missing."
+ exit 1
else
echo "$0: No wanted '${WANTED_NAME2}' in '${project}'. Adding ..."
git remote add "${WANTED_NAME2}" "${GIT_URL2}" --track "${GIT_BRANCH}" || exit 255
fi
+
+ if [ -n "${UPSTREAM_REMOTE3}" ]
+ then
+ echo "$0: Remote '${WANTED_NAME3}' found in '${project}'."
+ elif [ ! -d "${GIT_URL3}" ]
+ then
+ echo "$0: Remote '${WANTED_NAME3}' cannot be created, path '${GIT_URL3}' missing."
+ exit 1
+ else
+ echo "$0: No wanted '${WANTED_NAME3}' in '${project}'. Adding ..."
+ git remote add "${WANTED_NAME3}" "${GIT_URL3}" --track "${GIT_BRANCH}" || exit 255
+ fi
fi
cd -