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 33b8cb611363102e23972cf3914a03d65cb3cad8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 17 Jun 2013 23:59:15 -0600 Subject: use xbs, not svn --- db-update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 576fe2b..28fcabe 100755 --- a/db-update +++ b/db-update @@ -45,8 +45,8 @@ for repo in ${repos[@]}; do if ${REQUIRE_SIGNATURE} && ! pacman-key -v "${pkg}.sig" >/dev/null 2>&1; then die "Package ${repo}/${pkg##*/} does not have a valid signature" fi - if ! check_pkgsvn "${pkg}" "${repo}"; then - die "Package ${repo}/${pkg##*/} is not consistent with svn repository" + if ! check_pkgxbs "${pkg}" "${repo}"; then + die "Package ${repo}/${pkg##*/} is not consistent with xbs" fi if ! check_pkgrepos "${pkg}"; then die "Package ${repo}/${pkg##*/} already exists in another repository" -- cgit v1.2.3-2-g168b From e6294556d3197b7d87f7659355d0e189fad613d6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 8 Dec 2013 17:33:25 -0500 Subject: `readlink -e` all "$0"s --- db-update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 28fcabe..9c6a56a 100755 --- a/db-update +++ b/db-update @@ -1,7 +1,7 @@ #!/bin/bash -. "$(dirname $0)/config" -. "$(dirname $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 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 From 7d061a7e0faa365ae2448154c010eed26409713d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 11:58:49 -0400 Subject: more quoting an printf fixes --- db-update | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index f830e11..9a52e01 100755 --- a/db-update +++ b/db-update @@ -6,18 +6,18 @@ shopt -s nullglob if [ $# -ge 1 ]; then - warning "Calling ${0##*/} with a specific repository is no longer supported" + warning "Calling %s with a specific repository is no longer supported" "${0##*/}" exit 1 fi # Find repos with packages to release staging_repos=($(find "${STAGING}" -mindepth 1 -type f -name "*${PKGEXT}" -printf '%h\n' | sort -u)) if [ $? -ge 1 ]; then - die "Could not read ${STAGING}" + die "Could not read %s" "${STAGING}" fi repos=() -for staging_repo in ${staging_repos[@]##*/}; do +for staging_repo in "${staging_repos[@]##*/}"; do if in_array "${staging_repo}" "${PKGREPOS[@]}"; then repos+=("${staging_repo}") fi @@ -26,7 +26,7 @@ done # TODO: this might lock too much (architectures) for repo in "${repos[@]}"; do for pkgarch in "${ARCHES[@]}"; do - repo_lock ${repo} ${pkgarch} || exit 1 + repo_lock "${repo}" "${pkgarch}" || exit 1 done done @@ -35,42 +35,42 @@ 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}" + die "You don't have permission to update packages in %s" "${repo}" fi for pkg in "${pkgs[@]}"; do if [ -h "${pkg}" ]; then - die "Package ${repo}/${pkg##*/} is a symbolic link" + die "Package %s is a symbolic link" "${repo}/${pkg##*/}" fi if ! check_pkgfile "${pkg}"; then - die "Package ${repo}/${pkg##*/} is not consistent with its meta data" + die "Package %s is not consistent with its meta data" "${repo}/${pkg##*/}" fi - if ${REQUIRE_SIGNATURE} && ! pacman-key -v "${pkg}.sig" >/dev/null 2>&1; then - die "Package ${repo}/${pkg##*/} does not have a valid signature" + if "${REQUIRE_SIGNATURE}" && ! pacman-key -v "${pkg}.sig" >/dev/null 2>&1; then + die "Package %s does not have a valid signature" "${repo}/${pkg##*/}" fi if ! check_pkgxbs "${pkg}" "${repo}"; then - die "Package ${repo}/${pkg##*/} is not consistent with xbs" + die "Package %s is not consistent with XBS" "${repo}/${pkg##*/}" fi if ! check_pkgrepos "${pkg}"; then - die "Package ${repo}/${pkg##*/} already exists in another repository" + die "Package %s already exists in another repository" "${repo}/${pkg##*/}" fi done - if ! check_splitpkgs ${repo} ${pkgs[@]}; then - die "Missing split packages for ${repo}" + if ! check_splitpkgs "${repo}" "${pkgs[@]}"; then + die "Missing split packages for %s" "${repo}" fi else - die "Could not read ${STAGING}" + die "Could not read %s" "${STAGING}" fi done for repo in "${repos[@]}"; do - msg "Updating [${repo}]..." + msg "Updating [%s]..." "${repo}" any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null)) for pkgarch in "${ARCHES[@]}"; do add_pkgs=() - arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-${pkgarch}${PKGEXT} 2>/dev/null)) + arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-"${pkgarch}"${PKGEXT} 2>/dev/null)) for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do pkgfile="${pkg##*/}" - msg2 "${pkgfile} (${pkgarch})" + msg2 "%s (%s)" "${pkgfile}" "${pkgarch}" # any packages might have been moved by the previous run if [ -f "${pkg}" ]; then mv "${pkg}" "$FTP_BASE/${PKGPOOL}" @@ -93,7 +93,7 @@ done for repo in "${repos[@]}"; do for pkgarch in "${ARCHES[@]}"; do - repo_unlock ${repo} ${pkgarch} + repo_unlock "${repo}" "${pkgarch}" done done -- cgit v1.2.3-2-g168b From 46510e1fc48f37ce76c2bf5f19f885bba8d5d098 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 13:05:12 -0400 Subject: Clean up quoting. --- db-update | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 186ed55..18162db 100755 --- a/db-update +++ b/db-update @@ -19,7 +19,7 @@ fi # TODO: this might lock too much (architectures) for repo in "${repos[@]}"; do for pkgarch in "${ARCHES[@]}"; do - repo_lock ${repo} ${pkgarch} || exit 1 + repo_lock "${repo}" "${pkgarch}" || exit 1 done done @@ -55,7 +55,7 @@ for repo in "${repos[@]}"; do any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null)) for pkgarch in "${ARCHES[@]}"; do add_pkgs=() - arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-${pkgarch}${PKGEXT} 2>/dev/null)) + arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-"${pkgarch}"${PKGEXT} 2>/dev/null)) for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do pkgfile="${pkg##*/}" msg2 "${pkgfile} (${pkgarch})" @@ -81,7 +81,7 @@ done for repo in "${repos[@]}"; do for pkgarch in "${ARCHES[@]}"; do - repo_unlock ${repo} ${pkgarch} + repo_unlock "${repo}" "${pkgarch}" done done -- cgit v1.2.3-2-g168b From 386c2d00249eb244bbcc9a173a64f9435b70180a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 13:45:10 -0400 Subject: Use printf formatters instead of string interpolation. I used this command to find them: egrep -r --exclude-dir={test,.git} '(plain|msg|msg2|warning|error|stat_busy|stat_done|abort|die)\s+"?[^"]*\$' --- db-update | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 18162db..ced673e 100755 --- a/db-update +++ b/db-update @@ -6,14 +6,14 @@ shopt -s nullglob if [ $# -ge 1 ]; then - warning "Calling ${0##*/} with a specific repository is no longer supported" + warning "Calling %s with a specific repository is no longer supported" "${0##*/}" exit 1 fi # Find repos with packages to release repos=($(find "${STAGING}" -mindepth 1 -maxdepth 1 -type d ! -empty -printf '%f ' 2>/dev/null)) if [ $? -ge 1 ]; then - die "Could not read ${STAGING}" + die "Could not read %s" "${STAGING}" fi # TODO: this might lock too much (architectures) @@ -28,37 +28,37 @@ 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}" + die "You don't have permission to update packages in %s" "${repo}" fi for pkg in "${pkgs[@]}"; do if [ -h "${pkg}" ]; then - die "Package ${repo}/${pkg##*/} is a symbolic link" + die "Package %s is a symbolic link" "${repo}/${pkg##*/}" fi if ! check_pkgfile "${pkg}"; then - die "Package ${repo}/${pkg##*/} is not consistent with its meta data" + die "Package %s is not consistent with its meta data" "${repo}/${pkg##*/}" fi if ! check_pkgrepos "${pkg}"; then - die "Package ${repo}/${pkg##*/} already exists in another repository" + die "Package %s already exists in another repository" "${repo}/${pkg##*/}" fi done # This is fucking obnoxious #if ! check_splitpkgs ${repo} "${pkgs[@]}"; then - # die "Missing split packages for ${repo}" + # die "Missing split packages for %s" "${repo}" #fi else - die "Could not read ${STAGING}" + die "Could not read %s" "${STAGING}" fi done for repo in "${repos[@]}"; do - msg "Updating [${repo}]..." + msg "Updating [%s]..." "${repo}" any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null)) 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 pkgfile="${pkg##*/}" - msg2 "${pkgfile} (${pkgarch})" + msg2 '%s (%s)' "${pkgfile}" "${pkgarch}" # any packages might have been moved by the previous run if [ -f "${pkg}" ]; then mv "${pkg}" "$FTP_BASE/${PKGPOOL}" -- cgit v1.2.3-2-g168b From b3c27405fb9e2686d3db9ee23ca616dc6b93b1f3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 14:20:35 -0400 Subject: silly whitespace and similar fidling --- db-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index ced673e..4d2cace 100755 --- a/db-update +++ b/db-update @@ -58,7 +58,7 @@ for repo in "${repos[@]}"; do arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-"${pkgarch}"${PKGEXT} 2>/dev/null)) for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do pkgfile="${pkg##*/}" - msg2 '%s (%s)' "${pkgfile}" "${pkgarch}" + msg2 "%s (%s)" "${pkgfile}" "${pkgarch}" # any packages might have been moved by the previous run if [ -f "${pkg}" ]; then mv "${pkg}" "$FTP_BASE/${PKGPOOL}" -- cgit v1.2.3-2-g168b From 8e670c23359134af39b1c97173895c09948c2acb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 24 Jun 2014 22:51:14 -0400 Subject: db-update: get the list of repos the same way as upstream Arch The largest advantage of this is that it implicitly ignores directories we don't want to consider repos. --- db-update | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index 4d2cace..a0a3e39 100755 --- a/db-update +++ b/db-update @@ -11,11 +11,18 @@ 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)) +staging_repos=($(find "${STAGING}" -mindepth 1 -type f -name "*${PKGEXT}" -printf '%h\n' | sort -u)) if [ $? -ge 1 ]; then die "Could not read %s" "${STAGING}" fi +repos=() +for staging_repo in "${staging_repos[@]##*/}"; do + 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 -- cgit v1.2.3-2-g168b From b85f896c2cb614ac22b11c14bd9e7994773309eb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 4 Jul 2014 22:51:46 -0400 Subject: Fix having a flexible PKGEXT --- db-update | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index a0a3e39..3c06f63 100755 --- a/db-update +++ b/db-update @@ -3,7 +3,10 @@ . "$(dirname "$(readlink -e "$0")")/config" . "$(dirname "$(readlink -e "$0")")/db-functions" -shopt -s nullglob +if [[ $STAGING = *luke* ]]; then + set -x + PKGEXT='.pkg.tar.?z' +fi if [ $# -ge 1 ]; then warning "Calling %s with a specific repository is no longer supported" "${0##*/}" @@ -32,11 +35,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 %s" "${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 %s" "${repo}" - fi for pkg in "${pkgs[@]}"; do if [ -h "${pkg}" ]; then die "Package %s is a symbolic link" "${repo}/${pkg##*/}" @@ -95,10 +98,10 @@ done cd "${STAGING}" while read -r file; do pub="${FTP_BASE}/${file}" - if [[ -f $pub ]]; then + if [[ -f "$pub" ]]; then warning "file already exists: %s" "${file}" else mkdir -p -- "${pub%/*}" mv -vn "$file" "$pub" fi -done < <(find other sources -type f) +done < <(find other sources -type f 2>/dev/null) -- cgit v1.2.3-2-g168b From 1918eeec794d764ce021996ab66e923fc50195b4 Mon Sep 17 00:00:00 2001 From: Parabola Date: Sun, 24 May 2015 08:02:12 +0100 Subject: db-update: Remove debugging code --- db-update | 5 ----- 1 file changed, 5 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 3c06f63..0c4f824 100755 --- a/db-update +++ b/db-update @@ -3,11 +3,6 @@ . "$(dirname "$(readlink -e "$0")")/config" . "$(dirname "$(readlink -e "$0")")/db-functions" -if [[ $STAGING = *luke* ]]; then - set -x - PKGEXT='.pkg.tar.?z' -fi - if [ $# -ge 1 ]; then warning "Calling %s with a specific repository is no longer supported" "${0##*/}" exit 1 -- cgit v1.2.3-2-g168b From 0b44acfc457cd954297d36851c712f0149851699 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 25 May 2015 01:11:21 -0600 Subject: db-update: Remove debug code --- db-update | 5 ----- 1 file changed, 5 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 0a46128..3b63708 100755 --- a/db-update +++ b/db-update @@ -3,11 +3,6 @@ . "$(dirname "$(readlink -e "$0")")/config" . "$(dirname "$(readlink -e "$0")")/db-functions" -if [[ $STAGING = *luke* ]]; then - set -x - PKGEXT='.pkg.tar.?z' -fi - if [ $# -ge 1 ]; then warning "Calling %s with a specific repository is no longer supported" "${0##*/}" exit 1 -- cgit v1.2.3-2-g168b From af138659e5042debbb57deba5c0419ba744f75fd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 25 May 2015 01:29:34 -0600 Subject: Pull in more changes from lukeshu/archlinux+cleanup+librelib --- db-update | 3 +++ 1 file changed, 3 insertions(+) (limited to 'db-update') diff --git a/db-update b/db-update index 3b63708..57a2251 100755 --- a/db-update +++ b/db-update @@ -51,6 +51,9 @@ for repo in "${repos[@]}"; do if ! check_pkgrepos "${pkg}"; then die "Package %s already exists in another repository" "${repo}/${pkg##*/}" fi + if ! check_packager "${pkg}"; then + die "Package ${repo}/${pkg##*/} does not have a valid packager" + fi done if ! check_splitpkgs "${repo}" "${pkgs[@]}"; then die "Missing split packages for %s" "${repo}" -- cgit v1.2.3-2-g168b From de1f6d3b16d6e833ec5df6e9f403aec7e2193962 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 25 May 2015 01:30:09 -0600 Subject: Use $(xbs name) instead of saying XBS. --- db-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index 57a2251..9b9b7b4 100755 --- a/db-update +++ b/db-update @@ -46,7 +46,7 @@ for repo in "${repos[@]}"; do die "Package %s does not have a valid signature" "${repo}/${pkg##*/}" fi if ! check_pkgxbs "${pkg}" "${repo}"; then - die "Package %s is not consistent with XBS" "${repo}/${pkg##*/}" + die "Package %s is not consistent with %s" "${repo}/${pkg##*/}" "$(xbs name)" fi if ! check_pkgrepos "${pkg}"; then die "Package %s already exists in another repository" "${repo}/${pkg##*/}" -- cgit v1.2.3-2-g168b From b96b9d95dd4d2214a428f1435a9a72ef50f43cf5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 5 Jun 2015 00:48:12 -0600 Subject: db-update: Hook in to `xbs release-server` as it exists today. Obviously, this is an exercise in noticing a leaky abstraction. - assumes that the PKGBUILD is staged to a real directory going in - assumes where that is - assumes how to clean that up I believe the correct solution will require modifying XBS. Following is what I believe the changes should be. - change release-server to take "REPO ARCH DIR1 [DIR2...]", instead of using the CWD. - but this still assumes that the caller knows where release-client put the PKGBUILD, so change it to take "REPO ARCH PKGBASE1 [PKGBASE2...]". - this means that release-server knows to check if a PKGBUILD exists at the specified arch, and fall back to 'any' if it doesn't. - an alternative would be passing in the .pkg.tar filenames, and either parsing the filename or using db-functions to figure out the arch. - ??? how to get rid of cleaning up assumptions. --- db-update | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'db-update') diff --git a/db-update b/db-update index 0c4f824..f22eb15 100755 --- a/db-update +++ b/db-update @@ -55,13 +55,16 @@ for repo in "${repos[@]}"; do fi done +dirs=() for repo in "${repos[@]}"; do msg "Updating [%s]..." "${repo}" any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null)) for pkgarch in "${ARCHES[@]}"; do + add_dirs=() add_pkgs=() arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-"${pkgarch}"${PKGEXT} 2>/dev/null)) for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do + add_dirs+=("${STAGING}/abslibre/$(getpkgarch "$pkg")/$(getpkgbase "$pkg")") pkgfile="${pkg##*/}" msg2 "%s (%s)" "${pkgfile}" "${pkgarch}" # any packages might have been moved by the previous run @@ -78,9 +81,14 @@ for repo in "${repos[@]}"; do fi add_pkgs+=("${pkgfile}") done + for add_dir in "${add_dirs[@]}"; do + (cd "${add_dir}" && xbs release-server "${repo}" "${pkgarch}") || + error 'cd %q && xbs release-server %q %q' "${add_dir}" "${repo}" "${pkgarch}" + done if [ ${#add_pkgs[@]} -ge 1 ]; then arch_repo_add "${repo}" "${pkgarch}" "${add_pkgs[@]}" fi + dirs+=("${add_dirs[@]}") done done @@ -91,6 +99,14 @@ for repo in "${repos[@]}"; do done cd "${STAGING}" + +# Remove left over XBS files +rm -rf -- "${dirs[@]}" +dirname -z -- "${dirs[@]}" | + xargs -0 realpath -zm --relative-to="${STAGING}" -- | + xargs -0 rmdir -p -- 2>/dev/null + +# Stage generated source files while read -r file; do pub="${FTP_BASE}/${file}" if [[ -f "$pub" ]]; then -- cgit v1.2.3-2-g168b From 969e2de31319c95913ec52f85b97552c3d26414f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 8 Jun 2015 07:02:15 +0100 Subject: db-update: get the correct directory for xbs --- db-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index f22eb15..4830791 100755 --- a/db-update +++ b/db-update @@ -64,7 +64,6 @@ 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 - add_dirs+=("${STAGING}/abslibre/$(getpkgarch "$pkg")/$(getpkgbase "$pkg")") pkgfile="${pkg##*/}" msg2 "%s (%s)" "${pkgfile}" "${pkgarch}" # any packages might have been moved by the previous run @@ -79,6 +78,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_dirs+=("${STAGING}/abslibre/$(getpkgarch "$FTP_BASE/$PKGPOOL/$pkgfile")/$repo/$(getpkgbase "$FTP_BASE/$PKGPOOL/$pkgfile")") add_pkgs+=("${pkgfile}") done for add_dir in "${add_dirs[@]}"; do -- cgit v1.2.3-2-g168b