From 9454e6c20dc722aa65dbdc9a1c4a5ba65bac4f8e Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 6 Mar 2014 23:18:22 +0100 Subject: initial work to support new dbscripts still buggy and missing features, but I don't know which. forgot to commit this earlier... Signed-off-by: Florian Pritz --- archrelease.in | 41 ++++++++++++++++++++--------------------- commitpkg.in | 33 ++++++++++++--------------------- 2 files changed, 32 insertions(+), 42 deletions(-) diff --git a/archrelease.in b/archrelease.in index 6f52dbc..bac4041 100644 --- a/archrelease.in +++ b/archrelease.in @@ -56,31 +56,30 @@ done # gracefully handle files containing an "@" character known_files=("${known_files[@]/%/@}") +tag=$(get_full_version $_pkgname) + +stat_busy "Copying ${trunk} to ${tag}" + +if [[ -d tags/$tag ]]; then + #declare -a trash + #trash=() + #while read -r file; do + #trash+=("tags/$tag/$file") + #done < <(svn ls "tags/$tag") + #[[ $trash ]] && svn rm -q "${trash[@]/%/@}" + die "already tagged" +else + mkdir -p "tags/$tag" + svn add --parents -q "tags/$tag" +fi -for tag in "$@"; do - stat_busy "Copying ${trunk} to ${tag}" - - if [[ -d repos/$tag ]]; then - declare -a trash - trash=() - while read -r file; do - trash+=("repos/$tag/$file") - done < <(svn ls "repos/$tag") - [[ $trash ]] && svn rm -q "${trash[@]/%/@}" - else - mkdir -p "repos/$tag" - svn add --parents -q "repos/$tag" - fi - - # copy all files at once from trunk to the subdirectory in repos/ - svn copy -q -r HEAD ${known_files[@]/#/$trunk/} "repos/$tag/" +# copy all files at once from trunk to the subdirectory in repos/ +svn copy -q -r HEAD ${known_files[@]/#/$trunk/} "tags/$tag/" - stat_done -done +stat_done stat_busy "Releasing package" -printf -v tag_list ", %s" "$@"; tag_list="${tag_list#, }" -svn commit -q -m "archrelease: copy ${trunk} to $tag_list" || abort +svn commit -q -m "archrelease: copy ${trunk} to $tag" || abort stat_done popd >/dev/null diff --git a/commitpkg.in b/commitpkg.in index 1095006..237e5db 100644 --- a/commitpkg.in +++ b/commitpkg.in @@ -163,7 +163,7 @@ for _arch in ${arch[@]}; do done if [[ ${#commit_arches[*]} -gt 0 ]]; then - archrelease "${archreleaseopts[@]}" "${commit_arches[@]/#/$repo-}" || die + archrelease || die fi if [[ ${#uploads[*]} -gt 0 ]]; then @@ -178,25 +178,16 @@ if [[ ${#uploads[*]} -gt 0 ]]; then unset new_uploads msg 'Uploading all package and signature files' rsync "${rsyncopts[@]}" "${uploads[@]}" "$server:staging/$repo/" || die -fi -if [[ "${arch[*]}" == 'any' ]]; then - if [[ -d ../repos/$repo-i686 && -d ../repos/$repo-x86_64 ]]; then - pushd ../repos/ >/dev/null - stat_busy "Removing $repo-i686 and $repo-x86_64" - svn rm -q $repo-i686 - svn rm -q $repo-x86_64 - svn commit -q -m "Removed $repo-i686 and $repo-x86_64 for $pkgname" - stat_done - popd >/dev/null - fi -else - if [[ -d ../repos/$repo-any ]]; then - pushd ../repos/ >/dev/null - stat_busy "Removing $repo-any" - svn rm -q $repo-any - svn commit -q -m "Removed $repo-any for $pkgname" - stat_done - popd >/dev/null - fi + for _upload in "${uploads[@]}"; do + local pkgfile=${upload##*/} + + # TODO: logic to determine which package to add to which arches + if [[ $pkgfile = *.pkg.tar?(.?z) ]]; then + for _arch in "${commit_arches[@]}"; do + ssh "$server" ln -sr "staging/$repo/$pkgfile" "staging/$repo/$arch/$pkgfile" + done + fi + done fi + -- cgit v1.2.3-24-g4f1b