dupload-2.7.0/0000755000000000000000000000000011557542710010045 5ustar dupload-2.7.0/TODO0000644000000000000000000000032711531305056010527 0ustar dupload to-do file ------------------ I hope to enhance the hook system to run Perl code as well as shell commands and to rewrite several dupload features, such as announcements, as hooks. -- Stephane Bortzmeyer dupload-2.7.0/dupload.conf.5pod0000644000000000000000000001511511531317063013206 0ustar =head1 NAME dupload.conf - configuration file for dupload =head1 DESCRIPTION The configuration file is rather straight forward Perl code as it's included by the B script via C. I Any B must begin with C because C is the namespace expected by B. For examples of the configuration please refer to the global configuration file F. It contains associative arrays, each indexed by the nickname (see B<--to> option of B), for the following items: =over 4 =item B [required] The fully qualified domain name (FQDN) of the nickname. =item B [optional] The transfer method. The available methods are: EftpE (which is the default), EscpE, EscpbE and ErsyncE (over SSH). If you are using an upload queue, use FTP because it's fast. If you are using an authenticated host, B use scp or rsync via SSH, because FTP transmits the password in clear text. For B and B to work properly, you have to setup the remote and local host to establish a ssh/slogin connection using F<.shosts/.rhosts> or the files in F<~/.ssh/>. If you don't want or can't do that, you may find the B more convenient since it uploads in batch, reducing the number of password prompts. The only major caveat of the rsync and scpb options is that the files are processed in a batch mode, i.e. not separately, so in case of an error B won't be able to detect which part of the transfer failed, and just delete the B<.upload> file completely. =item B [optional] The account name used to log into the FTP server. The default is EanonymousE, should work with firewall logins too. =item B [required] Incoming directory, the directory we try to upload to. =item B [optional] The directory we move the uploaded files to (after successful upload to I. Usually necessary only with some special upload queues. =item B [optional] Email address where the announcement about stable packages is sent. =item B [optional] Email address where the announcement about unstable and experimental packages is sent. =item B [optional] Email address where to send a copy address of the announcement. =item B [optional] Your full name, one that should appear in the announcement; If you leave this setting empty, the default will depend on your mail system. Usually the full name will be copied from the GCOS field in F. =item B [optional] Your username that should appear in the announcement. Defaults to C. =item B [optional] The host/domain name that appears as the part to the right of the B<@> character in the I-part of the announcement. Defaults to the value your local MTA likes. =item B [optional] Set the passive mode for FTP transfers. Since B uses Net::FTP, you can also use the environment variable FTP_PASSIVE. =item B [optional] String that will be added verbatim to the command line of any scp or rsync calls done. =item B [optional] Tells B that the remote host runs dinstall (or equivalent) so that B won't send a duplicate announcement mail. The default is 0 (false), set it to 1 to enable it. =item B [optional] Tells B that the remote host is a valid destination for packages with non-US in their Section field, so that B doesn't warn about it. The default is 0 (false), set it to 1 to enable it. =item B [optional] If set to 0 (false), adds a "X-No-Archive: yes" header in the announcement. The default is 1 (true). =back The configuration files also contain the following global variables: =over 4 =item B [optional] The default host to upload to. The default value of this variable is unset. =item B [optional] Prevents B to add parentheses around the full name when making mail announcements. Default is 0 (false), set it to 1 to enable it. =back =head1 HOOKS Hooks are a powerful way to add actions which will be run before or after a dupload (like the preinst and postinst script of B). You have two sort of hooks: pre-upload and post-upload. Both are simple shell commands (executed by C so you can use any shell tricks). Pre-uploads are always run (even in dry mode) and stop B if they fail (failure being mesured by the hook's exit status). Post-uploads are only run when you are not in dry mode and only if the uploading succeeded. Both sorts of hooks are run for a given category: changes, sourcepackage, package, file or deb. =over 4 =item changes This hook is run once per "changes" file (given as an argument to B) with the filename as its parameter. =item sourcepackage This hook is run once per "changes" file with the source package name and its version as its two parameters. =item package This hook is run once per binary package (a "deb" file) with the package name and its version as its two parameters. =item file This hook is run once per uploaded file, with the file name as its parameter. =item deb This hook is run once per binary package (a "deb" file) with the filename as its parameter. =back =head2 Syntax Hooks are defined in two Perl hashes, C<%preupload> and C<%postupload>, each indexed by category. In addition to the global hashes, each host entry has two fields with the same names, for the host-specific hooks. The shell command will be substituted first: %1 will be replace by the first argument, etc. =head2 Per-host or global hooks A hook can be global (for all the hosts) or it can be for a specific host. If there is no specific hook, for a given category, the global one is used. =head2 Examples This one runs B before uploading. It is global and guarantee that you will always upload lintian-free packages (thanks to B return status). $preupload{'deb'} = 'lintian -v -i %1'; This one just display the name and versions of successfully uploaded packages. $postupload{'package'} = 'echo PACKAGE %1 %2 uploaded'; Unlike the two others, this one is specific to one host, master. $cfg{master}{preupload}{'changes'} = "echo Uploading %1"; =head1 LOCATION The configuration is searched as following: /etc/dupload.conf ~/.dupload.conf The latest entries override the former. =head1 ENVIRONMENT VARIABLES Those of Net::FTP for the FTP method: FTP_FIREWALL FTP_PASSIVE =head1 AUTHOR Heiko Schlittermann Stephane Bortzmeyer dupload-2.7.0/CREDITS0000644000000000000000000000037711531305056011064 0ustar Heiko Schlittermann wrote it and maintained it during the heroic times. Julian Gilbey made many patches and code cleanings. Brian Almeida made the code to automatically detect changelog 1.6. dupload-2.7.0/dupload.conf0000644000000000000000000001066511557542710012354 0ustar # This is the configuration for dupload. # It is intended to be read and evaluated from Perl. # ### PLEASE READ THE dupload.conf(5) MANUAL PAGE # # reading the dupload(1) manual page is also advisable package config; # Global variables: # $default_host - the host to use if no --to option is used # $no_parentheses_to_fullname - boolean, as its name says # # Per-host variables: # fqdn - full hostname # method - ftp, scp, scpb or rsync # (defaults to ftp) # login - user name to use on the remote host # (defaults to 'anonymous' for FTP and local username for SSH methods) # use "user\@remote" for firewall logins # incoming - directory where to upload first # queuedir - directory where to move if upload succeeded # mailto - address for announcement email (stable) # mailtx - address for announcement email (unstable) # cc - address for carbon copy of the announcement email # fullname - the full name to use in the announcement email # (defaults to what your local MTA uses) # visibleuser - the username to use in the announcement email # (defaults to local username) # visiblename - the domainname to use in the announcement email # (defaults to what your local MTA uses) # Example of a default host: #$default_host = "anonymous-ftp-master"; $default_host = "ubuntu"; # ----------------- # Pre-defined hooks # ----------------- # Check changes file for valid signatures # Using GPG: $preupload{'changes'} = '/usr/share/dupload/gpg-check %1'; # or using PGP: # $preupload{'changes'} = '/usr/share/dupload/pgp-check %1'; # Lintian check of packages # $preupload{'deb'} = 'lintian -v -i %1'; # Other hooks: # $preupload{'sourcepackage'} # $preupload{'file'} # $preupload{'package'} # $postupload{'changes'} # $postupload{'sourcepackage'} # $postupload{'file'} # $postupload{'deb'} # $postupload{'package'} # Note: hooks can also be defined in a per-host basis, this # overrides globaly defined hooks. # ----------------- # Pre-defined hosts # ----------------- $cfg{'ubuntu'} = { fqdn => "upload.ubuntu.com", incoming => "/", dinstall_runs => 1, }; $cfg{'ftp-master'} = { fqdn => "ssh.upload.debian.org", method => "scpb", incoming => "/srv/upload.debian.org/UploadQueue/", # files pass on to dinstall on ftp-master which sends emails itself dinstall_runs => 1, }; $cfg{'anonymous-ftp-master'} = { fqdn => "ftp.upload.debian.org", incoming => "/pub/UploadQueue/", # The dinstall on ftp-master sends emails itself dinstall_runs => 1, }; # see http://backports.debian.org/Contribute/ for more information $cfg{'bpo'} = { fqdn => "backports-master.debian.org", incoming => "/pub/UploadQueue/", dinstall_runs => 1, }; # see http://www.debian.org/devel/debian-volatile/ for more information $cfg{'volatile'} = { fqdn => "volatile-master.debian.org", incoming => "/pub/UploadQueue/", # files pass on to dinstall on ftp-master which sends emails itself dinstall_runs => 1, passive => 1, }; # For Delayed uploads use this. You can use 0-day, which is uploaded # one hour before dinstall runs. $delay = (defined($ENV{DEBDELAY}) ? $ENV{DEBDELAY} : 7); $cfg{'delayed'} = { fqdn => "ftp.upload.debian.org", incoming => "/pub/UploadQueue/DELAYED/$delay-day/", # The dinstall on ftp-master sends emails itself dinstall_runs => 1, }; # Mentors upload queue, see # http://mentors.debian.net/cgi-bin/maintainer-intro $cfg{'mentors'} = { fqdn =>'mentors.debian.net', incoming=>'/', dinstall_runs => 1, passive => 1, }; # NOTE: Do _NOT_ upload a package to the security upload queue # (oldstable-security, stable-security, etc.) without prior authorization # from the security team. Please read: # http://www.debian.org/doc/developers-reference/pkgs.html#bug-security # Notice: There are login restriction on this host, scp will not # work unless you are authorised. #$cfg{'security'} = { # fqdn => "security-master.debian.org", # method => "scpb", # incoming => "/org/security.debian.org/queue/unchecked", # # The dinstall on security sends emails itself # dinstall_runs => 1, # nonus => 1, #}; #$cfg{'anonymous-security'} = { # fqdn => "security-master.debian.org", # incoming => "/pub/SecurityUploadQueue", # # files pass on to dinstall on security which sends emails itself # dinstall_runs => 1, # nonus => 1, #}; # Don't remove the following line. Perl needs it. 1; ## Local Variables: ## ## mode:perl ## ## End: ## dupload-2.7.0/debian/0000755000000000000000000000000011557543031011264 5ustar dupload-2.7.0/debian/bash-completion0000644000000000000000000000162511531315306014271 0ustar # Debian GNU/Linux dupload(1) completion # Original file: # Debian GNU/Linux dput(1) completion # Copyright 2002 Roland Mas # Modified for dupload(1) # Paul Evans have dupload && _dupload() { local cur prev options paroptions special i delayed_options hosts COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} options='-c --configfile -d --debug -f --force -k --keep --no --nomail \ --mailonly --noarchive -p --print -q --quiet -t --to -V -Version' case $prev in --config|-c) COMPREPLY=( $( compgen -o filenames -G "$cur*" ) ) ;; *) COMPREPLY=( $( compgen -G "${cur}*.changes" compgen -G "${cur}*.asc" compgen -G "${cur}*.sig" compgen -W "$options" | grep "^$cur" ) ) ;; esac return 0 } [ "$have" ] && complete -F _dupload -o filenames dupload dupload-2.7.0/debian/rules0000755000000000000000000000025111531315306012334 0ustar #!/usr/bin/make -f %: dh --with=bash-completion $@ override_dh_auto_build: $(MAKE) prefix=/usr override_dh_auto_install: $(MAKE) prefix=debian/dupload/usr install dupload-2.7.0/debian/dirs0000644000000000000000000000000411531315227012136 0ustar etc dupload-2.7.0/debian/changelog0000644000000000000000000005452411557542710013153 0ustar dupload (2.7.0ubuntu1) oneiric; urgency=low * Merge from debian unstable (LP: #775565), remaining changes: - Add upload.ubuntu.com to the list of upload hosts - Make ubuntu the default upload host -- Lorenzo De Liso Mon, 02 May 2011 15:05:29 +0200 dupload (2.7.0) unstable; urgency=low * Bump Standards-Version to 3.9.1 (no changes) * Convert debian/rules to use dh * Update config for backports uploads. (Closes: #595734, #595737) * Add bash-completion support, thanks to Paul Evans. (Closes: #514774) * Fix broken link in dupload.conf for security upload documentation, thanks to Niko Tyni. (Closes: #507249) * Document "options" host option. (Closes: #604014) -- Frank Lichtenheld Thu, 24 Feb 2011 01:02:00 +0100 dupload (2.6.6ubuntu1) jaunty; urgency=low * Merge from Debian unstable, remaining changes: - Add upload.ubuntu.com to the list of upload hosts. - Make ubuntu the default upload host. -- Steve Langasek Fri, 05 Dec 2008 09:04:34 +0000 dupload (2.6.6) unstable; urgency=low * Update definitions for ftp-master, anonymous-ftp-master and delayed to use ssh.upload.debian.org and ftp.upload.debian.org. (Closes: #499637) -- Frank Lichtenheld Sun, 21 Sep 2008 18:24:34 +0200 dupload (2.6.5) unstable; urgency=low * Update definition of DELAYED queue to use ssh-delayed.upload.debian.org. * Bump Standards-Version to 3.8.0 (no changes). * Drop versioning from Perl dependency, even bo fulfilled it. -- Frank Lichtenheld Fri, 12 Sep 2008 04:35:31 +0200 dupload (2.6.4ubuntu3) hardy; urgency=low * Resynchronise with Debian (unfortunate version number is due to past versioning mistakes). Remaining changes: - Add upload.ubuntu.com to the list of upload hosts. - Make ubuntu the default upload host. -- Colin Watson Wed, 31 Oct 2007 17:50:40 -0400 dupload (2.6.4) unstable; urgency=low * Add myself to Uploaders with Josip's approval + acknowledge NMUs * Make a few clean-ups I refrained from in the NMUs: + Increase debhelper compat level to 5 + Add some missing dh_* calls (md5sums and installman) + Use dh_install and dh_link instead of install and ln + Bump Standards-Version to 3.7.3 (no changes) -- Frank Lichtenheld Fri, 02 May 2008 13:43:03 +0200 dupload (2.6.3.4) unstable; urgency=low * Non-maintainer upload (Closes: #477220) * Update mentors.debian.net configuration. Patch by Charles Plessy. (Closes: #226101) * Add volatile configuration. (Closes: #420693) * Add backports.org configuration. * Abort upload if distribution is UNRELEASED. (Closes: #384703) (also remove support for "frozen") * Add support for parsing and testing new checksums-* fields. dupload will not complain if the fields are absent. (Closes: #473518) * Check file sizes, too. (Closes: #360161) -- Frank Lichtenheld Fri, 25 Apr 2008 23:51:29 +0200 dupload (2.6.3.3) unstable; urgency=low * NMU (with maintainers consent) (Closes: #398135) * Recommend openssh-client instead of ssh, keep ssh as alternative for now. Reported by Aaron Schrab (Closes: #387678) * Setting $default_host from a local dupload.conf is now possible again. Reported by martin f krafft (Closes: #249341) * Add empty binary-arch target in debian/rules. Reported by Aurelien Jarno (Closes: #395593) * Treat DEBDELAY=0 correctly. Patch by Matej Vela (Closes: #356780) * Fix headers of man pages. Reported by Denis Barbier (Closes: #222934) * Update location of security upload queues. Reported by adrian (Closes: #345078) * Fix move of files to the queuedir. Patch by Bob Proulx (Closes: #279308) * Remove build-stamp in debian/rules' clean target -- Frank Lichtenheld Sat, 11 Nov 2006 21:17:38 +0100 dupload (2.6.3.2) unstable; urgency=low * NMU during BSP. * Try to differentiate between different gpg --verify error reasons to allow uploads from hosts where the public key is not available. (Closes: #321126) -- Frank Lichtenheld Sat, 6 Aug 2005 20:14:23 +0200 dupload (2.6.3.1) unstable; urgency=low * NMU to remove obsolete queues, based on http://www.debian.org/doc/developers-reference/ch-pkgs.en.html and http://lists.debian.org/debian-devel/2004/debian-devel-200401/msg01950.html> also cleaned up the bug list. * Removed non-functioning upload queues: anonymous-non-us, non-us, chiark, erlangen, uk, jp, and samosa. (Closes: #222938, #229744) * Added notes extracted from the Developer's reference regarding uploads to security and commented out these entries to prevent developers from uploading there unintentionally. (Closes: #251286) * Added a default configuration for uploading to mentors.debian.net (Closes: #226101) * Changed default (commented) upload queue to be anonymous-ftp-master * Use Goswin's patch to add an 'options' field in the configuration file which can be used to setup --progress and -L in rsync calls, or additional options to SSH if needed (Closes: #98949, #319910, #225400) * Check the .changes signature using gpg or pgp (if available) in order to prevent unsigned uploads. This is active by default for GPG but can be disabled in dupload.conf at will. Also, added two new simple scripts gpg-check and pgp-check to provide a wrapper to the check so that the error message in case of a failure is more user-friendly. I've implemented this as hooks rather than as new code in dupload to allow users to customise as needed. Note: DSC files are not checked since that should be done in a separate hook (and there is none for those files). (Closes: #54344, #56877, #65630, #101882) * Related to the above add references to the preupload/postupload hooks in the dupload.conf file. -- Javier Fernandez-Sanguino Pen~a Tue, 26 Jul 2005 23:45:04 +0200 dupload (2.6.4ubuntu2) feisty; urgency=low * debian/control: Update maintainer fields according to debian- maintainer-field spec. -- Martin Pitt Thu, 22 Feb 2007 13:29:28 +0000 dupload (2.6.4ubuntu1) breezy; urgency=low * added upload.ubuntu.com to the list of upload hosts * made ubuntu the default upload host -- Oliver Grawert (ogra) Tue, 24 May 2005 12:31:26 +0200 dupload (2.6.3) unstable; urgency=medium * Fixed package build directory to actually include the contents in the .deb (d'oh!), closes: #212093. -- Josip Rodin Mon, 22 Sep 2003 11:39:54 +0200 dupload (2.6.2) unstable; urgency=low * Added security.debian.org:/org/security.debian.org/queue/unchecked to the config file. * Properly detects Changes and Files multi-line tags, thanks to Matthias Urlichs, closes: #195903. * Added testing to the list of accepted distributions because of mini-dinstall, by request of Bruno Rodrigues, closes: #179711. * Added the delayed upload stuff from the Developer's Reference to the config file, but renamed the DELAY variable to DEBDELAY to cause less namespace pollution, closes: #146840. -- Josip Rodin Tue, 16 Sep 2003 12:40:59 +0200 dupload (2.6.1) unstable; urgency=low * Ignore uploads to security.debian.org in the non-US sanity check, and introduce a "nonus" flag for hosts to be able to force this, closes: #164320. -- Josip Rodin Fri, 11 Oct 2002 20:37:07 +0200 dupload (2.6) unstable; urgency=low * Added libnet-perl into Build-Depends, closes: #147530. * Added back the $mailto || $mailtx warning. * Added the non-US sanity check, closes: #103525. -- Josip Rodin Thu, 11 Apr 2002 21:02:39 +0200 dupload (2.5) unstable; urgency=high * New maintainer, closes: #141847, #55691, #55752. * Reduced priority of the mail stuff because it's no longer used by default, closes: #109260. dupload will now just warn (or be quiet) about the lack of /usr/sbin/sendmail. * Remove the .upload file when a batch method fails, which really closes: #44624. * No longer displays the statistics if they weren't calculated, closes: #57868. * Fixed .changes file check to ignore regexps, closes: #69383. * Check if the configuration file has any contents before trying to load it, closes: #86120. * Renamed Build-Depends into Build-Depends-Indep, closes: #92168. * Replaced the note in the configuration file to explain the situation with master.debian.org, closes: #112822. I'd rather not warn, because if someone really wants to use it still they'll get spurious warnings. * Removed giano from the configuration file, closes: #122777. * Use the host FQDN instead of the host nickname in .upload files, closes: #133286. * Proofreading in the manual pages. Ugh! * Removed a bunch of implied stuff from the default configuration file. Removed mention of debian*-changes mailing lists because we no longer want/allow dupload mails to them. Added anonymous-ftp-master host definition. * Polishing in the packaging. * Removed fucked up makefile commands that overwrote my dupload with the contents of dupload.pl for no actual practical purpose. Fuck. * Removed checking of the Format: field in the changes file for >= 1.6, since the fact dinstall's mails started somewhere at about the same time is not really related. Simply respect the $dinstall_runs variable which is set for all the default Debian hosts in the configuration file. -- Josip Rodin Wed, 10 Apr 2002 18:01:26 +0200 dupload (2.4.3) frozen unstable; urgency=high * No longer reads (by default) a configuration file in the current directory. Although not formally reported as a bug, it is a serious security hole. -- Stephane Bortzmeyer Fri, 13 Apr 2001 20:37:47 +0200 dupload (2.4.2) frozen unstable; urgency=low * New configuration file (ftp-master, anonymous non-US). Closes: #63809, #64003, #92418, #78829 * Small documentation bug about ssh. Closes: #63660 * Build dependencies. Closes: #70279 -- Stephane Bortzmeyer Tue, 10 Apr 2001 20:47:05 +0200 dupload (2.4.1) frozen unstable; urgency=low * Non-maintainer upload. * Lintian clean. * Ported to debhelper. * FHS 2.1 compliant * Upgraded standards version. * Added support for rsync, modeled after scpb. Patch from Adam Heath * Fixed typo in warning message. Closes: #48812. * Don't upload files that have already been uploaded when processing multiple .changes. Closes: #53273. * Don't log a successful upload for scpb/rsync until the upload has finished. Closes: #44624, #48577. * When cc'ing, display the address that the email is cc'd to. Closes: #52840. * Only wishlist bugs now remain on dupload. :) -- Adam Heath Wed, 19 Jan 2000 22:52:27 -0600 dupload (2.4) unstable; urgency=low * Patch (both from Joey Hess and myself) to fix hooks. Hooks are now seriously tested. Closes: #43644 * $dinstall_runs is now set for every host which transfers to master. Closes #43722. * The fact that the "scpb" method is the recommened one is now clear in dupload(1). Closes #42342. -- Stephane Bortzmeyer Mon, 30 Aug 1999 12:46:56 +0200 dupload (2.3) unstable; urgency=low * --help option. Closes #39901 * An entry for non-us. Closes #39707 * Complies with the new Perl policy. Closes #40563 -- Stephane Bortzmeyer Wed, 7 Jul 1999 14:17:15 +0200 dupload (2.2) unstable; urgency=low * A completely new system to run pre and post-upload scripts: hooks. Now, you can run any shell command before uploading (uploading will be cancelled if they fail) and after successful uploading. See dupload.conf(5). Closes #34883 and, I hope, almost all the future wishlists "Can you add such and such in dupload" :-) * Small improvment to the automatic changelog detection code. Closes #39072 * Several cleanings of the source code and dependencies, thanks to Julian Gilbey * New upload queue samosa.debian.org. Closes #38838 -- Stephane Bortzmeyer Thu, 3 Jun 1999 11:26:03 +0200 dupload (2.1) unstable; urgency=low * Recognizes the new (1.6) changelog format and, if used and if the per-host variable dinstall_runs is set, do not send mail uselessly. Patch by Brian Almeida . Closes #35308 * Implements --quiet. Patch by Julian Gilbey * Adds a new line to the .upload file to record successful uploading. Patch by Julian Gilbey . Closes #34209 * New global configuration variable default_host. --to is no longer mandatory. Closes #34208 and probably #31684 by a side-effect. * New option --mailonly for unconditionnal announcements. Closes #31616 * Allows a new global configuration variable to suppress parentheses around full names. Closes #16685 * ssh no longer requires X forwarding. Closes #38061 * dupload(5) -> dupload.conf(5) and updated. Closes #35643 * Fatal error handling rewritten: util.pm suppressed but it is not a complete return to pre-2.0: fatal() now uses caller() instead of croaking (patch by Julian Gilbey ). Closes #35626 and #35625 by a side-effect. * Properly documents the extra 'announce' files. Closes #26685 * Japanese upload queue added. Closes #37803 * Mode-optimization for ssh (do not remote-chmod if the mode is already correct) now works also for the 'scpb' method. Allows to close #13243, longest dupload bug ever, 604 days old. * Announcements are sent according to the Debian Developer's Reference and documented as such (there is nothing in the Policy Manual about announcements). Closes #37521 * New way to set the passive mode. Should close #36087 * Copyright updated (again, pre-2.0 souvenirs). Closes #35603 * Moved to subsection 'devel'. Closes #35602 * Various typos fixed, as well as errors in the documentation (mostly pre-2.0 souvenirs). Closes #35518 -- Stephane Bortzmeyer Thu, 20 May 1999 09:23:58 +0200 dupload (2.0) unstable; urgency=low * New dependencies: recommends a mail-transport-agent (the announcement is really important) and suggests lintian (see #34883). * When using SSH, do not chmod on the remote host if the local mode is already 0644. Half-closes #13243. * Patch from Chris Waters to prevent emacs from showing password. Closes #34248. * scpb method documented. * --nomail now works according to the documentation (running dupload again sends the announce). Closes #31616, #32977. * New configuration file options, "archive" (the announcement) and "passive" (for FTP). * Do not ask for password when doing a dry run. Closes #31597 * Routines that croak() are now in a separate package, to avoid displaying the stack, with its passwords. Thanks to Guy Decoux . Closes #10003 * New dupload.conf. Closes #34943 * Now uses Net::FTP module instead of a custom FTP module. And depends on libnet-perl. Uses better error messages. Closes #28283, #7541, #33437 -- Stephane Bortzmeyer Thu, 25 Mar 1999 15:47:39 +0100 d dupload (1.17) unstable; urgency=low * Ability to add a "X-No-Archive: yes" header. Closes #33896 * Now does correct computations on kilobytes. Closes #31955 * Default method for master is now scp/ssh. Closes #16241 * New (undocumented) method "scpb" by Guy Maor . Closes #13383 * Do not display all parameters (including password) when failing to log in. Closes #31216 * Cc: now works. Closes #19034 * Accept quotes in full names. Closes #13120 * New maintainer. -- Stephane Bortzmeyer Sat, 27 Feb 1999 21:44:13 +0100 dupload (1.16.4) frozen unstable; urgency=low * Non-maintainer upload * Added dupload.conf entry for ftp://ftp3.linux.it/pub/Linux/UploadQueue/ * Made appropriate /usr/doc/dupload/copyright file, which fixes #14390, #24699, #29766. * Fixed the section/priority according to the overriding Packages file * Suggests: mail-transport-agent (because of the announcing feature) -- Josip Rodin Mon, 11 Jan 1999 00:22:13 +0100 dupload (1.16.3) unstable; urgency=low * Non-maintainer upload * Implemented the --nomail option. Closes #18512 -- Stephane Bortzmeyer Tue, 5 Jan 1999 10:10:51 +0100 dupload (1.16.2) frozen unstable; urgency=medium * Non-maintainer release. * Fix brokenness in last NMU using patch from Martin Bialasinski posted to debian-devel. * Add patch from Bug#23927 (sends mail for frozen-only uploads). * Use scp -q, as scp's progress display does not mesh nicely with dupload's output. -- Joel Klecker Sun, 20 Dec 1998 05:38:45 -0800 dupload (1.16.1) frozen unstable; urgency=low * Non-maintainer upload * Fix logic error in uploading using FTP (Bug# 30202) -- Wichert Akkerman Fri, 18 Dec 1998 16:13:35 +0100 dupload (1.16) unstable; urgency=low * small enhancement from Rob Browning for dry run and sendmail command * read local config files too (should fix bug #7539 * upload queue in erlangen (germany) added * handle odd characters in package names (1st try) -- Heiko Schlittermann Fri, 29 Aug 1997 22:27:35 +0200 dupload (1.15) stable unstable; urgency=low * fixed bug regarding ``+'' in package names (#????) * Updated man page to real life: visiblename (!) is the real name of the ``visibledomain'' config directive. (#????) * Option for suppressing mail added (#7771) * Point to global config as example for local config (#8826). -- Heiko Schlittermann Wed, 25 Jun 1997 21:32:06 +0200 dupload (1.14) stable unstable; urgency=low * copyright refers no to /usr/doc/copyright (bug #7199) * don't assume the uploading person as lazy any longer (bugs #6397, #6620) * when uploaded a package via scp, a `ssh chmod 0644' is done to (bug #7166) * put it into stable -- Heiko Schlittermann Thu, 13 Feb 1997 09:09:05 +0100 dupload (1.12) unstable; urgency=low * set visible name and domain in the announcement mail (as a way to work around the anti spamming of the list processor if you send your announcements from several hosts) -- Heiko Schlittermann Wed, 27 Nov 1996 12:33:38 +0100 dupload (1.11) unstable; urgency=low * Option -p will print the nick name too * exit code according do success or failure * announcement according to policy (is `frozen' a valid distribution code?) * changed distribution to unstable -- Heiko Schlittermann Wed, 27 Nov 1996 06:53:09 +0100 dupload (1.10) experimental; urgency=low * temporary fix for perl-5.003 -- Heiko Schlittermann Mon, 4 Nov 1996 08:37:52 +0100 dupload (1.9) experimental; urgency=low * stylistic changes in man pages * 1kB == 1000 B -- Heiko Schlittermann Thu, 24 Oct 1996 21:42:45 +0200 dupload (1.8) experimental; urgency=low * scp is supported now * address of chiark matches changed reality again * avoid duplicate announcements * extra announcement file name had typo * now looking for following extra files - package.announce - package_version.announce - package_version-debian.announce and prepend 'em in that order to the announcement (.changes) NOTE: text before the pgp-signed part of a message is not shown in some MUAs (elm). * suppressing the stars while entering a password * non-echo mode is entered before issuing the password prompt (should cure the problem that the password is shown on heavily loaded machines) -- Heiko Schlittermann Sat, 5 Oct 1996 23:36:59 +0200 dupload (1.7) experimental; urgency=low * include `X-dupload: version' in mail header * niced the manual pages (due to eric) * --Version option * better detecting of non-changes files * if a file was uploaded to host A, dupload refused an upload to host B -- Heiko Schlittermann Wed, 18 Sep 1996 10:26:06 +0200 dupload (1.6) experimental; urgency=medium * didn't respected already done uploads -- Heiko Schlittermann Sat, 14 Sep 1996 01:06:39 +0200 dupload (1.5) experimental; urgency=high * announced always to mailto and mailtx * prepend $package-$version.announce, if exists, to the announcement -- Heiko Schlittermann Fri, 13 Sep 1996 21:35:00 +0200 dupload (1.4) experimental; urgency=high * we should upload the .changes file too * in ftp modules: output unbuffered if $ftp_show * hmm, back the arch in announcements subject (so we have different subjects for different binaries) * option --keep to skip broken packages (instead of bailing out) * md5sums should be compared with `eq' rather then `==' -- Heiko Schlittermann Fri, 13 Sep 1996 21:35:00 +0200 dupload (1.3) experimental; urgency=low * login/password support (due to Dominik) * support for master.debian.org (due to Yves) * hash marks while uploading * new config file format * firewall aware (I hope) (due to Dominik) * default host not supported any longer * now stripping of the architecture from the *.upload file and from the announcements subject (due to Yves) * --force option to ignore contents of *.upload file * not taking the architecture from the changes file name into the jobname and announcement (due to Yves) * log the announcement too -- Heiko Schlittermann Thu, 12 Sep 1996 23:44:04 +0200 dupload (1.2) experimental; urgency=medium * silly bug prevented it from sending the announcement -- Heiko Schlittermann Thu, 12 Sep 1996 17:44:04 +0200 dupload (1.1) experimental; urgency=low * configuration files /etc/dupload.conf, ~/.dupload, ./dupload.conf * option -n for dry run -- Heiko Schlittermann Thu, 12 Sep 1996 11:15:22 +0200 dupload (1.0-1) experimental; urgency=low * initial release -- Heiko Schlittermann Wed, 11 Sep 1996 13:28:10 +0200 dupload-2.7.0/debian/copyright0000644000000000000000000000123111531305056013207 0ustar This is dupload, utility to upload debian packages, made and formerly maintained by Heiko Schlittermann. It was previously maintained by Stephane Bortzmeyer. Current maintainer is Josip Rodin . The latest source can always be found at the mirrors of: http://http.us.debian.org/debian/pool/main/d/dupload/ Copyright (C) 1996, 1997 Heiko Schlittermann Copyright (C) 1999 Stephane Bortzmeyer dupload is free software; see the GNU General Public Licence version 2 or later for copying conditions. There is no warranty. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. dupload-2.7.0/debian/source/0000755000000000000000000000000011531315227012560 5ustar dupload-2.7.0/debian/source/format0000644000000000000000000000001511531315227013767 0ustar 3.0 (native) dupload-2.7.0/debian/install0000644000000000000000000000002211531315227012643 0ustar dupload.conf etc/ dupload-2.7.0/debian/compat0000644000000000000000000000000211531305056012455 0ustar 5 dupload-2.7.0/debian/control0000644000000000000000000000147611557542710012702 0ustar Source: dupload Section: devel Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Josip Rodin Uploaders: Frank Lichtenheld Standards-Version: 3.9.1 Build-Depends: debhelper (>= 7.0.50~), bash-completion Build-Depends-Indep: perl, libnet-perl Package: dupload Architecture: all Depends: ${perl:Depends}, libnet-perl, ${misc:Depends} Recommends: openssh-client | ssh Suggests: lintian, mail-transport-agent Description: utility to upload Debian packages dupload will automagically upload Debian packages to a remote host with a Debian upload queue. The default host is configurable, along with the upload method and a lot of other things. All uploads are logged. . It's intended only for Debian package maintainers. dupload-2.7.0/debian/links0000644000000000000000000000010511531315227012317 0ustar usr/share/man/man5/dupload.conf.5.gz usr/share/man/man5/dupload.5.gz dupload-2.7.0/debian/docs0000644000000000000000000000001511531315227012127 0ustar CREDITS TODO dupload-2.7.0/Makefile0000644000000000000000000000244111531310165011473 0ustar # Makefile for dupload # Copyright (C) 1996 Heiko Schlittermann # Copyright (C) 2002 Josip Rodin version = $(shell LC_ALL=C dpkg-parsechangelog|grep '^Version'|sed 's/^.*:[ \t]*//') MAN1 = dupload.1 MAN5 = dupload.conf.5 MAN = $(MAN1) $(MAN5) EXTRA_FILES = gpg-check pgp-check prefix = /usr/local confdir = /etc bindir = $(prefix)/bin mandir = $(prefix)/share/man man1dir = $(mandir)/man1 man5dir = $(mandir)/man5 extradir = $(prefix)/share/dupload INSTALL = install POD2MAN = pod2man mkdirhier = $(INSTALL) -d inst_script = $(INSTALL) -m 755 inst_lib = $(INSTALL) -m 644 inst_data = $(INSTALL) -m 644 all: dupload $(MAN) install: all $(mkdirhier) $(bindir) $(man1dir) $(man5dir) $(extradir) $(inst_script) dupload $(bindir) $(inst_data) $(MAN1) $(man1dir) $(inst_data) $(MAN5) $(man5dir) $(inst_script) $(EXTRA_FILES) $(extradir) @echo; echo "** You should install dupload.conf to $(confdir)"; echo clean: rm -f core *.[0-9]pod.* *~ $(MAN) .PHONY: dupload dupload: perl -c $@ perl -c dupload.conf %: %pod $(POD2MAN) \ --section=$(subst .,,$(suffix $@)) \ --name=$$(echo $(basename $@) | perl -pe '$$_=uc') \ --center="Debian Project" \ --date="`LC_ALL=C date '+%B %Y'`" \ --release="dupload $(version)" \ $< >,$@ && mv -f ,$@ $@; \ rm -f ,$@ .PHONY: all install clean dupload-2.7.0/dupload.1pod0000644000000000000000000001372511531305056012262 0ustar =head1 NAME dupload - utility to upload Debian packages =head1 SYNOPSIS B [I] [I | I] ... =head1 DESCRIPTION B is a tool that enables Debian developers to easily upload their packages to the Debian archive. At least for chiark the upload procedure is somewhat error prone (upload to Incoming/, move it to queue/). B checks each non-option argument to find readable files or directories. It parses the files as F<.changes> files, or tries to find such files in the given directories. B will warn if the name of the file doesn't end with E.changesE. Further processing is done chdir'ed into the directories of the changes files. B tests the available checksums and size for each file listed in the F<.changes> file, and fails if it finds a mismatch. If all this goes well, B checks if there is an F<.upload> file with the basename of the F<.changes> file. If the file to be uploaded is recorded to have already been uploaded to the specified host, it is skipped. B will stop and verify if it sees you try to upload a package with a non-US Section field to a host that is neither non-us.debian.org, security.debian.org nor has the "nonus" option set to 1. After the list of files to upload is finished, B tries to connect to the server and upload. Each successfully uploaded file is recorded in the F<.upload> log file. If all files of a package are processed, the .changes file is mailed to the announcement address specified in the configuration file. If files with Z<> F.announce, F.announce, or Z<> F.announce exist, these files get prepended to the announcement. UPSTREAMVER and DEBIANREV are to be replaced with actual version numbers. For example, if your package is called B, has upstream version 3.14, and Debian revision 2: If you only want the announcement to be made with only ONE upload, you name it foobar_3.14-2.announce. If you want it to be made with every upload of a particular upstream version, name it foobar_3.14.announce. If you want it made with B upload of a given package, name it foobar.announce. B Some mail readers (like elm w/ PGP extensions) don't show mail contents outside of the signed part of a message. =head2 Login and password If no login (username) is defined in the configuration file, EanonymousE is used. The password is derived from your login name and your hostname, which is common for anonymous FTP logins. For anonymous logins only, you can provide the "password" in the configuration file. For logins other than EanonymousE, you're asked for the password. For security reasons there's no way to supply it via the commandline or the environment. =head2 FTP / scp / rsync The default transfer method is FTP. Alternative methods are scp/SSH and rsync/SSH. For scp and rsync, the default login is taken from your local user name. The scp/SSH method only works properly if no password is required (see B(1)). When you use scp, it is recommended to set the "method" keyword to "scpb", which will transfer all files in a batch. If you are using an upload queue, use FTP because it's fast. If you are using an authenticated host, B use scp or rsync via SSH, because FTP transmits the password in clear text. =head1 OPTIONS =over 12 =item B<-d> B<--debug> [I] Enable more verbose output from the FTP module. =item B<-f> B<--force> Upload regardless of the transfers logged as already completed. =item B<-k> B<--keep> Keep going, skipping packages whose checksums don't match. =item B<-c> B<--configfile> Read the file ./dupload.conf (if it exists). B: this is a security risk if you are in a directory where other people can write. That's why it is not the default (unlike the previous versions). =item B<--no> Dry run, no files are changed, no upload is attempted, only tell what we would do. =item B<--nomail> Supress announcement for this run. You can send it later by just calling dupload again w/o this option. Note that this option is by default implied for all hosts with the "dinstall_runs" option set to 1. =item B<--mailonly> Acts as if B<--no> has been specified and but sends the announcements, unconditionally. =item B<--noarchive> Adds a "X-No-Archive: yes" header so that the announcement will not be archived. You can use the per-host "archive" option in the configuration file. =item B<-p> B<--print> Print the EdatabaseE as read from the config files and exit. If a host is specified via option B<--to>, only this host's entry is displayed. =item B<-q> B<--quiet> Be quiet, i.e. supress normal output. =item B<-t> B<--to> I B Upload to I'd host. I is the key for doing lookups in the config file. You can use the "default_host" configuration option to specify a host without B<--to>. =item B<-V> B<--Version> Prints version and exits. =back =head1 FILES =head2 Configuration The configuration files are searched as follows (and read in this order, overriding each other): /etc/dupload.conf ~/.dupload.conf =head2 Other Various Debian package files are used by B: .dsc, .changes, .deb, Z<>.orig.tar.gz, .diff.gz B itself writes the log file I.upload, and the additional announcement files I, I, and I. =head2 Announcement addresses By default, the announcement addresses are unset because dinstall sends mails instead. =head1 BUGS B is tested on B systems only. It shouldn't require too much effort to make it run under others systems, though, it's written in Perl. =head1 AUTHOR/COPYRIGHT Copyright 1996 Heiko Schlittermann, 1999 Stephane Bortzmeyer B is free software; see the GNU General Public Licence version 2 or later for copying conditions. There is B warranty. =head1 SEE ALSO B(5) dupload-2.7.0/gpg-check0000644000000000000000000000134111531305056011607 0ustar #!/bin/sh # Verify that a changes has been signed and that the signatures are good # (using GPG) FILE=$1 # If no gpg is found just exit [ ! -x "`which gpg`" ] && exit 0 # If the file is not found just exit with error [ ! -r "$FILE" ] && exit 2 echo -n Checking signatures before upload... # Use the exit status to determine if the signature is ok or not gpg --verify "$FILE" >/dev/null 2>&1 ret=$? if [ $ret -eq 1 ]; then echo "GPG verification of $FILE failed!" exit 1 elif [ $ret -eq 2 ]; then if grep -- '-----BEGIN PGP' "$FILE" >/dev/null 2>&1; then echo "GPG signature couldn't be checked, probably because of missing key" exit 0 else echo "GPG signature is missing" exit 1 fi fi echo ...signatures are ok exit 0 dupload-2.7.0/dupload0000755000000000000000000006251511531305056011424 0ustar #! /usr/bin/perl # # dupload - utility to upload Debian packages # # Copyright (C) 1996, 1997 Heiko Schlittermann # Copyright (C) 1999 Stephane Bortzmeyer # Licensed under the GNU GPL v2. # # see dupload(1) for help. #BEGIN { # $ENV{PERL_INC} # for my tests only # and unshift @INC, $ENV{PERL_INC}; # unshift @INC, ""; #} use strict; use 5.003; # Because of the prototypes use Cwd; use Getopt::Long; use File::Basename; use Net::FTP; use English; # more or less configurable constants my $version = "2.6"; my $progname = basename($0); my $user = getlogin() || $ENV{LOGNAME} || $ENV{USER}; my $myhost = `hostname --fqdn`; chomp $myhost; my $cwd = cwd(); my $debug = 0; # for somewhat more verbose output from the ftp module my $force = 0; # do it, even when already done my $keep = 0; # keep going, even if checksum errors my $quiet = 0; # don't talk too much my $configfile = 0; # By default, we do NOT read ./dupload.conf, for # security resons my $host = undef; # target host my $method = "ftp"; # transfer method my $login = "anonymous"; # default login my $passwd = "$user\@$myhost"; # ... my $options = ""; # extra options for rsync or scp my $sendmail = "/usr/sbin/sendmail"; # global Variables my (@changes, # the files we'll have to read from @skipped, # the packages we skipped @all_the_files, # ... we installed (for postupload processing) @all_the_debs, # ... we installed (for postupload processing) %all_packages, # All Debian binary packages we installed # (for postupload processing) $copiedfiles, $dry, # if do-nothing $mailonly, $fqdn, # per host $server, $dinstall_runs, $nonus, $passive, $nomail, $archive, $noarchive, %preupload, %postupload, $result, $incoming, $queuedir, # ... $mailto, $mailtx, $cc, # ... $visiblename, $visibleuser, $fullname, %files, %package, %version, %arch, # per job %dir, %changes, %log, %announce, # ... %extra, $suspicious_but_proceed, ); ### Prototypes sub configure(@); # reads the config file(s) sub ftp_open($$$); # establishs the ftp connection sub info($); # print the available info (for a given host) sub fatal(@); # bail out sub getpass(); # read password sub w(@); # warn (to STDERR if quiet, to STDOUT else) sub p(@); # print (suppress if quiet, to STDOUT else) sub announce_if_necessary($); sub run ($$); # Runs an external program and return its exit status # some tests on constants $user or fatal("Who am I? (can't get user identity)\n"); $myhost or fatal("Who am I? (can't get hostname)\n"); $cwd or fatal("Where am I? (can't get current directory)\n"); unless (-x $sendmail) { $nomail = 1; w "mail options disabled, can't run `$sendmail': $!\n"; } ### Main configure( "/etc/dupload.conf", $ENV{HOME} && "$ENV{HOME}/.dupload.conf"); $Getopt::Long::ignorecase = 0; GetOptions qw( debug:i help force keep configfile no nomail noarchive mailonly to=s print quiet Version version ) or fatal("Bad Options\n"); $configfile = $::opt_configfile || $configfile; configure("./dupload.conf") if $configfile; $dry = defined($::opt_no); $mailonly = defined($::opt_mailonly); if ($mailonly) { $dry = 1; } $debug = $::opt_debug || $debug; $keep = $::opt_keep || $keep; $host = $::opt_to || $config::default_host; $force = $::opt_force || $force; $nomail = $::opt_nomail || 0; $quiet = $::opt_quiet; # only info or version? info($host), exit 0 if $::opt_print; p("$progname version: $version\n"), exit 0 if ($::opt_Version or $::opt_version); if ($::opt_help) { p ("Usage: $progname --to HOST FILE.changes ...\n" . "\tUploads the files listed in the above '.changes' to the\n". "\thost HOST.\n" . "\tSee dupload(1) for details.\n"); exit 0; } # get the configuration for that host # global, job independent information $host or fatal("Need host to upload to. (See --to option or the default_host configuration variable)\n"); { my $nick = $config::cfg{$host}; $method = $nick->{method} || $method; $options = $nick->{options} || $options; $fqdn = $nick->{fqdn} or fatal("Nothing known about host $host\n"); $incoming = $nick->{incoming} or fatal("No Incoming dir\n"); $queuedir = $nick->{queuedir}; $mailto = $nick->{mailto}; $mailtx = $nick->{mailtx} || $mailto; $cc = $nick->{cc}; $dinstall_runs = $nick->{dinstall_runs}; $nonus = $nick->{nonus}; $passive = $nick->{passive}; if ($passive and ($method ne "ftp")) { fatal ("Passive mode is only for FTP ($host)"); } if (defined ($nick->{archive})) { $archive = $nick->{archive}; } else { $archive = 1; } foreach my $category (qw/changes sourcepackage package file deb/) { if (defined ($nick->{preupload}{$category})) { $preupload{$category} = $nick->{preupload}{$category}; } else { $preupload{$category} = $config::preupload{$category}; } if (defined ($nick->{postupload}{$category})) { $postupload{$category} = $nick->{postupload}{$category}; } else { $postupload{$category} = $config::postupload{$category}; } } $login = $nick->{login} || $login if $method eq "ftp"; $login = $nick->{login} || $user if ($method eq "scp" || $method eq "scpb" || $method eq "rsync"); $visibleuser = $nick->{visibleuser} || $user; chomp($visibleuser); $visiblename = $nick->{visiblename} || ''; chomp($visiblename); $fullname = $nick->{fullname} || ''; # Do not accept passwords in configuration file, # except for anonymous logins. undef $passwd unless $login =~ /^anonymous|ftp$/; if ($nick->{password} && ($login =~ /^anonymous|ftp$/)) { $passwd = $nick->{password}; } } # Command-line options have precedence over configuration files: ($mailto || $mailtx) or p "dupload note: no announcement will be sent.\n"; $noarchive = $::opt_noarchive || (! $archive); # get the changes file names @ARGV or push @ARGV, "."; # use currend dir if no args foreach (@ARGV) { my @f = undef; -r $_ or fatal("Can't read $_: $!\n"); -f _ and do { /\.changes$/ or w("no .changes extension: $_\n"); unshift(@changes, $_); next; }; -d _ and do { @f = <$_/*.changes> or w("no changes file in dir $_\n"); unshift @changes, @f; next; }; } @changes or die("No changes file, so nothing to do.\n"); # preupload code for changes files foreach my $change (@changes) { if ($preupload{'changes'}) { my ($result) = run $preupload{'changes'}, [$change]; if (! $result) { fatal "Pre-upload \'$preupload{'changes'}\' failed for $change\n "; } } } p("Uploading ($method) to $fqdn:$incoming"); p("and moving to $fqdn:$queuedir") if $queuedir; p("\n"); select((select(STDOUT), $| = 1)[0]); # parse the changes files and update some # hashs, indexed by the jobname: # %job - the files to be uploaded # %log - the logfile name # %dir - where the files are located # %announce - PACKAGE: foreach my $change (@changes) { my $dir = dirname($change); my $cf = basename($change); my $job = basename($cf, ".changes"); my ($package, $version, $arch) = (split("_", $job, 3)); my ($upstream, $debian) = (split("-", $version, 2)); my $log = "$job.upload"; my %md5; my (@files, @done, @extra); my (%mailto, %fields); chdir $dir or fatal("Can't chdir to $dir: $!\n"); $dir{$job} = $dir; $changes{$job} = $cf; $package{$job} = $package; $version{$job} = $version; # preupload code for source package if ($preupload{'sourcepackage'}) { my ($result) = run $preupload{'sourcepackage'}, [basename($package) . " $version"]; if (! $result) { fatal "Pre-upload \'$preupload{'sourcepackage'}\' " . "failed for " . basename($package) . " $version\n "; } } p "[ job $job from $cf"; # scan the log file (iff any) for # the files we've already put to the host # and the announcements already done if (-f $log) { open(L, "<$log") or fatal("Can't read $log: $!\n"); while () { chomp; if (/^. /) { /^u .*\s(${host}|${fqdn})\s/ and push(@done, $_), next; /^a / and push(@done, $_), next; } else { /\s(${host}|${fqdn})\s/ and push @done, "u $_"; } next; } close(L); } # if the dinstall_runs variable is set, we don't want the # announcement emails, because dinstall will attend to that. if ($dinstall_runs) { $nomail = 1; } # scan the changes file for architecture, # distribution code and the files # avoid duplicate mail addressees open(C, "<$cf") or fatal("Can't read $cf: $!\n"); my ($field); while () { chomp; /^changes:\s*/i and do { $fields{changes}++; $field = undef; next; }; /^architecture:\s+/i and do { chomp($arch{$job} = "$'"); $field = undef; next; }; /^distribution:\s+/i and do { $_ = " $'"; /\Wstable/i and $mailto{$mailto}++; /\Wunstable/i and $mailto{$mailtx}++; /\Wexperimental/i and $mailto{$mailtx}++; /\WUNRELEASED/ and fatal "distribution: UNRELEASED"; $field = undef; next; }; /^(files|checksums-(?:sha1|sha256)):\s*$/i and do { $field = lc $1; push @{$fields{$field}}, $' if $'; next; }; /^\s+/ and $field and do { push @{$fields{$field}}, $' if $'; next; }; /^[\w.-]+:/ and do { $field = undef; }; } foreach (keys %mailto) { my $k = $_; unless ($nomail) { p "\n announce ($cf) to $k"; if (grep(/^a .*\s${k}\s/, @done)) { p " already done"; } else { $announce{$job} = join(" ", $announce{$job}, $_); p " will be sent"; } } } # search for extra announcement files foreach ("${package}", "${package}_${upstream}", "${package}_${upstream}-${debian}") { $_ .= ".announce"; -r $_ and push @extra, $_; } if (@extra) { p ", as well as\n ", join(", ", @extra); $extra{$job} = [@extra]; } my %checksums; foreach my $alg (qw(sha1 sha256)) { foreach (@{$fields{"checksums-$alg"}}) { chomp; my ($chksum, $size, $file) = split; $checksums{$file}{$alg} = $chksum; if (exists $checksums{$file}{size} and $checksums{$file}{size} != $size) { fatal "differing sizes for file $file: $size != $checksums{$file}{size}"; } $checksums{$file}{size} = $size; } } foreach (@{$fields{files}}) { chomp; my ($chksum, $size, undef, undef, $file) = split; $checksums{$file}{md5} = $chksum; if (exists $checksums{$file}{size} and $checksums{$file}{size} != $size) { fatal "differing sizes for file $file: $size != $checksums{$file}{size}"; } $checksums{$file}{size} = $size; } close(C); %checksums && $fields{changes} or p(": not a changes file ]\n"), next PACKAGE; # test the md5sums foreach my $file (keys %checksums) { p "\n $file"; if ($checksums{$file}{size} != -s $file) { $keep or fatal("Size mismatch for $file\n"); w("Size mismatch for $file, skipping $job\n"); push @skipped, $cf; next PACKAGE; } p ", size ok"; foreach my $alg (qw(md5 sha1 sha256)) { next unless $checksums{$file}{$alg}; if (-r $file) { $_ = `${alg}sum $file`; $_ = (split)[0]; } else { print ": $!"; $_ = ""; } $checksums{$file}{$alg} eq $_ or do { $keep or fatal(uc($alg)."sum mismatch for $file\n"); w(uc($alg)."sum mismatch for $file, skipping $job\n"); push @skipped, $cf; next PACKAGE; }; p ", ${alg}sum ok"; } if (!$force && @done && grep(/^u \Q${file}\E/, @done)) { p ", already done for $host"; } else { push @files, $file; } next; } # The changes file itself p "\n $cf ok"; if (!$force && @done && grep(/^u \Q${cf}\E/, @done)) { p ", already done for $host"; } else { push @files, $cf; } if (@files) { $log{$job} = $log; $files{$job} = [ @files ]; } else { $log{$job} = $log; announce_if_necessary($job); if (!$dry) { open(L, ">>$log{$job}") or w("can't open logfile $log{$job}: $!\n"); print L "s $changes{$job} $fqdn " . localtime() . "\n"; close(L); } else { p "\n+ log successful upload\n"; } } p " ]\n"; # preupload code for all files and for '.deb' foreach my $file (@files) { push @all_the_files, $file; if ($preupload{'file'}) { my ($result) = run $preupload{'file'}, [$file]; if (! $result) { fatal "Pre-upload \'$preupload{'file'}\' " . "failed for $file\n "; } } if ($file =~ /\.deb$/) { # non-US sanity check if ((`dpkg -I $file | grep '^ Section:'` =~ /non-US/i) && ($fqdn !~ /(non-us|security).debian.org/i) && !$nonus) { if (!defined($suspicious_but_proceed) && $suspicious_but_proceed !~ /^y/i) { print "Looks like you're uploading non-US packages to a normal upload queue.\n"; print "Are you sure you want to proceed? "; $suspicious_but_proceed = ; die "Aborting upload.\n" unless $suspicious_but_proceed =~ /^y/i; } } push @all_the_debs, $file; my ($binary_package, $version, $garbage) = split ('_', $file); $binary_package = basename($binary_package); $all_packages{$binary_package} = $version; if ($preupload{'package'}) { my ($result) = run $preupload{'package'}, [$binary_package, $version]; if (! $result) { fatal "Pre-upload \'$preupload{'dpackage'}\' " . "failed for $binary_package $version\n "; } } if ($preupload{'deb'}) { my ($result) = run $preupload{'deb'}, [$file]; if (! $result) { fatal "Pre-upload \'$preupload{'deb'}\' " . "failed for $file\n "; } } } } } continue { chdir $cwd or fatal("Can't chdir back to $cwd\n"); } chdir $cwd or fatal("Can't chdir to $cwd: $!\n"); @skipped and w("skipped: @skipped\n"); %files or (p("Nothing to upload\n"), exit(0)); if ($method eq "ftp") { if (!$dry) { $passwd = getpass() unless defined $passwd; } else { p "+ getpass()\n"; } p "Uploading (ftp) to $host ($fqdn)\n"; if (!$dry) { ftp_open($fqdn, $login, $passwd); $server->cwd($incoming); } else { p "+ ftp_open($fqdn, $login, $passwd)\n"; p "+ ftp::cwd($incoming\n"; } } elsif ($method eq "scp" || $method eq "scpb") { p "Uploading (scp) to $host ($fqdn)\n"; } elsif ($method eq "rsync") { p "Uploading (rsync) to $host ($fqdn)\n"; } else { fatal("Unknown upload method\n"); } JOB: foreach (keys %files) { my $job = $_; my @files = @{$files{$job}}; my $mode; my $batchmode; my $allfiles; $copiedfiles = ""; my ($package, $version, $arch) = (split("_", $job, 3)); my ($upstream, $debian) = (split("-", $version, 2)); $incoming =~ s/_package_/$package/g; $incoming =~ s/_version_/$version/g; $incoming =~ s/_arch_/$arch/g; $incoming =~ s/_upstream_/$upstream/g; $incoming =~ s/_debian_/$debian/g; chdir $cwd or fatal("Can't chdir to $cwd: $!\n"); chdir $dir{$job} or fatal("Can't chdir to $dir{$job}: $!\n"); p "[ Uploading job $job"; @files or p ("\n nothing to do ]"), next; my $wrong_mode = 0; # For scpb only. A priori, the mode is right for every file foreach (@files) { my $file = $_; my $size = -s; my $t; p(sprintf "\n $file %0.1f kB", $size / 1024); $t = time(); if ($method eq "ftp") { unless ($dry) { unless ($server->put($file, $file)) { $result = $server->message(); $server->delete($file) ; fatal("Can't upload $file: $result"); } $t = time() - $t; } else { p "\n+ ftp::put($file)"; $t = 1; } } elsif ($method eq "scp") { $mode = (stat($file))[2]; unless ($dry) { system("scp -p -q $options $file $login\@$fqdn:$incoming"); fatal("scp $file failed\n") if $?; $t = time() - $t; # Small optimization if ($mode != 33188) { # rw-r--r-- aka 0644 system("ssh -x -l $login $fqdn chmod 0644 $incoming/$file"); fatal("ssh ... chmod 0644 failed\n") if $?; } } else { p "\n+ scp -p -q $options $file $login\@$fqdn:$incoming"; if ($mode != 33188) { # rw-r--r-- aka 0644 p "\n+ ssh -x -l $login $fqdn chmod 0644 $incoming/$file"; } $t = 1; } } elsif ($method eq "scpb") { $copiedfiles .= "$file "; $mode = (stat($file))[2]; # Small optimization if ($mode != 33188) { # rw-r--r-- aka 0644 $wrong_mode = 1; } $t = 1; $batchmode = 1; } elsif ($method eq "rsync") { $copiedfiles .= "$file "; $mode = (stat($file))[2]; # Small optimization if ($mode != 33188) { # rw-r--r-- aka 0644 $wrong_mode = 1; } $t = 1; $batchmode = 1; } if ($queuedir) { p", renaming"; if ($method eq "ftp") { unless ($dry) { $server->rename($file, $queuedir . $file) or $result=$server->message(), $server->delete($file), fatal("Can't rename $file -> $queuedir$file\n"); } else { p "\n+ ftp::rename($file, $queuedir$file)"; } } elsif ($method eq "scp") { unless ($dry) { system("ssh -x -l $login $fqdn \"mv $incoming$file $queuedir$file\""); fatal("ssh -x -l $login $fqdn: mv failed\n") if $?; } else { p "\n+ ssh -x -l $login $fqdn \"mv $incoming$file $queuedir$file\""; } } } p ", ok"; # the batch methods don't produce the $t statistic, so filter on that p (sprintf " (${t} s, %.2f kB/s)", $size / 1024 / ($t || 1)) unless ($batchmode); unless ($batchmode) { unless ($dry) { open(L, ">>$log{$job}") or w "Can't open $log{$job}: $!\n"; print L "u $file $fqdn " . localtime() . "\n"; close(L); } else { p "\n+ log to $log{$job}\n"; } } } # and now the batch mode uploads my $needcmd = 0; my $cmd = "ssh -x -l $login $fqdn 'cd $incoming;"; if ($wrong_mode) { $cmd .= "chmod 0644 $copiedfiles;"; $needcmd = 1; } if (length($queuedir) > 0) { $cmd .= "mv $copiedfiles $queuedir;"; $needcmd = 1; } $cmd .= "'"; if ($method eq "scpb") { unless ($dry) { p "\n"; system("scp $options $copiedfiles $login\@$fqdn:$incoming"); if ($?) { unlink $log{$job}; fatal("scp $copiedfiles failed\n"); } if ($needcmd) { system($cmd); } fatal("$cmd failed\n") if $?; } else { p "\n+ scp $options $copiedfiles $login\@$fqdn:$incoming"; p "\n+ $cmd"; } $allfiles = $copiedfiles; } if ($method eq "rsync") { unless ($dry) { p "\n"; system("rsync --partial -zave ssh $options -x $copiedfiles $login" . "@" . "$fqdn:$incoming"); if ($?) { unlink $log{$job}; fatal("rsync $copiedfiles failed\n"); } if ($needcmd) { system($cmd); } fatal("$cmd failed\n") if $?; } else { p "\n+ rsync --partial -zave ssh $options -x $copiedfiles $login" . "@" . "$fqdn:$incoming"; p "\n+ $cmd"; } $allfiles = $copiedfiles; } if ($batchmode) { unless ($dry) { open(L, ">>$log{$job}") or w "Can't open $log{$job}: $!\n"; foreach (split(/ /, $allfiles)) { print L "u $_ $fqdn " . localtime() . "\n"; } close(L); } else { p "\n+ log to $log{$job}\n"; } $batchmode = 0; } announce_if_necessary($job); unless ($dry) { open(L, ">>$log{$job}") or w("can't open logfile $log{$job}: $!\n"); print L "s $changes{$job} $fqdn " . localtime() . "\n"; close(L); } else { p "\n+ log successful upload\n"; } p " ]\n"; } if ($method eq "ftp") { unless ($dry) { $server->close(); } else { p "\n+ ftp::close\n"; } } # postupload code for changes files unless ($dry) { foreach my $change (@changes) { if ($postupload{'changes'}) { my ($result) = run $postupload{'changes'}, [$change]; if (! $result) { fatal "Post-upload \'$postupload{'changes'}\' " . "failed for $change\n "; } } my ($package, $version, $arch) = (split("_", $_, 3)); if ($postupload{'sourcepackage'}) { my ($result) = run $postupload{'sourcepackage'}, [basename($package), $version]; if (! $result) { fatal "Post-upload \'$postupload{'sourcepackage'}\' " . "failed for " . basename($package) . " $version\n "; } } } foreach my $file (@all_the_files) { if ($postupload{'file'}) { my ($result) = run $postupload{'file'}, [$file]; if (! $result) { fatal "Post-upload \'$postupload{'file'}\' " . "failed for $file\n "; } } } foreach my $file (@all_the_debs) { if ($postupload{'deb'}) { my ($result) = run $postupload{'deb'}, [$file]; if (! $result) { fatal "Post-upload \'$postupload{'deb'}\' " . "failed for $file\n "; } } } foreach my $package (keys (%all_packages)) { if ($postupload{'package'}) { my ($result) = run $postupload{'package'}, [$package, $all_packages{$package}]; if (! $result) { fatal "Post-upload \'$postupload{'package'}\' " . "failed for $package $all_packages{$package}\n "; } } } } @skipped and w("skipped: @skipped\n"); exit 0; ### SUBS ### sub announce_if_necessary ($) { my ($job) = @_[0]; my ($opt_fullname) = " -F '($fullname)'"; my ($msg); if ($announce{$job} and (! $nomail)) { if ($config::no_parentheses_to_fullname) { $opt_fullname = " -F '$fullname'"; } $fullname =~ s/\'/''/; my $sendmail_cmd = "|$sendmail -f $visibleuser" . ($visiblename ? "\@$visiblename" : "") . ($fullname ? $opt_fullname : "") . " $announce{$job}"; $msg = "announcing to $announce{$job}"; if ($cc) { $sendmail_cmd .= " " . $cc; $msg .= " and $cc"; } p $msg . "\n"; if ((!$dry) or ($mailonly)) { open(M, $sendmail_cmd) or fatal("Can't pipe to $sendmail $!\n"); } else { p "\n+ announce to $announce{$job} using command ``$sendmail_cmd''\n"; open(M, ">&STDOUT"); } print M <) { print M $line; } close(A); p(" ok)"); } open(C, "<$changes{$job}") or fatal("Can't open $changes{$job} $!\n"); while () { print M; } close(C); close(M); if ($?) { p ", failed"; } else { p ", ok"; } if (!$dry) { open(L, ">>$log{$job}") or w("can't open logfile $log{$job}: $!\n"); print L "a $changes{$job} $announce{$job} " . localtime() . "\n"; close(L); } else { p "\n+ log announcement\n"; } } } ### open the connection sub ftp_open($$$) { my ($remote, $user, $pass) = @_; my ($ftp_port, $retry_call, $attempts) = (21, 1, 1); my ($request_passive) = 0; if (($user =~ /@/) or ($passive)) { $request_passive = 1; p "+ FTP passive mode selected\n"; } # It may seems complicated, but it is to be sure that the # environment variable FTP_PASSIVE works (which needs no # Passive argument). if ($request_passive) { $server = Net::FTP->new ("$fqdn", Passive => $request_passive); } else { $server = Net::FTP->new ("$fqdn"); } if (! $server) { fatal ($@); } $server->debug($debug); $_ = $server->login($user, $pass) or die("Login as $user failed\n"); $server->type('I') or fatal("Can't set binary type\n"); } ### Display what whe know ... sub info($) { my ($host) = @_; foreach ($host || keys %config::cfg) { my $r = $config::cfg{$_}; print <{fqdn} login : $r->{login} incoming : $r->{incoming} queuedir : $r->{queuedir} mail to : $r->{mailto} mail to x : $r->{mailtx} cc : $r->{cc} passive FTP : $r->{passive} dinstall runs : $r->{dinstall_runs} archive mail : $r->{archive} non-US : $r->{nonus} xxx } } ### Read the configuration sub configure(@) { my @conffiles = @_; my @read = (); foreach (@conffiles) { -r or next; -s or next; do $_ or fatal("$@\n"); push @read, $_; } @read or fatal("No configuration files\n"); } ### password sub getpass() { system "stty -echo cbreak ); print "\n"; system "stty echo -cbreak >8; return (! $result); } } # ex:set ts=4 sw=4: dupload-2.7.0/pgp-check0000644000000000000000000000071111531305056011620 0ustar #!/bin/sh # Verify that a changes has been signed and that the signatures are good # (using PGP) FILE=$1 # If no pgp is found just exit [ ! -x "`which pgpv`" ] && exit 0 # If the file is not found just exit with error [ ! -r "$FILE" ] && exit 2 echo -n Checking signatures before upload... if [ -z "`cat \"$FILE\" | pgpv -fq 2>&1 | grep \"^Signature by\"`" ] ; then echo "PGP verification of $FILE failed!" exit 1 fi echo ...signatures are ok exit 0