From 11db46275d14c9a9c2e59019fed3de4b8803f9f4 Mon Sep 17 00:00:00 2001 From: Parabola Date: Fri, 18 Feb 2011 15:42:59 -0800 Subject: Parabola specific changes --- db-update | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 5bdce5e..4740809 100755 --- a/db-update +++ b/db-update @@ -35,12 +35,9 @@ for repo in ${repos[@]}; do if ! check_pkgfile "${pkg}"; then die "Package ${repo}/$(basename ${pkg}) is not consistent with its meta data" fi - if ! check_pkgsvn "${pkg}" "${repo}"; then - die "Package ${repo}/$(basename ${pkg}) is not consistent with svn repository" - fi - if ! check_pkgrepos "${pkg}"; then - die "Package ${repo}/$(basename ${pkg}) already exists in another repository" - fi + #if ! check_pkgrepos "${pkg}"; then + # die "Package ${repo}/$(basename ${pkg}) already exists in another repository" + #fi done if ! check_splitpkgs ${repo} ${pkgs[@]}; then die "Missing split packages for ${repo}" -- cgit v1.2.3-2-g168b From bba8c33a039ec4d1e1d13f88304ba0aeb754b03e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Fri, 22 Apr 2011 00:30:43 -0700 Subject: Midnight fix --- db-update | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 6bd0209..7604547 100755 --- a/db-update +++ b/db-update @@ -39,9 +39,10 @@ for repo in ${repos[@]}; do # die "Package ${repo}/$(basename ${pkg}) already exists in another repository" #fi done - if ! check_splitpkgs ${repo} ${pkgs[@]}; then - die "Missing split packages for ${repo}" - fi + # This is fucking obnoxious +# if ! check_splitpkgs ${repo} ${pkgs[@]}; then +# die "Missing split packages for ${repo}" +# fi else die "Could not read ${STAGING}" fi -- cgit v1.2.3-2-g168b From 74093d95cba935badaf7572e1dcd38ffd76bdc53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Sun, 8 May 2011 18:45:02 -0500 Subject: * Remove non free packages on db-update --- db-update | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index 7604547..6c220d9 100755 --- a/db-update +++ b/db-update @@ -69,7 +69,7 @@ for repo in ${repos[@]}; do if [ -f "$FTP_BASE/${PKGPOOL}/${pkgfile}.sig" ]; then ln -s "../../../${PKGPOOL}/${pkgfile}.sig" "$FTP_BASE/$repo/os/${pkgarch}" fi - add_pkgs[${#add_pkgs[*]}]=${pkgfile} + add_pkgs[${#add_pkgs[*]}]=${pkgfile} done if [ ${#add_pkgs[@]} -ge 1 ]; then arch_repo_add "${repo}" "${pkgarch}" ${add_pkgs[@]} @@ -77,6 +77,21 @@ for repo in ${repos[@]}; do done done +# Repo check nonfree +nonfree=($(cut -d: -f1 ${BLACKLIST_FILE})) +for repo in ${ARCHREPOS[@]}; do + for pkgarch in ${ARCHARCHES[@]}; do + cleanpkgs=() + dbpkgs=($(bsdtar -xOf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" | awk '/^%NAME%/{getline;print}' | sort )) + for pkgname in ${dbpkgs[@]}; do + if in_array ${pkgname} ${nonfree[@]}; then + cleanpkgs[${#cleanpkgs[*]}]=${pkgname} + fi + done + arch_repo_remove "${repo}" "${pkgarch}" ${cleanpkgs[@]} + done +done + for repo in ${repos[@]}; do for pkgarch in ${ARCHES[@]}; do repo_unlock ${repo} ${pkgarch} -- cgit v1.2.3-2-g168b From 3e7ae87a5a2ac70811a016d684a8a24ae18f49f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Sun, 8 May 2011 19:04:39 -0700 Subject: * Unique pkgname list for nonfree and dbpkgs --- db-update | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 6c220d9..f077aff 100755 --- a/db-update +++ b/db-update @@ -78,17 +78,24 @@ for repo in ${repos[@]}; do done # Repo check nonfree -nonfree=($(cut -d: -f1 ${BLACKLIST_FILE})) +nonfree=($(cut -d: -f1 ${BLACKLIST_FILE} | sort -u)) for repo in ${ARCHREPOS[@]}; do - for pkgarch in ${ARCHARCHES[@]}; do + for pkgarch in ${ARCHES[@]}; do + if [ ! -f "${FTP_BASE}/${repo}/os/${pkgarch}/${repo}${DBEXT}" ]; then + continue + fi + unset dbpkgs + unset cleanpkgs cleanpkgs=() - dbpkgs=($(bsdtar -xOf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" | awk '/^%NAME%/{getline;print}' | sort )) + dbpkgs=($(bsdtar -xOf "${FTP_BASE}/${repo}/os/${pkgarch}/${repo}${DBEXT}" | awk '/^%NAME%/{getline;print}' | sort -u )) for pkgname in ${dbpkgs[@]}; do if in_array ${pkgname} ${nonfree[@]}; then cleanpkgs[${#cleanpkgs[*]}]=${pkgname} fi done - arch_repo_remove "${repo}" "${pkgarch}" ${cleanpkgs[@]} + if [ ${#cleanpkgs[@]} -ge 1 ]; then + arch_repo_remove "${repo}" "${pkgarch}" ${cleanpkgs[@]} + fi done done @@ -97,3 +104,5 @@ for repo in ${repos[@]}; do repo_unlock ${repo} ${pkgarch} done done + + -- cgit v1.2.3-2-g168b From e6e9e1a468c15a6ca609d8c6072a7b8c16fb3833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Sun, 15 May 2011 22:01:02 -0500 Subject: db-update msg when cleaning nonfree --- db-update | 2 ++ 1 file changed, 2 insertions(+) (limited to 'db-update') diff --git a/db-update b/db-update index f077aff..1606f1d 100755 --- a/db-update +++ b/db-update @@ -78,9 +78,11 @@ for repo in ${repos[@]}; do done # Repo check nonfree +msg "Check nonfree in repo:" nonfree=($(cut -d: -f1 ${BLACKLIST_FILE} | sort -u)) for repo in ${ARCHREPOS[@]}; do for pkgarch in ${ARCHES[@]}; do + msg2 "$repo $pkgarch" if [ ! -f "${FTP_BASE}/${repo}/os/${pkgarch}/${repo}${DBEXT}" ]; then continue fi -- cgit v1.2.3-2-g168b From b88a0166be595545c2b2d68451291f8ba6bb08ab Mon Sep 17 00:00:00 2001 From: Joshua Ismael Haase Hernandez Date: Wed, 18 May 2011 21:21:59 -0500 Subject: * Separated nonfree check from db-update * Added db-check-nonfree to repo-update --- db-update | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 1606f1d..86eaa2e 100755 --- a/db-update +++ b/db-update @@ -77,30 +77,6 @@ for repo in ${repos[@]}; do done done -# Repo check nonfree -msg "Check nonfree in repo:" -nonfree=($(cut -d: -f1 ${BLACKLIST_FILE} | sort -u)) -for repo in ${ARCHREPOS[@]}; do - for pkgarch in ${ARCHES[@]}; do - msg2 "$repo $pkgarch" - if [ ! -f "${FTP_BASE}/${repo}/os/${pkgarch}/${repo}${DBEXT}" ]; then - continue - fi - unset dbpkgs - unset cleanpkgs - cleanpkgs=() - dbpkgs=($(bsdtar -xOf "${FTP_BASE}/${repo}/os/${pkgarch}/${repo}${DBEXT}" | awk '/^%NAME%/{getline;print}' | sort -u )) - for pkgname in ${dbpkgs[@]}; do - if in_array ${pkgname} ${nonfree[@]}; then - cleanpkgs[${#cleanpkgs[*]}]=${pkgname} - fi - done - if [ ${#cleanpkgs[@]} -ge 1 ]; then - arch_repo_remove "${repo}" "${pkgarch}" ${cleanpkgs[@]} - fi - done -done - for repo in ${repos[@]}; do for pkgarch in ${ARCHES[@]}; do repo_unlock ${repo} ${pkgarch} -- cgit v1.2.3-2-g168b From 7592118ed1c8952d05f1239e3b84d85d39ea2982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Tue, 26 Jun 2012 16:06:53 -0300 Subject: Re-enabled check on other repos; skip already released packages --- db-update | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 86eaa2e..1fe5256 100755 --- a/db-update +++ b/db-update @@ -35,9 +35,9 @@ for repo in ${repos[@]}; do if ! check_pkgfile "${pkg}"; then die "Package ${repo}/$(basename ${pkg}) is not consistent with its meta data" fi - #if ! check_pkgrepos "${pkg}"; then - # die "Package ${repo}/$(basename ${pkg}) already exists in another repository" - #fi + if ! check_pkgrepos "${pkg}"; then + die "Package ${repo}/$(basename ${pkg}) already exists in another repository" + fi done # This is fucking obnoxious # if ! check_splitpkgs ${repo} ${pkgs[@]}; then @@ -61,7 +61,7 @@ for repo in ${repos[@]}; do if [ -f "${pkg}" ]; then mv "${pkg}" "$FTP_BASE/${PKGPOOL}" fi - ln -s "../../../${PKGPOOL}/${pkgfile}" "$FTP_BASE/$repo/os/${pkgarch}" + ln -s "../../../${PKGPOOL}/${pkgfile}" "$FTP_BASE/$repo/os/${pkgarch}" 2>/dev/null || { error "Package already in repo, skipping" ; continue } # also move signatures if [ -f "${pkg}.sig" ]; then mv "${pkg}.sig" "$FTP_BASE/${PKGPOOL}" -- cgit v1.2.3-2-g168b From 9a535045c075d90a962d2817651140feaeb59952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Tue, 21 Aug 2012 17:15:33 -0300 Subject: Fix --- db-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index 1fe5256..7a8d6d1 100755 --- a/db-update +++ b/db-update @@ -61,7 +61,7 @@ for repo in ${repos[@]}; do if [ -f "${pkg}" ]; then mv "${pkg}" "$FTP_BASE/${PKGPOOL}" fi - ln -s "../../../${PKGPOOL}/${pkgfile}" "$FTP_BASE/$repo/os/${pkgarch}" 2>/dev/null || { error "Package already in repo, skipping" ; continue } + ln -s "../../../${PKGPOOL}/${pkgfile}" "$FTP_BASE/$repo/os/${pkgarch}" 2>/dev/null || { error "Package already in repo, removing and skipping" ; continue 2; } # also move signatures if [ -f "${pkg}.sig" ]; then mv "${pkg}.sig" "$FTP_BASE/${PKGPOOL}" -- cgit v1.2.3-2-g168b From d5aa8796a3b3e7314ab2ae0ec566e38a8de8bc28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Tue, 21 Aug 2012 17:16:24 -0300 Subject: This is clearly not the way --- db-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index 7a8d6d1..875b87f 100755 --- a/db-update +++ b/db-update @@ -61,7 +61,7 @@ for repo in ${repos[@]}; do if [ -f "${pkg}" ]; then mv "${pkg}" "$FTP_BASE/${PKGPOOL}" fi - ln -s "../../../${PKGPOOL}/${pkgfile}" "$FTP_BASE/$repo/os/${pkgarch}" 2>/dev/null || { error "Package already in repo, removing and skipping" ; continue 2; } + ln -s "../../../${PKGPOOL}/${pkgfile}" "$FTP_BASE/$repo/os/${pkgarch}" # also move signatures if [ -f "${pkg}.sig" ]; then mv "${pkg}.sig" "$FTP_BASE/${PKGPOOL}" -- cgit v1.2.3-2-g168b From 5f5b5b10e700af5d7e6be352cde1e1e3380e1d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= Date: Thu, 13 Sep 2012 11:09:35 +0200 Subject: db-update: Ignore repos in repos. --- db-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index 875b87f..0359697 100755 --- a/db-update +++ b/db-update @@ -9,7 +9,7 @@ if [ $# -ge 1 ]; then fi # Find repos with packages to release -repos=($(find "${STAGING}" -mindepth 1 -type d ! -empty -printf '%f ' 2>/dev/null)) +repos=($(find "${STAGING}" -mindepth 1 -maxdepth 1 -type d ! -empty -printf '%f ' 2>/dev/null)) if [ $? -ge 1 ]; then die "Could not read ${STAGING}" fi -- cgit v1.2.3-2-g168b From f65c477e42f46a3e22b5fbc5da790f9561483770 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 31 Dec 2013 14:50:37 -0500 Subject: clean up --- db-update | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 74d3f45..ca18ca3 100755 --- a/db-update +++ b/db-update @@ -52,10 +52,9 @@ for repo in ${repos[@]}; do die "Package ${repo}/${pkg##*/} already exists in another repository" fi done - # This is fucking obnoxious -# if ! check_splitpkgs ${repo} ${pkgs[@]}; then -# die "Missing split packages for ${repo}" -# fi + if ! check_splitpkgs ${repo} ${pkgs[@]}; then + die "Missing split packages for ${repo}" + fi else die "Could not read ${STAGING}" fi @@ -82,7 +81,7 @@ for repo in ${repos[@]}; do if [ -f "$FTP_BASE/${PKGPOOL}/${pkgfile}.sig" ]; then ln -s "../../../${PKGPOOL}/${pkgfile}.sig" "$FTP_BASE/$repo/os/${pkgarch}" fi - add_pkgs[${#add_pkgs[*]}]=${pkgfile} + add_pkgs[${#add_pkgs[*]}]=${pkgfile} done if [ ${#add_pkgs[@]} -ge 1 ]; then arch_repo_add "${repo}" "${pkgarch}" ${add_pkgs[@]} -- cgit v1.2.3-2-g168b From ba21dd9e342bd640b1bbaa82ebf015932390b18e Mon Sep 17 00:00:00 2001 From: Parabola Date: Sun, 5 Jan 2014 04:21:52 +0000 Subject: db-update: add hook for publishing generated sources --- db-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index 0359697..2fa23af 100755 --- a/db-update +++ b/db-update @@ -83,4 +83,4 @@ for repo in ${repos[@]}; do done done - +cp -rviT "${STAGING}/other/" "${FTP_BASE}/other/" -- cgit v1.2.3-2-g168b From 91f6039acb4ba915a3ca3fc366a7159656ec0dc1 Mon Sep 17 00:00:00 2001 From: Parabola Date: Mon, 6 Jan 2014 04:30:22 +0000 Subject: fix things --- db-update | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 2fa23af..2d4f28a 100755 --- a/db-update +++ b/db-update @@ -9,7 +9,7 @@ if [ $# -ge 1 ]; then fi # Find repos with packages to release -repos=($(find "${STAGING}" -mindepth 1 -maxdepth 1 -type d ! -empty -printf '%f ' 2>/dev/null)) +repos=($(find "${STAGING}" -mindepth 1 -maxdepth 1 -type d ! -empty ! -name other -printf '%f ' 2>/dev/null)) if [ $? -ge 1 ]; then die "Could not read ${STAGING}" fi @@ -39,10 +39,10 @@ for repo in ${repos[@]}; do die "Package ${repo}/$(basename ${pkg}) already exists in another repository" fi done - # This is fucking obnoxious -# if ! check_splitpkgs ${repo} ${pkgs[@]}; then -# die "Missing split packages for ${repo}" -# fi + # This is fucking obnoxious + #if ! check_splitpkgs ${repo} ${pkgs[@]}; then + # die "Missing split packages for ${repo}" + #fi else die "Could not read ${STAGING}" fi @@ -83,4 +83,13 @@ for repo in ${repos[@]}; do done done -cp -rviT "${STAGING}/other/" "${FTP_BASE}/other/" +cd "${STAGING}" +while read -r file; do + pub="${FTP_BASE}/${file}" + if [[ -f $pub ]]; then + warning "file already exists: %s" "${file}" + else + mkdir -p -- "${pub%/*}" + mv -vn "$file" "$pub" + fi +done < <(find other -type f) -- cgit v1.2.3-2-g168b From 6682aefeafb8d30899e464122864f56318ad7640 Mon Sep 17 00:00:00 2001 From: Parabola Date: Wed, 8 Jan 2014 05:20:12 +0000 Subject: Don't error about permissions on empty staging repos (feature #460) --- db-update | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 2d4f28a..b9b8015 100755 --- a/db-update +++ b/db-update @@ -23,11 +23,11 @@ done # check if packages are valid for repo in ${repos[@]}; do - if ! check_repo_permission "${repo}"; then - die "You don't have permission to update packages in ${repo}" - fi pkgs=($(getpkgfiles "${STAGING}/${repo}/"*${PKGEXT})) if [ $? -eq 0 ]; then + if [ ${#pkgs[@]} -gt 0 ] && ! check_repo_permission "${repo}"; then + die "You don't have permission to update packages in ${repo}" + fi for pkg in ${pkgs[@]}; do if [ -h "${pkg}" ]; then die "Package ${repo}/$(basename ${pkg}) is a symbolic link" @@ -92,4 +92,4 @@ while read -r file; do mkdir -p -- "${pub%/*}" mv -vn "$file" "$pub" fi -done < <(find other -type f) +done < <(find other sources -type f) -- cgit v1.2.3-2-g168b From 725ab5d12375dd593c375b1a494021bb96135d4f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 8 Jan 2014 00:30:36 -0500 Subject: db-update: remove 'other' from repo blacklist now that issue #460 is added --- db-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index b9b8015..1fddb8a 100755 --- a/db-update +++ b/db-update @@ -9,7 +9,7 @@ if [ $# -ge 1 ]; then fi # Find repos with packages to release -repos=($(find "${STAGING}" -mindepth 1 -maxdepth 1 -type d ! -empty ! -name other -printf '%f ' 2>/dev/null)) +repos=($(find "${STAGING}" -mindepth 1 -maxdepth 1 -type d ! -empty -printf '%f ' 2>/dev/null)) if [ $? -ge 1 ]; then die "Could not read ${STAGING}" fi -- cgit v1.2.3-2-g168b From 39fbf0d8d3cdc666912c597d41d5b6a70fc0c725 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 8 Jan 2014 20:53:38 -0500 Subject: Fix some array quoting. --- db-update | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 8cf61fc..c4bd33b 100755 --- a/db-update +++ b/db-update @@ -16,26 +16,26 @@ fi repos=() for staging_repo in ${staging_repos[@]##*/}; do - if in_array ${staging_repo} ${PKGREPOS[@]}; then - repos+=(${staging_repo}) + if in_array "${staging_repo}" "${PKGREPOS[@]}"; then + repos+=("${staging_repo}") fi done # TODO: this might lock too much (architectures) -for repo in ${repos[@]}; do - for pkgarch in ${ARCHES[@]}; do +for repo in "${repos[@]}"; do + for pkgarch in "${ARCHES[@]}"; do repo_lock ${repo} ${pkgarch} || exit 1 done done # check if packages are valid -for repo in ${repos[@]}; do +for repo in "${repos[@]}"; do pkgs=($(getpkgfiles "${STAGING}/${repo}/"*${PKGEXT})) if [ $? -eq 0 ]; then if [ ${#pkgs[@]} -gt 0 ] && ! check_repo_permission "${repo}"; then die "You don't have permission to update packages in ${repo}" fi - for pkg in ${pkgs[@]}; do + for pkg in "${pkgs[@]}"; do if [ -h "${pkg}" ]; then die "Package ${repo}/${pkg##*/} is a symbolic link" fi @@ -60,13 +60,13 @@ for repo in ${repos[@]}; do fi done -for repo in ${repos[@]}; do +for repo in "${repos[@]}"; do msg "Updating [${repo}]..." any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null)) - for pkgarch in ${ARCHES[@]}; do + for pkgarch in "${ARCHES[@]}"; do add_pkgs=() arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-${pkgarch}${PKGEXT} 2>/dev/null)) - for pkg in ${arch_pkgs[@]} ${any_pkgs[@]}; do + for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do pkgfile="${pkg##*/}" msg2 "${pkgfile} (${pkgarch})" # any packages might have been moved by the previous run @@ -81,16 +81,16 @@ for repo in ${repos[@]}; do if [ -f "$FTP_BASE/${PKGPOOL}/${pkgfile}.sig" ]; then ln -s "../../../${PKGPOOL}/${pkgfile}.sig" "$FTP_BASE/$repo/os/${pkgarch}" fi - add_pkgs[${#add_pkgs[*]}]=${pkgfile} + add_pkgs+=("${pkgfile}") done if [ ${#add_pkgs[@]} -ge 1 ]; then - arch_repo_add "${repo}" "${pkgarch}" ${add_pkgs[@]} + arch_repo_add "${repo}" "${pkgarch}" "${add_pkgs[@]}" fi done done -for repo in ${repos[@]}; do - for pkgarch in ${ARCHES[@]}; do +for repo in "${repos[@]}"; do + for pkgarch in "${ARCHES[@]}"; do repo_unlock ${repo} ${pkgarch} done done -- cgit v1.2.3-2-g168b From 0811dea8b9c695ed9e67b22d389142956bd1cdd8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 8 Jan 2014 17:40:26 -0500 Subject: Fix quoting on arrays. --- db-update | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 1fddb8a..cdde63b 100755 --- a/db-update +++ b/db-update @@ -15,14 +15,14 @@ if [ $? -ge 1 ]; then fi # TODO: this might lock too much (architectures) -for repo in ${repos[@]}; do - for pkgarch in ${ARCHES[@]}; do +for repo in "${repos[@]}"; do + for pkgarch in "${ARCHES[@]}"; do repo_lock ${repo} ${pkgarch} || exit 1 done done # check if packages are valid -for repo in ${repos[@]}; do +for repo in "${repos[@]}"; do pkgs=($(getpkgfiles "${STAGING}/${repo}/"*${PKGEXT})) if [ $? -eq 0 ]; then if [ ${#pkgs[@]} -gt 0 ] && ! check_repo_permission "${repo}"; then @@ -48,7 +48,7 @@ for repo in ${repos[@]}; do fi done -for repo in ${repos[@]}; do +for repo in "${repos[@]}"; do msg "Updating [${repo}]..." any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null)) for pkgarch in ${ARCHES[@]}; do @@ -69,16 +69,16 @@ for repo in ${repos[@]}; do if [ -f "$FTP_BASE/${PKGPOOL}/${pkgfile}.sig" ]; then ln -s "../../../${PKGPOOL}/${pkgfile}.sig" "$FTP_BASE/$repo/os/${pkgarch}" fi - add_pkgs[${#add_pkgs[*]}]=${pkgfile} + add_pkgs+=("${pkgfile}") done if [ ${#add_pkgs[@]} -ge 1 ]; then - arch_repo_add "${repo}" "${pkgarch}" ${add_pkgs[@]} + arch_repo_add "${repo}" "${pkgarch}" "${add_pkgs[@]}" fi done done -for repo in ${repos[@]}; do - for pkgarch in ${ARCHES[@]}; do +for repo in "${repos[@]}"; do + for pkgarch in "${ARCHES[@]}"; do repo_unlock ${repo} ${pkgarch} done done -- cgit v1.2.3-2-g168b From b6e8ebd66d22abf5439485985a7851e768c71e8a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 8 Jan 2014 21:04:43 -0500 Subject: Be very careful about using $0. --- db-update | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index cdde63b..86faec3 100755 --- a/db-update +++ b/db-update @@ -1,10 +1,10 @@ #!/bin/bash -. "$(dirname $0)/db-functions" -. "$(dirname $0)/config" +. "$(dirname "$(readlink -e "$0")")/db-functions" +. "$(dirname "$(readlink -e "$0")")/config" if [ $# -ge 1 ]; then - warning "Calling $(basename $0) with a specific repository is no longer supported" + warning "Calling ${0##*/} with a specific repository is no longer supported" exit 1 fi -- cgit v1.2.3-2-g168b From eefb787983d2608511214bcd682f3d8271bac60c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 8 Jan 2014 16:44:51 -0500 Subject: Normalize to load config then local_config then db-functions --- db-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index 86faec3..e3da232 100755 --- a/db-update +++ b/db-update @@ -1,7 +1,7 @@ #!/bin/bash -. "$(dirname "$(readlink -e "$0")")/db-functions" . "$(dirname "$(readlink -e "$0")")/config" +. "$(dirname "$(readlink -e "$0")")/db-functions" if [ $# -ge 1 ]; then warning "Calling ${0##*/} with a specific repository is no longer supported" -- cgit v1.2.3-2-g168b From 9d9116bd23720cf6c5b27aa39e5cc4c71de1fb26 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 8 Jan 2014 21:27:07 -0500 Subject: Fix some array quoting. --- db-update | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index e3da232..60cc6cd 100755 --- a/db-update +++ b/db-update @@ -28,7 +28,7 @@ for repo in "${repos[@]}"; do if [ ${#pkgs[@]} -gt 0 ] && ! check_repo_permission "${repo}"; then die "You don't have permission to update packages in ${repo}" fi - for pkg in ${pkgs[@]}; do + for pkg in "${pkgs[@]}"; do if [ -h "${pkg}" ]; then die "Package ${repo}/$(basename ${pkg}) is a symbolic link" fi @@ -40,7 +40,7 @@ for repo in "${repos[@]}"; do fi done # This is fucking obnoxious - #if ! check_splitpkgs ${repo} ${pkgs[@]}; then + #if ! check_splitpkgs ${repo} "${pkgs[@]}"; then # die "Missing split packages for ${repo}" #fi else @@ -51,10 +51,10 @@ done for repo in "${repos[@]}"; do msg "Updating [${repo}]..." any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null)) - for pkgarch in ${ARCHES[@]}; do + for pkgarch in "${ARCHES[@]}"; do add_pkgs=() arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-${pkgarch}${PKGEXT} 2>/dev/null)) - for pkg in ${arch_pkgs[@]} ${any_pkgs[@]}; do + for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do pkgfile="$(basename ${pkg})" msg2 "${pkgfile} (${pkgarch})" # any packages might have been moved by the previous run -- cgit v1.2.3-2-g168b From d3afe9bb766bbdfaab1474d21fd5e28f0a356039 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 8 Jan 2014 20:49:48 -0500 Subject: Avoid using $(basename $var) , use ${var##*/} instead --- db-update | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 60cc6cd..99c8be5 100755 --- a/db-update +++ b/db-update @@ -30,13 +30,13 @@ for repo in "${repos[@]}"; do fi for pkg in "${pkgs[@]}"; do if [ -h "${pkg}" ]; then - die "Package ${repo}/$(basename ${pkg}) is a symbolic link" + die "Package ${repo}/${pkg##*/} is a symbolic link" fi if ! check_pkgfile "${pkg}"; then - die "Package ${repo}/$(basename ${pkg}) is not consistent with its meta data" + die "Package ${repo}/${pkg##*/} is not consistent with its meta data" fi if ! check_pkgrepos "${pkg}"; then - die "Package ${repo}/$(basename ${pkg}) already exists in another repository" + die "Package ${repo}/${pkg##*/} already exists in another repository" fi done # This is fucking obnoxious @@ -55,7 +55,7 @@ for repo in "${repos[@]}"; do add_pkgs=() arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-${pkgarch}${PKGEXT} 2>/dev/null)) for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do - pkgfile="$(basename ${pkg})" + pkgfile="${pkg##*/}" msg2 "${pkgfile} (${pkgarch})" # any packages might have been moved by the previous run if [ -f "${pkg}" ]; then -- cgit v1.2.3-2-g168b From 93eb77cbad072a25b9aa5542ce7fa59746ca9284 Mon Sep 17 00:00:00 2001 From: aurelien Date: Sat, 11 Jan 2014 12:39:37 +0100 Subject: modification on db-update for mail --- db-update | 1 + 1 file changed, 1 insertion(+) (limited to 'db-update') diff --git a/db-update b/db-update index 99c8be5..73d5d3f 100755 --- a/db-update +++ b/db-update @@ -91,5 +91,6 @@ while read -r file; do else mkdir -p -- "${pub%/*}" mv -vn "$file" "$pub" + echo "At `date`, script \"`basename $0`\" mailed to "maintenance@lists.parabolagnulinux.org"." fi done < <(find other sources -type f) -- cgit v1.2.3-2-g168b From 0684ad038134d7c9ccbaebc709c4267a904b98b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Wed, 15 Jan 2014 19:31:03 -0200 Subject: db-update: add shopt -s nullglob and remove mail script to maintenance@lists.parabolagnulinux.org because it's unstable --- db-update | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index 73d5d3f..186ed55 100755 --- a/db-update +++ b/db-update @@ -3,6 +3,8 @@ . "$(dirname "$(readlink -e "$0")")/config" . "$(dirname "$(readlink -e "$0")")/db-functions" +shopt -s nullglob + if [ $# -ge 1 ]; then warning "Calling ${0##*/} with a specific repository is no longer supported" exit 1 @@ -91,6 +93,5 @@ while read -r file; do else mkdir -p -- "${pub%/*}" mv -vn "$file" "$pub" - echo "At `date`, script \"`basename $0`\" mailed to "maintenance@lists.parabolagnulinux.org"." fi done < <(find other sources -type f) -- cgit v1.2.3-2-g168b