[arch-dev-public] [devtools] [PATCH] commitpkg: upload signature if found
Also move some rsync options to $rsyncopts to help with readability. Signed-off-by: Rémy Oudompheng <remy@archlinux.org> --- This patch was part of a patchset posted by Allan two weeks ago. Only one of his patches was merged, this is the second one, which include remarks made by Dan. Along with the dbscripts patch, it would allow current developers to begin signing their packages, and have the signatures transferred to mirrors with a smooth workflow even if signature checking is not fully integrated in pacman. commitpkg | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/commitpkg b/commitpkg index dfc2bd1..b478989 100755 --- a/commitpkg +++ b/commitpkg @@ -104,9 +104,9 @@ for i in 'changelog' 'install'; do done # see if any limit options were passed, we'll send them to rsync -unset rsyncopts +rsyncopts="-p --chmod 'ug=rw,o=r' -c -h -L --progress" if [ "$1" = '-l' ]; then - rsyncopts="--bwlimit=$2" + rsyncopts="$rsyncopts --bwlimit=$2" shift 2 fi @@ -134,8 +134,14 @@ for _arch in ${arch[@]}; do continue 2 fi + sigfile="${pkgfile}.sig" + if [ -f "${sigfile}" ]; then + echo "WARNING: No package signature found" + sigfile="" + fi + echo -n 'uploading ' - rsync -p --chmod 'ug=rw,o=r' -c -h -L --progress $rsyncopts --partial "${pkgfile}" -e ssh "$server:staging/$repo/${pkgfile##*/}" || abort + rsync -e ssh $rsyncopts --partial "${pkgfile}" ${sigfile} "$server:staging/$repo/${pkgfile##*/}" || abort done archrelease $repo-${_arch} || abort done -- 1.7.4.2
On Thu, Mar 31, 2011 at 6:00 PM, Rémy Oudompheng <remyoudompheng@gmail.com> wrote:
Also move some rsync options to $rsyncopts to help with readability.
Signed-off-by: Rémy Oudompheng <remy@archlinux.org> --- This patch was part of a patchset posted by Allan two weeks ago. Only one of his patches was merged, this is the second one, which include remarks made by Dan. Along with the dbscripts patch, it would allow current developers to begin signing their packages, and have the signatures transferred to mirrors with a smooth workflow even if signature checking is not fully integrated in pacman.
commitpkg | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/commitpkg b/commitpkg index dfc2bd1..b478989 100755 --- a/commitpkg +++ b/commitpkg @@ -104,9 +104,9 @@ for i in 'changelog' 'install'; do done
# see if any limit options were passed, we'll send them to rsync -unset rsyncopts +rsyncopts="-p --chmod 'ug=rw,o=r' -c -h -L --progress" if [ "$1" = '-l' ]; then - rsyncopts="--bwlimit=$2" + rsyncopts="$rsyncopts --bwlimit=$2" shift 2 fi
@@ -134,8 +134,14 @@ for _arch in ${arch[@]}; do continue 2 fi
+ sigfile="${pkgfile}.sig" + if [ -f "${sigfile}" ]; then + echo "WARNING: No package signature found" + sigfile="" + fi Maybe for now disable this warning so we can get this patch into the toolchain now for those of us using tools generating signatures, but not bothering those that aren't? The sooner this gets added to devtools (and dbscripts), the sooner we will have good test data to work from to finish the rest of the signing stuff in pacman.
+ echo -n 'uploading ' - rsync -p --chmod 'ug=rw,o=r' -c -h -L --progress $rsyncopts --partial "${pkgfile}" -e ssh "$server:staging/$repo/${pkgfile##*/}" || abort + rsync -e ssh $rsyncopts --partial "${pkgfile}" ${sigfile} "$server:staging/$repo/${pkgfile##*/}" || abort done archrelease $repo-${_arch} || abort done -- 1.7.4.2
On Fri, 1 Apr 2011 01:00:00 +0200, Rémy Oudompheng wrote:
- rsync -p --chmod 'ug=rw,o=r' -c -h -L --progress $rsyncopts --partial "${pkgfile}" -e ssh "$server:staging/$repo/${pkgfile##*/}" || abort + rsync -e ssh $rsyncopts --partial "${pkgfile}" ${sigfile} "$server:staging/$repo/${pkgfile##*/}" || abort
Are you sure that this will work? Looks like your are having two source files and one target that is also a file. -- Pierre Schmitz, https://users.archlinux.de/~pierre
On 2011/4/1 Pierre Schmitz <pierre@archlinux.de> wrote:
On Fri, 1 Apr 2011 01:00:00 +0200, Rémy Oudompheng wrote:
- rsync -p --chmod 'ug=rw,o=r' -c -h -L --progress $rsyncopts --partial "${pkgfile}" -e ssh "$server:staging/$repo/${pkgfile##*/}" || abort + rsync -e ssh $rsyncopts --partial "${pkgfile}" ${sigfile} "$server:staging/$repo/${pkgfile##*/}" || abort
Are you sure that this will work? Looks like your are having two source files and one target that is also a file.
I feel stupid. I'll upload a new patch, unless you merge this with all the necessary fixes. Rémy.
Also move some rsync options to $rsyncopts to help with readability. Signed-off-by: Rémy Oudompheng <remy@archlinux.org> --- commitpkg | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/commitpkg b/commitpkg index dfc2bd1..fb8f9ea 100755 --- a/commitpkg +++ b/commitpkg @@ -104,9 +104,9 @@ for i in 'changelog' 'install'; do done # see if any limit options were passed, we'll send them to rsync -unset rsyncopts +rsyncopts="-p --chmod 'ug=rw,o=r' -c -h -L --progress" if [ "$1" = '-l' ]; then - rsyncopts="--bwlimit=$2" + rsyncopts="$rsyncopts --bwlimit=$2" shift 2 fi @@ -135,7 +135,13 @@ for _arch in ${arch[@]}; do fi echo -n 'uploading ' - rsync -p --chmod 'ug=rw,o=r' -c -h -L --progress $rsyncopts --partial "${pkgfile}" -e ssh "$server:staging/$repo/${pkgfile##*/}" || abort + rsync -e ssh $rsyncopts --partial "${pkgfile}" "$server:staging/$repo/${pkgfile##*/}" || abort + + sigfile="${pkgfile}.sig" + if [ -f "${sigfile}" ]; then + echo -n 'uploading ' + rsync -e ssh $rsyncopts --partial "${sigfile}" "$server:staging/$repo/${sigfile##*/}" || abort + fi done archrelease $repo-${_arch} || abort done -- 1.7.4.2
On Fri, Apr 1, 2011 at 2:11 PM, Rémy Oudompheng <remyoudompheng@gmail.com> wrote:
Also move some rsync options to $rsyncopts to help with readability.
Signed-off-by: Rémy Oudompheng <remy@archlinux.org> --- commitpkg | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/commitpkg b/commitpkg index dfc2bd1..fb8f9ea 100755 --- a/commitpkg +++ b/commitpkg @@ -104,9 +104,9 @@ for i in 'changelog' 'install'; do done
# see if any limit options were passed, we'll send them to rsync -unset rsyncopts +rsyncopts="-p --chmod 'ug=rw,o=r' -c -h -L --progress" if [ "$1" = '-l' ]; then - rsyncopts="--bwlimit=$2" + rsyncopts="$rsyncopts --bwlimit=$2" shift 2 fi
@@ -135,7 +135,13 @@ for _arch in ${arch[@]}; do fi
echo -n 'uploading ' - rsync -p --chmod 'ug=rw,o=r' -c -h -L --progress $rsyncopts --partial "${pkgfile}" -e ssh "$server:staging/$repo/${pkgfile##*/}" || abort + rsync -e ssh $rsyncopts --partial "${pkgfile}" "$server:staging/$repo/${pkgfile##*/}" || abort + + sigfile="${pkgfile}.sig" + if [ -f "${sigfile}" ]; then + echo -n 'uploading ' + rsync -e ssh $rsyncopts --partial "${sigfile}" "$server:staging/$repo/${sigfile##*/}" || abort + fi WTF- so now we've gone back to the original two-upload? What are we doing here?
rsync -e ssh $rsyncopts --partial "${pkgfile}" "${sigfile}" "$server:staging/$repo/" will work just fine. $ rsync -e ssh -p -c -h -L --progress /tmp/foobar /tmp/foobaz gerolde.archlinux.org:staging/extra/ foobar 0 100% 0.00kB/s 0:00:00 (xfer#1, to-check=1/2) foobaz 0 100% 0.00kB/s 0:00:00 (xfer#2, to-check=0/2) sent 144 bytes received 50 bytes 129.33 bytes/sec total size is 0 speedup is 0.00 dmcgee@galway ~ $ ssh gerolde ls -l staging/extra total 0 -rw-r--r-- 1 dan users 0 Apr 1 15:19 foobar -rw-r--r-- 1 dan users 0 Apr 1 15:19 foobaz
done archrelease $repo-${_arch} || abort done -- 1.7.4.2
On 2011/4/1 Dan McGee <dpmcgee@gmail.com> wrote:
WTF- so now we've gone back to the original two-upload? What are we doing here?
rsync -e ssh $rsyncopts --partial "${pkgfile}" "${sigfile}" "$server:staging/$repo/"
will work just fine.
If you specify the empty string as a rsync argument, it will take it as the current directory. So you have to drop the quotes, and I don't really feel like dropping the quotes here. Also using multiple arguments will break the pretty printing which is caused by the "echo -n Uploading..." above. But pretty printing is a bad reason. I don't have a better idea right now. -- Rémy.
On Fri, 1 Apr 2011 21:34:47 +0200, Rémy Oudompheng wrote:
On 2011/4/1 Dan McGee <dpmcgee@gmail.com> wrote:
WTF- so now we've gone back to the original two-upload? What are we doing here?
rsync -e ssh $rsyncopts --partial "${pkgfile}" "${sigfile}" "$server:staging/$repo/"
will work just fine.
If you specify the empty string as a rsync argument, it will take it as the current directory. So you have to drop the quotes, and I don't really feel like dropping the quotes here.
Also using multiple arguments will break the pretty printing which is caused by the "echo -n Uploading..." above. But pretty printing is a bad reason. I don't have a better idea right now.
If we are optimizing we should try to use one rsync call to upload all packages at once. If pretty printing is a show stopper here just remove it. -- Pierre Schmitz, https://users.archlinux.de/~pierre
On Fri, Apr 1, 2011 at 2:50 PM, Pierre Schmitz <pierre@archlinux.de> wrote:
On Fri, 1 Apr 2011 21:34:47 +0200, Rémy Oudompheng wrote:
On 2011/4/1 Dan McGee <dpmcgee@gmail.com> wrote:
WTF- so now we've gone back to the original two-upload? What are we doing here?
rsync -e ssh $rsyncopts --partial "${pkgfile}" "${sigfile}" "$server:staging/$repo/"
will work just fine.
If you specify the empty string as a rsync argument, it will take it as the current directory. So you have to drop the quotes, and I don't really feel like dropping the quotes here.
Also using multiple arguments will break the pretty printing which is caused by the "echo -n Uploading..." above. But pretty printing is a bad reason. I don't have a better idea right now.
If we are optimizing we should try to use one rsync call to upload all packages at once. If pretty printing is a show stopper here just remove it.
Doing this now...
participants (3)
-
Dan McGee
-
Pierre Schmitz
-
Rémy Oudompheng