From ebc4530633d7ac06a143c6a5d9b9206a40f8fd09 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 25 Aug 2015 15:57:56 +0200 Subject: [PATCH] Less indentation makes for easier to read code --- etc/portage/repo.postsync.d/sync_gentoo_cache | 16 ++++++++-------- etc/portage/repo.postsync.d/sync_gentoo_dtd | 18 +++++++++--------- etc/portage/repo.postsync.d/sync_gentoo_glsa | 18 +++++++++--------- .../repo.postsync.d/sync_gentoo_herds_xml | 10 +++++----- etc/portage/repo.postsync.d/sync_gentoo_news | 18 +++++++++--------- 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/etc/portage/repo.postsync.d/sync_gentoo_cache b/etc/portage/repo.postsync.d/sync_gentoo_cache index 0ed85fd..f7b1fe6 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_cache +++ b/etc/portage/repo.postsync.d/sync_gentoo_cache @@ -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 $? diff --git a/etc/portage/repo.postsync.d/sync_gentoo_dtd b/etc/portage/repo.postsync.d/sync_gentoo_dtd index 6ac643b..d523356 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_dtd +++ b/etc/portage/repo.postsync.d/sync_gentoo_dtd @@ -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 "$?" diff --git a/etc/portage/repo.postsync.d/sync_gentoo_glsa b/etc/portage/repo.postsync.d/sync_gentoo_glsa index b17cc94..6ce3e11 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_glsa +++ b/etc/portage/repo.postsync.d/sync_gentoo_glsa @@ -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 "$?" diff --git a/etc/portage/repo.postsync.d/sync_gentoo_herds_xml b/etc/portage/repo.postsync.d/sync_gentoo_herds_xml index 734070b..2075c35 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_herds_xml +++ b/etc/portage/repo.postsync.d/sync_gentoo_herds_xml @@ -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 $? diff --git a/etc/portage/repo.postsync.d/sync_gentoo_news b/etc/portage/repo.postsync.d/sync_gentoo_news index d361df5..78f9c41 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_news +++ b/etc/portage/repo.postsync.d/sync_gentoo_news @@ -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}"