cygport upload command?

2014-07-07 Thread Andrew Schulman
Using cygport, I think that packaging has become quite easy now.  At least,
once the cygport script is built and working, updating a package to a new
release is as easy as updating the version number in the cygport script,
then running 'cygport ... download all'.

Except for one thing: the upload step.  Maintainers still have to go
through the procedure at
https://sourceware.org/cygwin-apps/package-upload.html.  Although it's
easier than the old manual upload process, it's still a little tedious and
error-prone.

Yaakov, would you consider adding an 'upload' command to cygport, that
would handle the uploading details?  That would take away the last bit of
manual work in a routine package update.

If you don't have the time or interest to add an upload command yourself,
would you consider a patch?  I've spent some time looking through cygport
code, and I might have time to give it a try, or maybe someone else would.

Andrew


Re: cygport upload command?

2014-07-07 Thread Christopher Faylor
On Mon, Jul 07, 2014 at 09:14:29PM -0400, Andrew Schulman wrote:
Using cygport, I think that packaging has become quite easy now.  At least,
once the cygport script is built and working, updating a package to a new
release is as easy as updating the version number in the cygport script,
then running 'cygport ... download all'.

Except for one thing: the upload step.  Maintainers still have to go
through the procedure at
https://sourceware.org/cygwin-apps/package-upload.html.  Although it's
easier than the old manual upload process, it's still a little tedious and
error-prone.

Yaakov, would you consider adding an 'upload' command to cygport, that
would handle the uploading details?  That would take away the last bit of
manual work in a routine package update.

If you don't have the time or interest to add an upload command yourself,
would you consider a patch?  I've spent some time looking through cygport
code, and I might have time to give it a try, or maybe someone else would.

FWIW, this is the script that I use.  Obviously the path to the upload
directory would have to be changed.

cgf
#!/usr/bin/perl

use strict;
use Getopt::Long;

my $arch = 'all';
GetOptions('a|arch:s'=\$arch);

use constant {
FTP = '/usr/bin/lftp'
};

my @arch = ();
if ($arch eq 'all') {
@arch = ('x86', 'x86_64');
} else {
@arch = $arch;
}

my $exit = 0;
for $arch (@arch) {
# ftp -c 'connect sftp://cygwin:@cygwin.com/; cd x86/release; mirror -eRN2 
mutt; put /dev/null -o !ready'
chdir /netrel/uploads/$arch or die $0: couldn't cd to 
/netrel/uploads/$arch - $!\n;
for my $p (@ARGV) {
print Uploading $p($arch)...\n;
my $res = system FTP, '-c', connect sftp://cygwin:\@cygwin.com/; cd 
$arch/release; mirror -eR $p; put /dev/null -o !ready;
$exit ||= $res;
if (!$res) {
print done\n;
} else {
warn $0: $p upload failed\n if $res;
}
}
}
exit $exit;