From 8acc8217fe7e52619393eaccbf9128521f2e3252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?coadde=20=5BM=C3=A1rcio=20Alexandre=20Silva=20Delgado=5D?= Date: Tue, 25 Aug 2015 23:17:23 -0300 Subject: rebuild createrepos and fix some variables --- config | 2 ++ config_abslibre_gnu+hurd | 6 +++--- config_abslibre_gnu+linux | 6 +++--- config_abslibre_gnu+linux_arm | 6 +++--- config_gnu+hurd | 6 +++--- config_gnu+linux | 6 +++--- create-repo | 3 +++ createrepos | 34 +++++++++++++++++++++++++++++++--- 8 files changed, 51 insertions(+), 18 deletions(-) diff --git a/config b/config index 2c507cf..c1b9ffa 100644 --- a/config +++ b/config @@ -12,6 +12,8 @@ SRC_POOL_DIR='sources' SRV_DIR='/srv' TMP_DIR='/tmp' +PKG_POOL_DIR='pools' +SRC_POOL_DIR='sources' GIT_BASE="${SRV_DIR}/git" SYNC_ARGS='-mrtv --no-motd --delete-after --no-p --no-o --no-g --quiet' diff --git a/config_abslibre_gnu+hurd b/config_abslibre_gnu+hurd index cc6bf2a..95ad53d 100644 --- a/config_abslibre_gnu+hurd +++ b/config_abslibre_gnu+hurd @@ -32,15 +32,15 @@ COMMUNITY_REPOS=('pcr' 'pcr-testing' 'pur' '~aurelien' '~brendan' '~coadde' '~dr PATFORM_REPOS=() # Remote Repositories -PKG_ANY_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${LIBRE_MAIN_REPOS[@]}" "${MAIN_REPOS[@]}" "${COMMUNITY_REPOS[@]}") +PKG_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${LIBRE_MAIN_REPOS[@]}" "${MAIN_REPOS[@]}" "${COMMUNITY_REPOS[@]}") PKG_MULTILIB_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${LIBRE_MAIN_REPOS[@]}" "${MAIN_REPOS[@]}" "${LIBRE_MULTILIB_REPOS[@]}" "${MULTILIB_REPOS[@]}" "${COMMUNITY_REPOS[@]}") # Directories where packages are shared between repos # *relative to REPO_DIR* -PKG_POOL="abslibre_${PLATFORM}" +PKG_POOL="${PKG_POOL_DIR}/abslibre_${PLATFORM}" # Directories where sources are stored -SRC_POOL="abslibre_${PLATFORM}" +SRC_POOL="${SRC_POOL_DIR}/abslibre_${PLATFORM}" # Build System and Repository scripts BS_MAIN_NAME="abslibre_${PLATFORM}" diff --git a/config_abslibre_gnu+linux b/config_abslibre_gnu+linux index fd02d0c..990fbee 100644 --- a/config_abslibre_gnu+linux +++ b/config_abslibre_gnu+linux @@ -32,15 +32,15 @@ COMMUNITY_REPOS=('pcr' 'pcr-testing' 'pur' '~aurelien' '~brendan' '~coadde' '~dr PATFORM_REPOS=('nonsystemd' 'nonsystemd-testing') # Remote Repositories -PKG_ANY_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${LIBRE_MAIN_REPOS[@]}" "${MAIN_REPOS[@]}" "${COMMUNITY_REPOS[@]}") +PKG_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${LIBRE_MAIN_REPOS[@]}" "${MAIN_REPOS[@]}" "${COMMUNITY_REPOS[@]}") PKG_MULTILIB_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${LIBRE_MAIN_REPOS[@]}" "${MAIN_REPOS[@]}" "${LIBRE_MULTILIB_REPOS[@]}" "${MULTILIB_REPOS[@]}" "${COMMUNITY_REPOS[@]}") # Directories where packages are shared between repos # *relative to REPO_DIR* -PKG_POOL="abslibre_${PLATFORM}" +PKG_POOL="${PKG_POOL_DIR}/abslibre_${PLATFORM}" # Directories where sources are stored -SRC_POOL="abslibre_${PLATFORM}" +SRC_POOL="${SRC_POOL_DIR}/abslibre_${PLATFORM}" # Build System and Repository scripts BS_MAIN_NAME="abslibre_${PLATFORM}" diff --git a/config_abslibre_gnu+linux_arm b/config_abslibre_gnu+linux_arm index 6cd1eb9..cdd6fb1 100644 --- a/config_abslibre_gnu+linux_arm +++ b/config_abslibre_gnu+linux_arm @@ -32,15 +32,15 @@ COMMUNITY_REPOS=('pcr' 'pcr-testing' 'pur' '~aurelien' '~brendan' '~coadde' '~dr PATFORM_REPOS=('nonsystemd' 'nonsystemd-testing') # Remote Repositories -PKG_ANY_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${LIBRE_MAIN_REPOS[@]}" "${MAIN_REPOS[@]}" "${COMMUNITY_REPOS[@]}") +PKG_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${LIBRE_MAIN_REPOS[@]}" "${MAIN_REPOS[@]}" "${COMMUNITY_REPOS[@]}") PKG_MULTILIB_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${LIBRE_MAIN_REPOS[@]}" "${MAIN_REPOS[@]}" "${LIBRE_MULTILIB_REPOS[@]}" "${MULTILIB_REPOS[@]}" "${COMMUNITY_REPOS[@]}") # Directories where packages are shared between repos # *relative to REPO_DIR* -PKG_POOL="abslibre_${PLATFORM}_arm" +PKG_POOL="${PKG_POOL_DIR}/abslibre_${PLATFORM}_arm" # Directories where sources are stored -SRC_POOL="abslibre_${PLATFORM}_arm" +SRC_POOL="${SRC_POOL_DIR}/abslibre_${PLATFORM}_arm" # Build System and Repository scripts BS_MAIN_NAME="abslibre_${PLATFORM}_arm" diff --git a/config_gnu+hurd b/config_gnu+hurd index ad49297..a8c39f1 100644 --- a/config_gnu+hurd +++ b/config_gnu+hurd @@ -28,15 +28,15 @@ COMMUNITY_REPOS=('pcr' 'pcr-testing' 'pur' '~aurelien' '~brendan' '~coadde' '~dr PATFORM_REPOS=() # Remote Repositories -PKG_ANY_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${MAIN_REPOS[@]}" "${COMMUNITY_REPOS[@]}") +PKG_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${MAIN_REPOS[@]}" "${COMMUNITY_REPOS[@]}") PKG_MULTILIB_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${MAIN_REPOS[@]}" "${MULTILIB_REPOS[@]}" "${COMMUNITY_REPOS[@]}") # Directories where packages are shared between repos # *relative to REPO_DIR* -PKG_POOL="${PLATFORM}" +PKG_POOL="${PKG_POOL_DIR}/${PLATFORM}" # Directories where sources are stored -SRC_POOL="${PLATFORM}" +SRC_POOL="${SRC_POOL_DIR}/${PLATFORM}" # Build System and Repository scripts BS_MAIN_NAME="pbs_${PLATFORM}" diff --git a/config_gnu+linux b/config_gnu+linux index 1507a48..84ff3ba 100644 --- a/config_gnu+linux +++ b/config_gnu+linux @@ -28,15 +28,15 @@ COMMUNITY_REPOS=('pcr' 'pcr-testing' 'pur' '~aurelien' '~brendan' '~coadde' '~dr PATFORM_REPOS=() # Remote Repositories -PKG_ANY_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${MAIN_REPOS[@]}" "${COMMUNITY_REPOS[@]}") +PKG_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${MAIN_REPOS[@]}" "${COMMUNITY_REPOS[@]}") PKG_MULTILIB_REPOS=("${EXTRA_REPOS[@]}" "${PATFORM_REPOS[@]}" "${MAIN_REPOS[@]}" "${MULTILIB_REPOS[@]}" "${COMMUNITY_REPOS[@]}") # Directories where packages are shared between repos # *relative to REPO_DIR* -PKG_POOL="${PLATFORM}" +PKG_POOL="${PKG_POOL_DIR}/${PLATFORM}" # Directories where sources are stored -SRC_POOL="${PLATFORM}" +SRC_POOL="${SRC_POOL_DIR}/${PLATFORM}" # Build System and Repository scripts BS_MAIN_NAME="pbs_${PLATFORM}" diff --git a/create-repo b/create-repo index 0c0f2f9..1686894 100755 --- a/create-repo +++ b/create-repo @@ -56,3 +56,6 @@ for 'platform' in "${PLATFORMS[@]}"; do ;; esac done + +# if [ -n "${MULTILIB_ARCHES}" ]; then +# fi diff --git a/createrepos b/createrepos index bee86d2..4416196 100755 --- a/createrepos +++ b/createrepos @@ -1,8 +1,36 @@ #!/bin/bash # Creates the repo structure defined in config -source "$(dirname "$(readlink -e "$0")")/config" +source "$(dirname "$(readlink -e "$0")")/config_platforms" +source "$(dirname "$(readlink -e "$0")")/db-functions" -mkdir -p -- "${REPO_DIR}"/{"${PKGPOOL}","${SRCPOOL}"} "${CLEANUP_DESTDIR}" "${SOURCE_CLEANUP_DESTDIR}" "${STAGING}" +createrepos-usage() { + msg "Usage: %s [platform1 platform2 ... platformX]" "${0##*/}" + exit 1 +} -"$(dirname "$(readlink -e "$0")")/create-repo" "${PKGREPOS[@]}" +for 'platform' in "${PLATFORMS[@]}"; do + if [ -n $1 ]; then + for '_platform' in "$@"; do + # Rename plataform name ($_platform) to easily script usage + _platform_name="${_platform/\//+}" _platform_name="${_platform_name,,}" + + if [ "${_platform_name}" == "${platform}" ]; then + source "$(dirname "$(readlink -e "$0")")/config_${_platform}" + + mkdir -p -- "${REPO_DIR}"/{"${PKG_POOL}","${SRC_POOL}"} "${CLEANUP_DESTDIR}" "${SOURCE_CLEANUP_DESTDIR}" "${STAGING}" + + "$(dirname "$(readlink -e "$0")")/create-repo" -p "${_platform}" "${PKG_REPOS[@]}" + else + createrepos-usage + fi + done + else + source "$(dirname "$(readlink -e "$0")")/config_${platform}" + + mkdir -p -- "${REPO_DIR}"/{"${PKG_POOL}","${SRC_POOL}"} "${CLEANUP_DESTDIR}" "${SOURCE_CLEANUP_DESTDIR}" "${STAGING}" + + "$(dirname "$(readlink -e "$0")")/create-repo" "${PKG_REPOS[@]}" + ;; + fi +done -- cgit v1.2.3