[arch-projects] [devtools] [PATCH] commitpkg: use absolute paths when uploading files
This fixes a problem where rsync won't work if the pkgver contains a colon (epoch). In this case rsync assumes that the colon is a remote:path separator and having src and dest both being remote arguments is not supported. Signed-off-by: Florian Pritz <bluewind@xinu.at> --- commitpkg.in | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/commitpkg.in b/commitpkg.in index bf3a5ab..fec41ff 100644 --- a/commitpkg.in +++ b/commitpkg.in @@ -168,6 +168,14 @@ for _arch in ${arch[@]}; do done archrelease "${commit_arches[@]/#/$repo-}" || die +new_uploads=() + +for upload in ${uploads[@]}; do + new_uploads=("${new_uploads[@]}" "$(readlink -f "$upload")") +done + +uploads=("${new_uploads[@]}") + if [[ ${#uploads[*]} -gt 0 ]]; then msg 'Uploading all package and signature files' rsync "${rsyncopts[@]}" "${uploads[@]}" "$server:staging/$repo/" || die -- 1.7.8.4
On Sun, Jan 22, 2012 at 12:01:15PM +0100, Florian Pritz wrote:
This fixes a problem where rsync won't work if the pkgver contains a colon (epoch). In this case rsync assumes that the colon is a remote:path separator and having src and dest both being remote arguments is not supported.
Signed-off-by: Florian Pritz <bluewind@xinu.at> --- commitpkg.in | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/commitpkg.in b/commitpkg.in index bf3a5ab..fec41ff 100644 --- a/commitpkg.in +++ b/commitpkg.in @@ -168,6 +168,14 @@ for _arch in ${arch[@]}; do done archrelease "${commit_arches[@]/#/$repo-}" || die
+new_uploads=() + +for upload in ${uploads[@]}; do + new_uploads=("${new_uploads[@]}" "$(readlink -f "$upload")") +done + +uploads=("${new_uploads[@]}") +
You can make this a simple one fork call by using realpath instead: while read -r -d '' upload; do new_uploads+=("$upload") done < <(realpath -z "${uploads[@]}") uploads=("${new_uploads[@]}") unset new_uploads
if [[ ${#uploads[*]} -gt 0 ]]; then msg 'Uploading all package and signature files' rsync "${rsyncopts[@]}" "${uploads[@]}" "$server:staging/$repo/" || die -- 1.7.8.4
This fixes a problem where rsync won't work if the pkgver contains a colon (epoch). In this case rsync assumes that the colon is a remote:path separator and having src and dest both being remote arguments is not supported. Signed-off-by: Florian Pritz <bluewind@xinu.at> --- This includes the change from Dave so we fork only once. commitpkg.in | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/commitpkg.in b/commitpkg.in index bf3a5ab..8139090 100644 --- a/commitpkg.in +++ b/commitpkg.in @@ -168,6 +168,16 @@ for _arch in ${arch[@]}; do done archrelease "${commit_arches[@]/#/$repo-}" || die +new_uploads=() + +# convert to absolute paths so rsync can work with colons (epoch) +while read -r -d '' upload; do + new_uploads+=("$upload") +done < <(realpath -z "${uploads[@]}") + +uploads=("${new_uploads[@]}") +unset new_uploads + if [[ ${#uploads[*]} -gt 0 ]]; then msg 'Uploading all package and signature files' rsync "${rsyncopts[@]}" "${uploads[@]}" "$server:staging/$repo/" || die -- 1.7.8.4
participants (2)
-
Dave Reisner
-
Florian Pritz