Less indentation makes for easier to read code

This commit is contained in:
Jason A. Donenfeld 2015-08-25 15:57:56 +02:00
parent 8d7caaa54c
commit ebc4530633
5 changed files with 40 additions and 40 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash
[[ ${repository_name} == "gentoo" ]] || exit 0
source /lib/gentoo/functions.sh
repository_name="${1}"
@ -8,12 +10,10 @@ repository_path="${3}"
# Number of jobs for egencache, default is number or processors.
parallel_jobs="$(nproc)"
if [[ ${repository_name} == "gentoo" ]]; then
ebegin "Fetching pre-generated metadata cache for ${repository_name}"
rsync -aq rsync://rsync.gentoo.org/gentoo-portage/metadata/md5-cache/ "${repository_path}"/metadata/md5-cache/
eend $?
ebegin "Fetching pre-generated metadata cache for ${repository_name}"
rsync -aq rsync://rsync.gentoo.org/gentoo-portage/metadata/md5-cache/ "${repository_path}"/metadata/md5-cache/
eend $?
ebegin "Updating metadata cache for ${repository_name}"
egencache --jobs="${parallel_jobs}" --repo="${repository_name}" --update --update-use-local-desc
eend $?
fi
ebegin "Updating metadata cache for ${repository_name}"
egencache --jobs="${parallel_jobs}" --repo="${repository_name}" --update --update-use-local-desc
eend $?

View File

@ -1,17 +1,17 @@
#!/bin/bash
[[ ${repository_name} == "gentoo" ]] || exit 0
source /lib/gentoo/functions.sh
repository_name="${1}"
repository_path="${3}"
if [[ ${repository_name} == "gentoo" ]]; then
DTDDIR="${repository_path}"/metadata/dtd
ebegin "Updating DTDs"
if [[ -e ${DTDDIR} ]]; then
git -C "${DTDDIR}" pull -q --ff
else
git clone -q https://anongit.gentoo.org/git/data/dtd.git "${DTDDIR}"
fi
eend "$?"
DTDDIR="${repository_path}"/metadata/dtd
ebegin "Updating DTDs"
if [[ -e ${DTDDIR} ]]; then
git -C "${DTDDIR}" pull -q --ff
else
git clone -q https://anongit.gentoo.org/git/data/dtd.git "${DTDDIR}"
fi
eend "$?"

View File

@ -1,17 +1,17 @@
#!/bin/bash
[[ ${repository_name} == "gentoo" ]] || exit 0
source /lib/gentoo/functions.sh
repository_name="${1}"
repository_path="${3}"
if [[ ${repository_name} == "gentoo" ]]; then
GLSADIR="${repository_path}"/metadata/glsa
ebegin "Updating GLSAs"
if [[ -e ${GLSADIR} ]]; then
git -C "${GLSADIR}" pull -q --ff
else
git clone -q https://anongit.gentoo.org/git/data/glsa.git "${GLSADIR}"
fi
eend "$?"
GLSADIR="${repository_path}"/metadata/glsa
ebegin "Updating GLSAs"
if [[ -e ${GLSADIR} ]]; then
git -C "${GLSADIR}" pull -q --ff
else
git clone -q https://anongit.gentoo.org/git/data/glsa.git "${GLSADIR}"
fi
eend "$?"

View File

@ -1,12 +1,12 @@
#!/bin/bash
[[ ${repository_name} == "gentoo" ]] || exit 0
source /lib/gentoo/functions.sh
repository_name="${1}"
repository_path="${3}"
if [[ ${repository_name} == "gentoo" ]]; then
ebegin "Updating herds.xml"
wget -q -O "${repository_path}"/metadata/herds.xml https://api.gentoo.org/packages/herds.xml
eend $?
fi
ebegin "Updating herds.xml"
wget -q -O "${repository_path}"/metadata/herds.xml https://api.gentoo.org/packages/herds.xml
eend $?

View File

@ -1,17 +1,17 @@
#!/bin/bash
[[ ${repository_name} == "gentoo" ]] || exit 0
source /lib/gentoo/functions.sh
repository_name="${1}"
repository_path="${3}"
if [[ ${repository_name} == "gentoo" ]]; then
NEWSDIR="${repository_path}"/metadata/news
ebegin "Updating news items"
if [[ -e ${NEWSDIR} ]]; then
git -C "${NEWSDIR}" pull -q --ff
else
git clone -q https://anongit.gentoo.org/git/data/gentoo-news.git "${NEWSDIR}"
fi
eend $? "Try to remove ${NEWSDIR}"
NEWSDIR="${repository_path}"/metadata/news
ebegin "Updating news items"
if [[ -e ${NEWSDIR} ]]; then
git -C "${NEWSDIR}" pull -q --ff
else
git clone -q https://anongit.gentoo.org/git/data/gentoo-news.git "${NEWSDIR}"
fi
eend $? "Try to remove ${NEWSDIR}"