dput-0.9.6.4ubuntu3/0000755000000000000000000000000012357471112011063 5ustar dput-0.9.6.4ubuntu3/https.py0000644000000000000000000000051712252030044012567 0ustar # Bit of a hack, really dput should add /usr/share/dput to the import path. d = {} exec open("/usr/share/dput/http.py") in d real_upload = d["upload"] def upload(fqdn, login, incoming, files_to_upload, debug, dummy, progress=0): return real_upload(fqdn, login, incoming, files_to_upload, debug, dummy, progress, protocol="https") dput-0.9.6.4ubuntu3/ftp.py0000644000000000000000000000657112252030044012224 0ustar import os, sys, ftplib, getpass, dputhelper # Upload the files via ftp. (Could need a bit more error-checking.) def upload(fqdn, login, incoming, files_to_upload, debug, ftp_mode, progress=0, port=21): try: ftp_connection = ftplib.FTP() ftp_connection.connect(fqdn, port) if debug: print "D: FTP-Connection to host: %s" % fqdn except ftplib.all_errors, e: print "Connection failed, aborting. Check your network", e sys.exit(1) prompt = login + "@" + fqdn + " password: " if login == 'anonymous': password = 'dput@packages.debian.org' else: password = getpass.getpass(prompt) try: ftp_connection.login(login,password) except ftplib.error_perm: print "Wrong Password" sys.exit(1) except EOFError: print "Server closed the connection" sys.exit(1) ftp_connection.set_pasv(ftp_mode==1) try: ftp_connection.cwd(incoming) except ftplib.error_perm,e: if e.args and e.args[0][:3]=='550': print "Directory to upload to does not exist." sys.exit(1) else: raise if debug: print "D: Directory to upload to: %s" % incoming for afile in files_to_upload: path_to_package, package_name = os.path.split(afile) try: if debug: print "D: Uploading File: %s" % afile if progress: try: size = os.stat(afile).st_size except: size = -1 if debug: print "D: Determining size of file '%s' failed"%afile f = open(afile,'r') if progress: f = dputhelper.FileWithProgress(f, ptype=progress, progressf=sys.stdout, size=size) # print without linefeed sys.stdout.write(" Uploading %s: "% package_name) sys.stdout.flush() ftp_connection.storbinary('STOR ' + package_name, \ f, 1024) f.close() sys.stdout.write("done.\n") sys.stdout.flush() except ftplib.all_errors, e: print "%s"% (str(e)) if isinstance(e,ftplib.Error) and e.args and e.args[0][:3]=='553': print "Leaving existing %s on the server and continuing" %(package_name) print """NOTE: This existing file may have been previously uploaded partially. For official Debian upload queues, the dcut(1) utility can be used to remove this file, and after an acknowledgement mail is received in response to dcut, the upload can be re-initiated.""" continue elif isinstance(e,ftplib.Error) and e.args and e.args[0][:1]=='5': print """Note: This error might indicate a problem with your passive_ftp setting. Please consult dput.cf(5) for details on this configuration option.""" if debug: print "D: Should exit silently now, but will throw exception for debug." raise sys.exit(1) try: ftp_connection.quit() except Exception, e: if debug: print "D: Exception %s while attempting to quit ftp session." % e print "D: Throwing an exception for debugging purposes." raise dput-0.9.6.4ubuntu3/local.py0000644000000000000000000000164312252030044012520 0ustar # Upload the files with /usr/bin/install in a batch. import os,sys,stat,dputhelper def upload(fqdn,login,incoming,files_to_upload,debug,compress,progress=0): # fqdn, login, compress are ignored # Maybe login should be used for "install -o "? files_to_fix = [] incoming = os.path.expanduser(incoming) for file in files_to_upload: to_fix = os.path.basename(file) file_to_fix = os.path.expanduser(os.path.join(incoming, to_fix)) files_to_fix.append(file_to_fix) command = ['/usr/bin/install', '-m', '644', incoming] command[3:3] = files_to_upload if debug: print "D: Uploading with cp to %s" % (incoming) print "D: %s" % command if dputhelper.spawnv(os.P_WAIT, '/usr/bin/install', command): print "Error while uploading." sys.exit(1) dput-0.9.6.4ubuntu3/security-warning0000755000000000000000000000061312252030044014310 0ustar #!/bin/sh set -e cat << __END__ Do NOT upload a package to the security upload queues without prior authorization from the security team. See the following URL for instructions: http://www.debian.org/doc/developers-reference/pkgs#bug-security Please enter "really upload" (without the quotes) to proceed with the upload. __END__ read really_upload [ "xreally upload" = "x${really_upload}" ] dput-0.9.6.4ubuntu3/dcut.10000644000000000000000000001354112252030044012075 0ustar .\" Hey, Emacs! This is an -*- nroff -*- source file. .TH dcut 1 "January 2004" .SH NAME .B dcut \- Debian archive .commands file upload tool .SH SYNTAX .B dcut [\fIoptions\fR] [\fIhost\fR] [\fIcommand\fR [\fB,\fR \fIcommand\fR]] .P .B dcut \fB\-U\fR \fIfilename\fR [\fIhost\fR] .SH DESCRIPTION dcut creates and / or uploads .commands files for the Debian FTP archive upload queue. It is a companion for \fBdput\fR and uses dput configuration files. As with dput, you can specify a .I host defined in the dput configuration file. In case your host is funnily named, i.e. it could mistaken for a command, you may also use a command line option to specify the host. In default operation mode (unless you request to upload an existing file), the host description is followed by a comma-separated list of commands. (Semicolons also work but require shell escaping.) .SH COMMANDS Presently supported commands are \fBrm\fR, \fBreschedule\fR and \fBcancel\fR. \fBrm\fR can be used to remove files from the UploadQueue directories. \fBdcut\fR generates commands that search the subdirectories automatically, but you can also specify \fB\-\-nosearchdirs\fR and then target individual UploadQueue directories, i.e. either filenames without path for regular incoming or \fBDELAYED/#-day/filename\fR. Wildcards are accepted. \fBreschedule changes-file #-day\fR can be used to move an upload from any \fBDEFERRED\fR queue to \fB#-day\fR (use \fB0-day\fR for immediate processing). \fBcancel changes-file\fR cancels an upload from \fBDEFERRED\fR. Both \fBreschedule\fR and \fBcancel\fR take a complete basename of a changes file as argument and operate on the whole upload, they process the changes and all files mentioned by it. The authorative documentation for the commands interface can be found at "ftp://ftp.upload.debian.org/pub/UploadQueue/README". .P The options try to resemble dput's to the extent possible. .P Note that dcut calls debsign to sign any commands file generated. In particular, debsign does basic syntax checking on the commands you specify. .SH OPTIONS .TP .B \-c \fIfilename\fR, \fB\-\-config\fR=\fIfilename\fR Use config file \fIfilename\fR. .TP .B \-d, \-\-debug Print debug messages. .TP .B \-h, \-\-help Print help information and exit. .TP .B \-\-host=\fIhost\fR Upload to \fIhost\fR (as found in the dput configuration). Use this if your host is named like one of the commands. .TP .B \-m \fImaintainer\fR, \fB\-\-maintainer\fR=\fImaintainer\fR Use \fImaintainer\fR (full email) for the uploader field and gpg key selection. This has no effect when \fB--upload\fR is used. .TP .B \-k \fIkeyid\fR, \fB\-\-keyid\fR=\fIkeyid\fR Use \fIkeyid\fR for signing. Default is to let \fBdebsign\fR choose a keyid. This has no effect when \fB--upload\fR is used. .TP .B \-O \fIfilename\fR, \fB\-\-output\fR=\fIfilename\fR Write commands file to \fIfilename\fR instead of uploading. You sould not specify a host when using this option. Also, this option should not be used with \fB--upload\fR. Both \fIfilename\fR and \fIfilename\fB.asc\fR will be overwritten. .TP .B \-P, \-\-passive Use passive ftp instead of active. .TP .B \-s, \-\-simulate Simulate an upload only. .TP .B \-U \fIfilename\fR, \fB\-\-upload\fR=\fIfilename\fR Upload commands file. Note: No checks (syntax or presence/validity of signature) are currently performed. .TP .B \-i \fIfilename\fR, \fB\-\-input\fR=\fIfilename\fR Read an input changes file to create a commands file that can remove the files listed in the .changes file from the upload queue. .TP .B \-v, \-\-version Print version information and exit. .SH ENVIRONMENT The program uses the environment variables DEBEMAIL or EMAIL and DEBFULLNAME to populate the uploader field. Also, environment variables may be used in search of a suitable place for temporary files. .SH EXAMPLES To upload a GPG signed commands file that removes dput_0.9.2.33_all.deb file from the queue, one would have to do .in +4n .nf $ dcut rm dput_0.9.2.33_all.deb .fi .in This creates and uploads a commands file that looks like the following: .nf -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Uploader: Foo Bar Commands: rm dput_0.9.2.33_all.deb -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYKAkisYx0ACgkQ4eu+pS04mIfwLQCg85XVpae/LHLrbvzywcQNt9PS ztsAoMgw6HjcI9flfmwjgMiapcu379Pu =fjp0 -----END PGP SIGNATURE----- .fi To upload a GPG signed commands file that removes files named in dput_0.9.4_i386.changes from the queue, one would have to do .in +4n .nf $ dcut \-\-input dput_0.9.4_i386.changes .fi .in This creates and uploads a commands file that looks like the following: .nf -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Uploader: Foo Bar Commands: rm \-\-searchdirs dput_0.9.4.dsc rm \-\-searchdirs dput_0.9.4.tar.gz rm \-\-searchdirs dput_0.9.4_all.deb -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYKAkisYx0ACgkQ4eu+pS04mIfwLQCg85XVpae/LHLrbvzywcQNt9PS ztsAoMgw6HjcI9flfmwjgMiapcu379Pu =fjp0 -----END PGP SIGNATURE----- .fi If you've uploaded packages with the \-\-delayed option (uploaded to \fBDEFERRED\fR queue), then use the \fBcancel\fR command with a .changes file. .in +4n .nf $ dcut cancel dput_0.9.4_i386.changes .fi .in This creates and uploads a commands file just like the other commands. .nf .SH LICENSE This program is distributed under the terms of the Gnu General Public License, Version 2 or later. .SH BUGS Please direct bug reports and comments to the author. Your feedback is appreciated. If you're using Debian packages, file bugs against the dput package. .SH FILES dcut makes use of the dput configuration files: .TP .I /etc/dput.cf System dput configuration file. .TP .I ~/.dput.cf User dput configuration file. Much helpful input and some stolen code from dput author Christian Kurz. .SH SEE ALSO .BR dput (1), .BR dput.cf (5) .br ftp://ftp.upload.debian.org/pub/UploadQueue/README .SH AUTHOR Thomas Viehmann dput-0.9.6.4ubuntu3/rsync.py0000644000000000000000000000226312252030044012563 0ustar # Upload the files with rsync via ssh. import os, sys, dputhelper def upload(fqdn,login,incoming,files_to_upload,debug, dummy,progress=0): files_to_fix = [] for file in files_to_upload: to_fix = os.path.basename(file) file_to_fix = os.path.join(incoming, to_fix) files_to_fix.append(file_to_fix) if login and login != '*': login_spec = '%s@'%login else: login_spec = '' upload_command = ['rsync', '', '--copy-links', '--progress', '--partial', '-zave', 'ssh -x', '%s%s:%s' % (login_spec, fqdn, incoming)] fix_command = ['ssh', '%s%s' % (login_spec, fqdn), 'chmod', '0644'] \ + files_to_fix upload_command[1:2] = files_to_upload if debug: print "D: Uploading with rsync to %s%s:%s" % \ (login_spec, fqdn, incoming) if dputhelper.spawnv(os.P_WAIT, '/usr/bin/rsync', upload_command): print print "Error while uploading." sys.exit(1) if debug: print "D: Fixing file permissions with %s%s" % (login_spec, fqdn) if dputhelper.spawnv(os.P_WAIT, '/usr/bin/ssh', fix_command): print "Error while fixing permission." sys.exit(1) dput-0.9.6.4ubuntu3/TODO0000644000000000000000000000042112252030044011535 0ustar 1. Enable a decent progress_indicator for all upload methods 2. Implement sftp support using python-paramiko 3. Support ftp-over-http for ftp proxy users 4. Implement pre-upload and post-upload hook directories 5. Restrict upload types (source, binary etc.) in config dput-0.9.6.4ubuntu3/THANKS0000644000000000000000000000164612252030044011772 0ustar The first person to thank is of course the original author of dput and long time maintainer Christian Kurz. We would like to thank the people who contributed either code, documentation, or suggestions and ideas. Their help improved this tool. Andrew Suffield Ansgar Burchardt Christoph Berg Clytie Siddall Cody Somerville Colin Watson Cyril Burlebois Daniel Hahler Daniel Nylander Dann Frazier Eduard Bloch Євгеній Мещеряков Florian Ernst Gerfried Fuchs Guido Trotter Guillaume Morin Ilgiz Kalmetev Johannes Berg Jonny Lamb Jordi Mallach Lars Wirzenius Loïc Minier Luk Claes Martin Michlmayr Miroslav Kure Moshe Zadka Nelson A. de Oliveira Roland Mas Ross Burton Sean Finney Sean 'Shaleh' Perry Stefan Völkel Steffen Moeller Steve Langasek Steven Baker Steven Kowalik Thijs Kinkhorst Thomas Viehmann If you think you should be on the list but aren't: Please drop the Debian maintainer a mail and we'll fix that. dput-0.9.6.4ubuntu3/debian/0000755000000000000000000000000012357471116012311 5ustar dput-0.9.6.4ubuntu3/debian/prerm0000644000000000000000000000014412252030044013341 0ustar #!/bin/sh set -e dpkg --listfiles dput | awk '$0~/\.py$/ {print $0"c\n" $0"o"}' | xargs rm -f >&2 dput-0.9.6.4ubuntu3/debian/rules0000755000000000000000000000574012252030044013360 0ustar #!/usr/bin/make -f PACKAGE := dput TMPDIR := debian/tmp build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: test -e debian/control touch build-stamp clean: test -e debian/control test 0 = "`id -u`" || (echo need root privileges; exit 1) rm -f build-stamp install-stamp rm -rf debian/substvars debian/files $(TMPDIR) rm -rf *.pyc *~ debian/*~ # Build architecture-independent files here. binary-indep: build debian/control test -e debian/control test 0 = "`id -u`" || (echo need root privileges; exit 1) rm -rf debian/substvars $(TMPDIR) install -d --mode=0755 $(TMPDIR) install -d --mode=0755 $(TMPDIR)/DEBIAN install -d --mode=0755 $(TMPDIR)/usr/bin install -d --mode=0755 $(TMPDIR)/etc install -d --mode=0755 $(TMPDIR)/etc/bash_completion.d install -d --mode=0755 $(TMPDIR)/usr/share/doc/$(PACKAGE) install -d --mode=0755 $(TMPDIR)/usr/share/man/man1 install -d --mode=0755 $(TMPDIR)/usr/share/man/man5 install -d --mode=0755 $(TMPDIR)/usr/share/dput install -d --mode=0755 $(TMPDIR)/usr/share/dput/helper install --mode=0755 dput $(TMPDIR)/usr/bin/ install --mode=0755 dcut $(TMPDIR)/usr/bin install --mode=0644 dput.cf $(TMPDIR)/etc install --mode=0644 dput.1 $(TMPDIR)/usr/share/man/man1 install --mode=0644 dcut.1 $(TMPDIR)/usr/share/man/man1 install --mode=0644 dput.cf.5 $(TMPDIR)/usr/share/man/man5 install --mode=0644 ftp.py $(TMPDIR)/usr/share/dput install --mode=0644 http.py $(TMPDIR)/usr/share/dput install --mode=0644 https.py $(TMPDIR)/usr/share/dput install --mode=0644 scp.py $(TMPDIR)/usr/share/dput install --mode=0644 sftp.py $(TMPDIR)/usr/share/dput install --mode=0644 local.py $(TMPDIR)/usr/share/dput install --mode=0644 rsync.py $(TMPDIR)/usr/share/dput install --mode=0644 dputhelper.py $(TMPDIR)/usr/share/dput/helper install --mode=0755 security-warning $(TMPDIR)/usr/share/dput/helper install --mode=0644 README $(TMPDIR)/usr/share/doc/$(PACKAGE) install --mode=0644 FAQ $(TMPDIR)/usr/share/doc/$(PACKAGE) install --mode=0644 copyright $(TMPDIR)/usr/share/doc/$(PACKAGE) install --mode=0644 TODO $(TMPDIR)/usr/share/doc/$(PACKAGE) install --mode=0644 THANKS $(TMPDIR)/usr/share/doc/$(PACKAGE) install --mode=0644 debian/changelog $(TMPDIR)/usr/share/doc/$(PACKAGE) install --mode=0644 bash_completion $(TMPDIR)/etc/bash_completion.d/$(PACKAGE) gzip -9 $(TMPDIR)/usr/share/man/man1/* gzip -9 $(TMPDIR)/usr/share/man/man5/* gzip -9 $(TMPDIR)/usr/share/doc/$(PACKAGE)/changelog cd $(TMPDIR); find -type f \! -regex '.*/DEBIAN/.*' -printf '%P\0' | xargs -r0 md5sum > DEBIAN/md5sums install --mode=0644 debian/conffiles $(TMPDIR)/DEBIAN install --mode=0755 debian/prerm $(TMPDIR)/DEBIAN install --mode=0755 debian/postinst $(TMPDIR)/DEBIAN dpkg-gencontrol -isp dpkg --build $(TMPDIR) .. # Build architecture-dependent files here. binary-arch: build source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary dput-0.9.6.4ubuntu3/debian/conffiles0000644000000000000000000000005112252030044014161 0ustar /etc/dput.cf /etc/bash_completion.d/dput dput-0.9.6.4ubuntu3/debian/source/0000755000000000000000000000000012252030157013577 5ustar dput-0.9.6.4ubuntu3/debian/source/format0000644000000000000000000000001512252030044015001 0ustar 3.0 (native) dput-0.9.6.4ubuntu3/debian/control0000644000000000000000000000232012252030044013672 0ustar Source: dput Section: devel Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Y Giridhar Appaji Nag Build-Depends-Indep: debconf-utils (>= 1.1.1) Standards-Version: 3.9.4 Vcs-Git: git://anonscm.debian.org/collab-maint/dput.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/dput.git Package: dput Architecture: all Depends: python (>= 2.5), gnupg Suggests: openssh-client, lintian, mini-dinstall, rsync, python-bzrlib Description: Debian package upload tool dput allows you to put one or more Debian packages into the archive. This package also includes a dcut utility which can be used to generate and / or upload a commands file for the Debian FTP archive upload queue. . dput includes some tests to verify that the package is policy-compliant. It offers the possibility to run lintian before the upload. It can also run dinstall in dry-run-mode, when having used an appropriate upload method. This is very useful to see if the upload will pass dinstall sanity checks in the next run. . It is intended mainly for Debian maintainers only, although it can also be useful for people maintaining local apt repositories. dput-0.9.6.4ubuntu3/debian/postinst0000644000000000000000000000046412252030044014104 0ustar #!/bin/sh set -e DIR='/usr/share/dput/' case "$1" in configure|abort-upgrade|abort-remove|abort-deconfigure) python -c 'import sys, compileall ; exit_status = int(not compileall.main()); sys.exit(exit_status)' -q $DIR ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac dput-0.9.6.4ubuntu3/debian/changelog0000644000000000000000000015452312357471115014174 0ustar dput (0.9.6.4ubuntu3) utopic; urgency=medium * dput.cf: Switch ubuntu stanza to upload to "/ubuntu" rather than "/" (LP: #1340130). -- Colin Watson Thu, 10 Jul 2014 12:00:29 +0100 dput (0.9.6.4ubuntu2) utopic; urgency=medium * dput.cf: Drop trailing "/ubuntu" from ppa stanza, to support the new form of the upload path needed for PPAs based on derived distributions (LP: #1340130). -- Colin Watson Thu, 10 Jul 2014 11:48:28 +0100 dput (0.9.6.4ubuntu1) trusty; urgency=low * Merge from Debian unstable. Remaining changes: - debian/control: Added suggests on python-bzrlib (as we use the bzrlib.transport). - debian/rules: Updated to install sftp.py. - dput: + Recognize 0ubuntu1 as a debian version that requires orig.tar.gz to be included in the upload. + Correctly handle cases where a non-existant host or no host at all is supplied when -o option is passed. (Thanks to David Futcher for spotting) + Be more careful about setting a variable in a section that does not exist in host argument handling. - dput.1: Updated to document host argument feature and sftp support. - dput.cf: + Set 'default_main_host = ubuntu' + Set 'progress_indicator = 2' + Updated ppa stanza to make use of argument support. - dput.cf.5: Updated to note support for sftp transport and host args. - http.py: Don't incorrectly assume that HTTPResponse.reason is an integer when generating an error message. - sftp.py: Support for uploads via sftp transport with a progress indicator. -- Logan Rosen Tue, 10 Dec 2013 17:20:23 -0500 dput (0.9.6.4) unstable; urgency=low [ Salvatore Bonaccorso ] * Add missing space in printed sentence after lintian checks. [ Y Giridhar Appaji Nag ] * dcut honours ssh_config_options, thanks Luca Falavigna (Closes: #656692) * Allow quote in DEBFULLNAME, thanks Thomas Preud'homme (Closes: #578617) * Fix HTTPS auth urllib2 failures, thanks Chow Loong Jin (Closes: #580505) * Merge NUMs to git, thanks Thijs Kinkhorst and Alberto Á. Fuentes * Remove jp server from dput.cf, thanks Hideki Yamane (Closes: #703858) * Check for execute perms of /usr/bin/gpg instead of read, thanks Richard Laager (Closes: #595505) * Add missing stdout flush between "Uploading" and "done." for ftp, thanks Thorsten Glaser (Closes: #664685) * Apply patch from Jan Hauke Rahm to catch exception if there is no section in the config file for a given default_host (Closes: #621507) * Apply Andrew Shadura's patch for various manpage fixes (Closes: #695175) * Update Standards-Version to 3.9.4 (add build-arch and build-indep etc.) -- Y Giridhar Appaji Nag Fri, 19 Jul 2013 16:41:55 +0530 dput (0.9.6.3+nmu2ubuntu1) saucy; urgency=low * Merge from Debian unstable. Remaining changes: - debian/control: Added suggests on python-bzrlib (as we use the bzrlib.transport). - debian/rules: Updated to install sftp.py. - dput: + Recognize 0ubuntu1 as a debian version that requires orig.tar.gz to be included in the upload. + Correctly handle cases where a non-existant host or no host at all is supplied when -o option is passed. (Thanks to David Futcher for spotting) + Be more careful about setting a variable in a section that does not exist in host argument handling. - dput.1: Updated to document host argument feature and sftp support. - dput.cf: + Set 'default_main_host = ubuntu' + Set 'progress_indicator = 2' + Updated ppa stanza to make use of argument support. - dput.cf.5: Updated to note support for sftp transport and host args. - http.py: Don't incorrectly assume that HTTPResponse.reason is an integer when generating an error message. - sftp.py: Support for uploads via sftp transport with a progress indicator. -- Logan Rosen Sun, 26 May 2013 00:34:14 -0400 dput (0.9.6.3+nmu2) unstable; urgency=low * Non-maintainer upload. * Update dput.cf to deal with backports.org being integrated into the main archive (Closes: #704228). -- Thijs Kinkhorst Sun, 31 Mar 2013 13:09:54 +0200 dput (0.9.6.3+nmu1ubuntu1) raring; urgency=low * Merge from Debian unstable. Remaining changes: - debian/control: Added suggests on python-bzrlib (as we use the bzrlib.transport). - debian/rules: Updated to install sftp.py. - dput: + Recognize 0ubuntu1 as a debian version that requires orig.tar.gz to be included in the upload. + Correctly handle cases where a non-existant host or no host at all is supplied when -o option is passed. (Thanks to David Futcher for spotting) + Be more careful about setting a variable in a section that does not exist in host argument handling. - dput.1: Updated to document host argument feature and sftp support. - dput.cf: + Set 'default_main_host = ubuntu' + Set 'progress_indicator = 2' + Updated ppa stanza to make use of argument support. - dput.cf.5: Updated to note support for sftp transport and host args. - http.py: Don't incorrectly assume that HTTPResponse.reason is an integer when generating an error message. - sftp.py: Support for uploads via sftp transport with a progress indicator. -- Logan Rosen Mon, 26 Nov 2012 15:50:06 -0500 dput (0.9.6.3+nmu1) unstable; urgency=low * Non-maintainer upload. * Discourage people to upload packages to the wrong archive (Closes: #561678) * Deleted obsolete comment about gluck (Closes: #674585) * Use case and example about dcut added to man page. Thanks Hideki Yamane (Closes: #688871) -- Alberto Á. Fuentes Sun, 14 Oct 2012 13:04:37 +0100 dput (0.9.6.3) unstable; urgency=low * volatile archive has been discontinued (Closes: #661374) * Change Vcs-Browser to anonscm.d.o from git.d.o * Update Standards-Version to 3.9.3 (no changes required) -- Y Giridhar Appaji Nag Tue, 06 Mar 2012 12:41:41 +0530 dput (0.9.6.2ubuntu2) quantal; urgency=low * sftp.py: - Add support for a progress indicator to the sftp method (LP: #633109) - Delete trailing whitespace * debian/control: - Suggest python-bzrlib instead of bzr -- Chow Loong Jin Mon, 16 Jul 2012 08:57:02 +0200 dput (0.9.6.2ubuntu1) oneiric; urgency=low * Merge from debian unstable (LP: #775587), remaining changes: - debian/control: Added suggests on bzr (as we use the bzrlib.transport) - debian/rules: Updated to install sftp.py - sftp.py: Support for uploads via sftp transport - dput.cf: + Set 'default_main_host = ubuntu' + Set 'progress_indicator = 2' + Updated ppa stanza to make use of argument support - dput: + Recognize 0ubuntu1 as a debian version that requires orig.tar.gz to be included in the upload. + Correctly handle cases where a non-existant host or no host at all is supplied when -o option is passed. (Thanks to David Futcher for spotting) + Be more careful about setting a variable in a section that does not exist in host argument handling - dput.cf.5: Updated to note support for sftp transport and host args - dput.1: Updated to document host argument feature and sftp support. - Don't incorrectly assume that HTTPResonse.reason is an integer when generating an error message -- Lorenzo De Liso Mon, 02 May 2011 15:26:31 +0200 dput (0.9.6.2) unstable; urgency=low [ Gerfried Fuchs ] * Remove .org from the backports target name. [ Y Giridhar Appaji Nag ] * Change the default backports configuration (Closes: #595726) * Clarify the -m option in dcut.1 (Closes: #608634) * Don't suggest yaclc, it is no longer in the archive * Update Standards-Version to 3.9.1 (no changes required) -- Y Giridhar Appaji Nag Thu, 10 Mar 2011 14:41:41 +0530 dput (0.9.6.1ubuntu1) maverick; urgency=low * Merge from debian unstable (LP: #606153). Remaining changes: - debian/control: Added suggests on bzr (as we use the bzrlib.transport) - debian/rules: Updated to install sftp.py - sftp.py: Support for uploads via sftp transport - dput.cf: + set 'default_main_host = ubuntu' + set 'progress_indicator = 2' + Updated ppa stanza to make use of argument support - dput: + Recognize 0ubuntu1 as a debian version that requires orig.tar.gz to be included in the upload. + Correctly handle cases where a non-existant host or no host at all is supplied when -o option is passed. (Thanks to David Futcher for spotting) + Be more careful about setting a variable in a section that does not exist in host argument handling (LP: #327239) - dput.cf.5: Updated to note support for sftp transport and host args - dput.1: Updated to document host argument feature and sftp support. - Don't incorrectly assume that HTTPResonse.reason is an integer when generating an error message (LP: #380940) * Dropped change: - Compute md5 sums (merged in debian) -- Bhavani Shankar Fri, 16 Jul 2010 12:25:57 +0530 dput (0.9.6.1) unstable; urgency=low * Use hashlib instead of md5/sha modules for Python 2.6 (Closes: #517831) * Update Standards-Version to 3.9.0 (no changes required) -- Y Giridhar Appaji Nag Thu, 08 Jul 2010 14:15:52 +0530 dput (0.9.6) unstable; urgency=low * Correct bash completion for --delayed * Use %s to print HTTP response reason string (not a number) * Compute md5sums to fix lintian I: no-md5sums-control-file, thanks Loïc Minier (Closes: #564783) * Mark self.closed = 1 to prevent messing up of display with setting progress_indicator=2, thanks Kan-Ru Chen for the patch (Closes: #488316) * Add allow_cut = 1 to security-master-* (Closes: #574506) * Fix handling of version for multi-digit epochs (Closes: #577825) * Update Standards-Version to 3.8.4 (no changes required) * Switch to dpkg-source 3.0 (native) format * Don't warn about a DELAYED/0-day upload, just print (Closes: #553198) -- Y Giridhar Appaji Nag Fri, 21 May 2010 12:15:54 +0530 dput (0.9.5.1ubuntu1) lucid; urgency=low * Merge from debian testing. Remaining changes: LP: #507068 - debian/control: Added suggests on bzr (as we use the bzrlib.transport) - debian/rules: Updated to install sftp.py - sftp.py: Support for uploads via sftp transport - dput.cf: + set 'default_main_host = ubuntu' + set 'progress_indicator = 2' + Updated ppa stanza to make use of argument support - dput: + Recognize 0ubuntu1 as a debian version that requires orig.tar.gz to be included in the upload. + Correctly handle cases where a non-existant host or no host at all is supplied when -o option is passed. (Thanks to David Futcher for spotting) + Be more careful about setting a variable in a section that does not exist in host argument handling (Fixes LP: #327239) - dput.cf.5: Updated to note support for sftp transport and host args - dput.1: Updated to document host argument feature and sftp support. - Don't incorrectly assume that HTTPResonse.reason is an integer when generating an error message (LP: #380940). - Compute md5 sum -- Bhavani Shankar Tue, 19 Jan 2010 20:20:30 +0530 dput (0.9.5.1) unstable; urgency=low * Fix lintian (pedantic) warnings and info messages + I: hyphen-used-as-minus-sign in dcut(1) + P: maintainer-script-without-set-e + P: copyright-refers-to-symlink-license * set method = ftp as applicable in default dput.cf (Closes: #544360) * Initialize options['changes'] in dcut, include the changes file itself when using dcut -i. Thanks gregor herrmann for the report and fix (Closes: #544440) -- Y Giridhar Appaji Nag Mon, 31 Aug 2009 22:39:37 +0530 dput (0.9.5) unstable; urgency=low * Better (hopefully) language in default messages. Thanks Andre Klapper for the bug report(Closes: #521281) * Add the new upload queue in Europe to dput.cf as "ftp-eu" * Fix URL to the dev-ref section on "Handling security-related bugs". Thanks Mauro Lizaur (Closes: #529770) * Implement a -i option to dcut that reads a changes file to create a commands file removing the files uploaded via the changes file. Thanks Dinesh Shanbhag (Closes: #302292) * Update Standards-Version to 3.8.3 (no changes required) -- Y Giridhar Appaji Nag Mon, 24 Aug 2009 21:05:55 +0530 dput (0.9.4ubuntu3) lucid; urgency=low * Compute md5sum. -- Loïc Minier Mon, 11 Jan 2010 23:08:08 +0100 dput (0.9.4ubuntu2) karmic; urgency=low * Don't incorrectly assume that HTTPResonse.reason is an integer when generating an error message (LP: #380940). -- Evan Dandrea Fri, 19 Jun 2009 10:15:53 +0100 dput (0.9.4ubuntu1) karmic; urgency=low * Merge from debian unstable (LP: #388939), remaining changes: - debian/control: Added suggests on bzr (as we use the bzrlib.transport) - debian/rules: Updated to install sftp.py - Be more careful about setting a variable in a section that does not exist in host argument handling (Fixes LP: #327239) - Correctly handle cases where a non-existant host or no host at all is supplied when -o option is passed. (Thanks to David Futcher for spotting) - sftp.py: Support for uploads via sftp transport - dput.cf: + set 'default_main_host = ubuntu' + set 'progress_indicator = 2' - dput: + Recognize 0ubuntu1 as a debian version that requires orig.tar.gz to be included in the upload. - dput.cf: Updated ppa stanza to make use of argument support. - dput.cf.5: Updated to note support for sftp transport and host args - dput.1: Updated to document host argument feature and sftp support. -- Muharem Hrnjadovic Thu, 18 Jun 2009 13:28:09 +0200 dput (0.9.4) unstable; urgency=low * Don't display "Not running dinstall." message, thanks Mark Brown for the suggestion (Closes: #520186) * Update Standards-Version to 3.8.1 (no changes required) * Don't mix tabs and spaces for indentation (Closes: #506433) * dcut tries $EMAIL before using pwent from getpwuid if $DEBEMAIL is not available (Closes: #520694) * Fix rsync upload method to dereference symlinks (Closes: #507634) * Add -U option to prevent writing an upload log (Closes: #454289) -- Y Giridhar Appaji Nag Sat, 28 Mar 2009 20:36:46 +0530 dput (0.9.3) unstable; urgency=low [ Thomas Viehmann ] * debian/control: Remove Thomas from uploaders, he cannot upload anymore. [ Y Giridhar Appaji Nag ] * Integrate patch from Ansgar Burchardt to reduce memory usage while computing file checksum (Closes: #514388) * Change version number format to x.y.x for dput and x.y for dcut -- Y Giridhar Appaji Nag Tue, 24 Feb 2009 23:30:58 +0530 dput (0.9.2.37ubuntu3) jaunty; urgency=low * Fix deprecation warning with python 2.6 (LP: #336601) -- Michael Bienia Mon, 02 Mar 2009 12:35:23 +0100 dput (0.9.2.37ubuntu2) jaunty; urgency=low * dput: - Be more careful about setting a variable in a section that does not exist in host argument handling (Fixes LP: #327239) - Correctly handle cases where a non-existant host or no host at all is supplied when -o option is passed. (Thanks to David Futcher for spotting) -- Cody A.W. Somerville Mon, 09 Feb 2009 18:02:26 -0400 dput (0.9.2.37ubuntu1) jaunty; urgency=low * Merge from debian unstable, remaining changes: LP: #313718 + sftp.py: Support for uploads via sftp transport + dput.cf: - set 'default_main_host = ubuntu' - set 'progress_indicator = 2' + dput: - Recognize 0ubuntu1 as a debian version that requires orig.tar.gz to be included in the upload. + debian/control: Added suggests on bzr (as we use the bzrlib.transport) + debian/rules: Updated to install sftp.py + dput: - Added ability to pass an argument to the host configuration by placing a colon after the hostname. The variable with the same name of the host will be replaced with the string following the colon. - Properly check to see if config stanza exists for host. + dput.cf: Updated ppa stanza to make use of argument support. + dput.cf.5: Updated to note support for sftp transport and host args + dput.1: Updated to document host argument feature and sftp support. -- Bhavani Shankar Sun, 04 Jan 2009 19:37:45 +0530 dput (0.9.2.37) unstable; urgency=low [ Y Giridhar Appaji Nag ] * Remove "DM-Upload-Allowed: yes" * Add "allow_dcut = 1" to the backports.org stanza (Closes: #507170) * Thanks Cyril Brulebois for miscellaneous usability and documentation patches. * Indicate 'Uploading ' for clarity when a file upload is to start. Thanks "Nelson A. de Oliveira" for the report and Cyril Brulebois for the suggestion (Closes: #504614) * Continue despite an FTP 553 and indicate that the file may have been uploaded partially. Based on a patch from "Steve M. Robbins" (Closes: #481947) [ Thomas Viehmann ] * debian/control: Doing most work makes Giridhar the maintainer. That is awesome, thanks! * Add Thanks to Thanks. -- Y Giridhar Appaji Nag Sat, 20 Dec 2008 17:42:10 +0530 dput (0.9.2.36ubuntu1) jaunty; urgency=low * Merge from debian unstable, remaining changes: (LP: #310754) + sftp.py: Support for uploads via sftp transport + dput.cf: - set 'default_main_host = ubuntu' - set 'progress_indicator = 2' + dput: - Recognize 0ubuntu1 as a debian version that requires orig.tar.gz to be included in the upload. + debian/control: Added suggests on bzr (as we use the bzrlib.transport) + debian/rules: Updated to install sftp.py + dput: - Added ability to pass an argument to the host configuration by placing a colon after the hostname. The variable with the same name of the host will be replaced with the string following the colon. (LP: #196797) - Properly check to see if config stanza exists for host. (LP: #196786) + dput.cf: Updated ppa stanza to make use of argument support. + dput.cf.5: Updated to note support for sftp transport and host args + dput.1: Updated to document host argument feature and sftp support. -- Cody A.W. Somerville Mon, 22 Dec 2008 17:16:38 -0500 dput (0.9.2.36) unstable; urgency=low * Change Uploader to official Debian ID. * :s/ftp-master.debian.org/ftp.upload.debian.org/g thanks to Євгеній Мещеряков for the report (Closes: #500024) * Correct progname that was misspelt as prodname. Thanks "Nelson A. * de Oliveira" for the report (Closes: #504612) * Catch exceptions during ftp QUIT, patch based on fix in Ubuntu from Cody Somerville (Closes: #484244) * Change 'login = username' to 'login = *' in the default config (Closes: #505451) * Add repository to the .upload filename to allow upload to different repository on the same host. Thanks Loïc Minier for the bug report (Closes: #500701) -- Y Giridhar Appaji Nag Sat, 22 Nov 2008 22:01:49 +0530 dput (0.9.2.35ubuntu3) jaunty; urgency=low * sftp.py: import bzrlib.transport inside the upload method so that dput will not error out when bzrlib.transport is not available but the user isn't using the sftp transport anyhow. (LP: #297851) -- Cody A.W. Somerville Fri, 14 Nov 2008 10:30:01 -0400 dput (0.9.2.35ubuntu2) jaunty; urgency=low * sftp.py: Actually use the specified login name to authenticate. (LP: #296472) -- Cody A.W. Somerville Mon, 10 Nov 2008 15:24:29 -0500 dput (0.9.2.35ubuntu1) jaunty; urgency=low * Merge from debian unstable, remaining changes: (LP: #295613) + dput.cf: - set ubuntu as default_host_main - set 'progress_indicator = 2' + dput: - Recognize 0ubuntu1 as a debian version that requires orig.tar.gz to be included in the upload. * sftp.py: Created dput method module to add support for uploads via sftp. * ftp.py: - Catch exceptions that are thrown on call to ftp_connection.quit() - Fixes LP: #183624 * debian/control: Added suggests on bzr (as we use the bzrlib.transport) * debian/rules: Updated to install sftp.py * dput: - Added ability to pass an argument to the host configuration by placing a colon after the hostname. The variable with the same name of the host will be replaced with the string following the colon. (LP: #196797) - Properly check to see if config stanza exists for host. (LP: #196786) - Updated version string to reflect current version. * dput.cf: Updated ppa stanza to make use of argument support. * dput.cf.5: Updated man page to note support for sftp transport and host args * dput.1: Updated man page to document host argument feature and sftp support. -- Cody A.W. Somerville Sat, 08 Nov 2008 10:51:36 -0500 dput (0.9.2.35) unstable; urgency=low * dput.cf: add ssh-upload pointing to ssh.upload.debian.org. Closes: #499731. -- Thomas Viehmann Mon, 22 Sep 2008 20:09:57 +0200 dput (0.9.2.34ubuntu1) intrepid; urgency=low * Merge from debian unstable, remaining changes: - In dput.cf, set ubuntu as default_host_main - In debian/control, set Ubuntu Core Dev as Maintainer and move Original maintainer to XSBC-Original-Maintainer - In dput, recognize 0ubuntu1 as a debian_version that requires an orig.tar.gz upload - Refix (LP: #17169) - Add 'progress_indicator = 2' to dput.cf, so that it is easier to detect how much dput has uploaded of the files. * Thanks to debian for taking almost all our changes! -- Sarah Hobbs Mon, 22 Sep 2008 11:04:57 +1000 dput (0.9.2.34) unstable; urgency=low [ Thomas Viehmann ] * Fix typo in description. * dput.cf: Disable gluck_delayed. Take out warning about delayed and ftp and put in warning about gluck_delayed. Closes: #497921. * dcut: Remove temporary files and not break on debsign failure. closes: #485711 * dcut: Adapt to new command interface. [ Y Giridhar Appaji Nag ] * Fix typo in dcut.1 (:s/commads/commands/g) * Change Debian upload queue README URL from that on ftp.up.ac.za to ftp://ftp-master.debian.org/pub/UploadQueue/README * Fix lintian W: command-with-path-in-maintainer-script * Add a 'allow_dcut' option for queues that can[not] handle dcut changes files (Closes: #481013) -- Thomas Viehmann Mon, 15 Sep 2008 23:08:09 +0200 dput (0.9.2.33) unstable; urgency=low * Leave progress_indicator as the default for mentors stanza * Rename ubuntu-revu to revu and add a new stanza for Ubuntu PPAs * Suggests: yaclc, thanks to Thijs Kinkhorst for the suggestion.(Closes: #377335) * Change revu fqdn from revu.tauware.de to revu.ubuntuwire.com * Mention dcut in the package description, thanks Steffen Moeller for the suggestion (Closes: #491716) * Fix syntax error in http.py that causes a traceback to be shown when an HTTP upload fails. Thanks Jonny Lamb for the bug report and the patch (Closes: #486555) * For dcut with scp, try to use $USER and user login ID (in that order) if login config variable it set to 'username'. Thanks Guido Trotter for the bug report and the patch (Closes: #490838) * Update Standards-Version to 3.8.0 (no changes required) * Add 'delayed = 7' to the gluck_delayed stanza, thanks Gerfried Fuchs for the suggestion (Closes: #489194) * Add a simple dcut usage example to dcut.1 (Closes: #486366) -- Y Giridhar Appaji Nag Thu, 21 Aug 2008 00:09:55 +0530 dput (0.9.2.32) unstable; urgency=high * don't use python2.5-only .partition. Closes: #479320 -- Thomas Viehmann Sun, 04 May 2008 11:55:03 +0200 dput (0.9.2.31) unstable; urgency=low Welcome the new co-maintainer! [ Y Giridhar Appaji Nag ] * Maintain dput in collab-maint on alioth in git. Add Vcs-Browser and Vcs-Git headers in debian/control * Catch EOFError. In default Pure-FTPd configuration, server closes the connection for anonymous FTP logins (Closes: #473558) * Fix lintian I: hyphen-used-as-minus-sign in dput.cf and lintian W: manpage-has-errors-from-man in dput.1 (.P.SH changed to .SH) * Add Y Giridhar Appaji Nag to Uploaders and add a DM-Upload-Allowed: yes header. * Allow port in FTP fqdn (defaults to 21), based on a patch submitted from Ubuntu by Daniel Hahler (Closes: #464600) * Add a mentors.debian.net stanza (called mentors) to dput.cf * dput Suggests mini-dinstall because it is used for the local method. Thanks Daniel Hahler for the patch (Closes: #464596) * Add "-o plusdirs" to "complete" in bash_completion, so that directories are also used in filename completion. Thanks Daniel Hahler for the patch (Closes: #464592) [ Thomas Viehmann ] * Allow -u to override running the gpg signature check implied by --check-only. Closes: #405269 * Switch getopt function to allow optional arguments. -- Thomas Viehmann Thu, 01 May 2008 20:56:59 +0200 dput (0.9.2.30) unstable; urgency=low * Fail if pre_upload_command (or post_upload_command) exits with an error code. * Add warning to the configuration of the security upload queues. Closes: #458628 * Add allowed_distributions field. The default configuration in dput.cf is to refuse UNRELEASED. Closes: #384702 -- Thomas Viehmann Mon, 28 Jan 2008 19:38:38 +0100 dput (0.9.2.29) unstable; urgency=low * Rework http(s) upload module to better deal with authentication (not send everything twice) and not read whole files for uploading. Closes: #458381 * Add [security-master], [security-master-unembargoed], [ubuntu], and [ubuntu-revu] stanzas, thanks to Steve Langasek for bug and patch. Closes: #457250 * Check number of words in .changes Files: line. Closes: #453821 * Remove non-us stuff. Based on patch by Thijs Kinkhorst, thanks! Closes: #376843 * Add better error message when .upload cannot be written to. Closes: #433840 * Add delayed config option. Thanks to Sean Finney for bug and patch. Closes: #444464 * dcut: Add -kkeyid option. Thanks to Christoph Berg for bug and patch. Closes: #329823 * Bump standards version to 3.7.3 (no changes needed) * Officially retire Christian Kurz and Steve Kowalik from uploaders. Thank you for your contributions! -- Thomas Viehmann Mon, 31 Dec 2007 21:10:08 +0100 dput (0.9.2.28) unstable; urgency=low * Add support for guessing distribution. Thanks to Christoph Berg for bug report and patch. Closes: #348755 * Don't use login name to scp command if empty. Closes: #427554, #237448 * Fix check_version to work with packages not in working dir. Closes: #426915 * Add [options] to help string. Thanks to Thijs Kinkhorst for bug and patch. Closes: #424910. * Mention dcut in dput(1) man page. Closes: #405620. * Add [volatile] and [backports.org] stanzas. Thanks to Martin Zobel-Helas and Steve Langasek. Closes: #420694, #433057 * Align = in dput.cf. Closes: #418758 -- Thomas Viehmann Sun, 15 Jul 2007 13:22:04 +0200 dput (0.9.2.27) unstable; urgency=low * http(s)/WebDAV uploads thanks to Ross Burton. Closes: #142023 * dcut: Don't leave stray directories. Closes: #380356 * dput: - Don't recommend -ol when -ol is passed. Closes: #376877 - Don't throw traceback when config file cannot be parsed. Closes: #376796 -- Thomas Viehmann Thu, 14 Dec 2006 17:34:47 +0100 dput (0.9.2.26) unstable; urgency=low * ftp.py: Only try to analyze error code for ftplib.Error exceptions. Closes: #378579 * Drop debconf note about configuration file change five years ago. Closes: #388887 * Convert debian/changelog to utf8. * Bump standards to 3.7.2, no changes necessary. * Suggest openssh-client in debian/control. Closes: #394074. Thanks Julien Danjou. * Fix typos in documentation, thanks to Thijs Kinkhorst and Lars Wirzenius. Closes: #377334, #375454. * Show upload target. Closes: #316319. -- Thomas Viehmann Sat, 21 Oct 2006 18:41:52 +0200 dput (0.9.2.25) unstable; urgency=medium * Relax dependency on python. Several people have pointed out that caring about .pycs in dput is the overkill it seems to be. dput is thus installable with python 2.3 again. Closes: #374336. -- Thomas Viehmann Mon, 19 Jun 2006 22:40:50 +0200 dput (0.9.2.24) unstable; urgency=low * Bump python dependency for the transition. -- Thomas Viehmann Tue, 13 Jun 2006 23:09:50 +0200 dput (0.9.2.23) unstable; urgency=low * Don't include paths in .upload. Closes: #369885. -- Thomas Viehmann Tue, 13 Jun 2006 08:21:05 +0200 dput (0.9.2.22) unstable; urgency=low This is the best dput ever. And it took quite long to upload, too. * Change python version detection in postinst. Closes: #342330. * Christoph Berg sent in a whole lot of great patches. Thanks a lot! They contain - fixes for --help for delayed/0-day, - a minor fix for the synopis, - fixes for some typos in the README - removal of the tabs in the uploading code, making the code more readable - adding of debugging output in scp change_mode - suppresion of progress information when the output is not a terminal The two patches for wishlist bugs are still being considered, but this round closes #366923. -- Thomas Viehmann Sun, 28 May 2006 13:45:39 +0200 dput (0.9.2.21) unstable; urgency=low Let's fix some bugs while thinking about how to fix some others. * dcut: Use default host when appropriate. Closes: #340668. * dput.cf: Fix delayed queue comment. Closes: #332764. Thanks to Florian Ernst for the correction. * dcut.1: Update description to be more precise. Closes: #340670. Thanks to Eduard Bloch for his patch. * Added Swedish translation by Daniel Nylander. Tack! Closes: #331337. -- Thomas Viehmann Mon, 5 Dec 2005 21:41:34 +0100 dput (0.9.2.20) unstable; urgency=low * Add | debconf-2.0 to debconf-dependency. Thanks to Joey Hess for the reminders. * Use debsign to sign command files (so you can use devscripts.conf for key selection). Closes: #324183. * Add Vietnamese translation of debconf template. Thanks, Clytie Siddall. Closes: #313571. * Added Czech translation of debconf template. Thanks, Miroslav Kure. Closes: #315824. * Mention default_host in dput.1. Closes: #309934. * Describe the overriding of [host] in a later definition in dput.cf.5. Closes: #309975. * Remove old and unused ports of python functions from source. -- Thomas Viehmann Tue, 6 Sep 2005 19:00:57 +0200 dput (0.9.2.19) unstable; urgency=low * Fix dcut's handling of DEBEMAIL when it contains the full name. Closes: #302139. * Sorry, no wishlist today. -- Thomas Viehmann Wed, 6 Apr 2005 20:26:14 +0200 dput (0.9.2.18) unstable; urgency=low * Update bash_completion to skip commented hosts and reflect the delayed range. Bug report and patch by Johannes Berg. Thanks! Closes: #301247. * Print dcut hint if ftp upload fails with 553 (wrong filename). Closes: #285568. * Add guessing of maintainer name and email to dcut. Note that the actual bug (traceback) had been fixed before by printing out a more or less neat error message. Closes: #267649. * Switch roles with Christian in debian/control so people can find out faster who to put the blame on. * Updated copyright notices. -- Thomas Viehmann Fri, 25 Mar 2005 18:22:53 +0100 dput (0.9.2.17) unstable; urgency=low * Allow 0-day delayed upload. Yeah, some people want this, as it Closes: #273957. Fix manpage entry for the delayed option. * Recommend gluck_delayed for delayed uploads. Change the maximum delay to 15. Closes: #288436. * Add myself to Uploaders. -- Thomas Viehmann Wed, 9 Feb 2005 19:17:19 +0100 dput (0.9.2.16) unstable; urgency=low * Switch back to using passive ftp by default (as it was prior to 0.9.2.15) and change the documentation accordingly. Also try some guessing to instruct the user when we suspect that passive vs. active ftp is the problem. Closes: #283370 * Don't output the traceback when the ftp upload fails. -- Thomas Viehmann Mon, 17 Dec 2004 22:33:01 +0100 dput (0.9.2.15) unstable; urgency=low * More verbose error message for ftp uploads. And also use active ftp per default. (Closes: #268489) * Fix user name selection. * dcut: gracefully fail if no uploader was specified. (Closes: #268489) * Again thanks to Thomas Viehmann for providing the patches * Applied a patch from Matthew Palmer to improve the parsing of comma-seperated values by dput. (Closes: #279975) -- Christian Kurz Sat, 13 Nov 2004 22:21:06 +0100 dput (0.9.2.14) unstable; urgency=low * Added Dutch debconf translation. Thanks to Luk Claes. This will address his bugreport #245920. * Added support for passing additional ssh_config options. This is based on a suggestion (and loosely on a patch) by Stefan Völkel. Thanks! * Very minor cleanup of dput.cf(5). * Fixed the debug message output for ftp connections. A patch for dcut was provided by Dann Frazier. The change for dput was based on it. Thanks! -- Christian Kurz Tue, 15 Jun 2004 19:48:38 +0200 dput (0.9.2.13) unstable; urgency=low * Added Japanese debconf translations. This fixes the bugreport #227825. * Added duct and duct.1 manpage to create and upload .command files. This will address the wishlist request #224524. Thanks to Thomas Viehmann for contributing that code. * dput will now recognize the options -P and --passive for passive ftp. This fixes the bug report #228826. * This also includes a patch from Thomas Viehmann to fix an incorrect debug message. #224404 -- Christian Kurz Wed, 21 Jan 2004 13:34:03 +0100 dput (0.9.2.12) unstable; urgency=low * And another release for which I've to add a big THANK YOU Thomas. * Changed python dependency. This will fix the bug reported as #206037. * Added an option fqdn to the local defintion. This will address the problem reported as #210322. * Fixed a broken debug message, that was reported as bug #224404. -- Christian Kurz Tue, 6 Jan 2004 22:47:03 +0100 dput (0.9.2.11) unstable; urgency=low * Removed the host chiark from the configuration file, since it's not available anymore according to Ross Burton. This will fix the bug that he reported as #190744. * Increased the allowed range of days for the delayed argument. This wil address the bugreport #196561. * Applied a patch from Thomas Viehmann to reformat the warning about lintian and the option -o. This issue was reported as bug #199905. * Applied a patch from Thomas Viehmann to support the usage of ~ for the local upload method. This issue was reported as bug #199912. * From now on, this package will use po-debconf for managing the translation of the debconf note. This change was introduced due to the work of Christian Perrier. This will address the issue reported as #200127. * Applied another patch from Thomas Viehmann to output an error message if the execution of an external command fails. This will address the issue reported as #172528. -- Christian Kurz Tue, 29 Apr 2003 11:09:06 +0200 dput (0.9.2.10) unstable; urgency=low * Thanks to the offer from Thomas Viehmann, dput will now have two maintainers taking care of it. * Included a patch from Thomas Viehmann suppress error messages from dpkg which happened when the installed check was used. This will close the problem reported as #154960. * The option -o will now reliable simulate a normal run thanks to another patch from Thomas Viehmann. This will address the issue reported as #149711. * dput will now check the architecture in the installed packages check thanks to a patch from Thomas Viehmann. So the bug #154959 will now also be solved. * Also dput will now not fail when trying to use a delayed directory, but instead report an error. And again thanks to Thomas Viehmann for the patch to solve the bug #182922. * Fixed bare debug statement that should have been caught earlier. This will now finally solve bug #133287. * Changed dependency on python to also include python 2.3 as requested by Robert Millan. He also verified that the basic functionality still works fine with the newer python version. So this will address the issue reported as bug #182800. -- Christian Kurz Wed, 12 Mar 2003 21:52:18 +0100 dput (0.9.2.9) unstable; urgency=low * Another bugfix, because something broke the rsync upload method. A dummy variable will take care of this. (Closes: #171006) -- Christian Kurz Sun, 1 Dec 2002 16:39:27 +0100 dput (0.9.2.8) unstable; urgency=low * Bah, Christian doesn't need to be in Uploaders. * Fix one case I missed in the local method doesn't need a fqdn set madness. -- Steve Kowalik Sun, 10 Nov 2002 23:12:16 +1100 dput (0.9.2.7) unstable; urgency=low * Add myself to Uploaders, which Christian's permission. * Bump Standards-Version to 3.5.7. * Change code that picks the method. It makes sense now. * Apply 2 small hacks so that hosts that use the local method don't need to specify a fqdn. (Closes: #165634) * Change /etc/dput.cf to reflect the above. -- Steve Kowalik Mon, 4 Nov 2002 02:10:15 +1100 dput (0.9.2.6.7) unstable; urgency=low * And another NMU, with shorty's blessing. * Add a slash to non-US. (Closes: #162363) * Fix up most of the string.{r,}find and string.split madness. * Apply a rather large patch from Roland Mas . His changes are below: - Added a (very simple) module called local.py (derived from scp.py by Roland Mas ), to install to local incoming dirs. This can be useful to users of mini-dinstall. - Added a French translation to the Debconf template. - Fixed a Lintian error. - A few grammar fixes in the FAQ and README files. - Added a /etc/bash_completion.d/dput file, to make dput easier to use to -addicteb people like me. - Thanks Roland! (Closes: #164385) -- Steve Kowalik Wed, 16 Oct 2002 22:37:45 +1000 dput (0.9.2.6.6) unstable; urgency=low * Another NMU. * Don't set /usr/doc symlink. * Update version reported by 'dput --version' from 0.9.2.2. * Use readlink in postinst. (Closes: #162392) -- Steve Kowalik Fri, 27 Sep 2002 00:52:36 +1000 dput (0.9.2.6.5) unstable; urgency=low * Non-Maintainer Upload. * debian/templates: split into individual templates, and add a Russian translation (thanks, Ilgiz Kalmetev; closes: #137640). * debian/rules: use debconf-mergetemplates to install the templates. * debian/control: + transition to python2.2 (closes: #158312). + add a build dependency on debconf-utils (>= 1.1.1). * dput: patch from Mark Brown to make dput call dinstall from the correct install directory, when doing delayed uploads (closes: #155038). -- Jordi Mallach Sat, 31 Aug 2002 00:29:23 +0200 dput (0.9.2.6.4) unstable; urgency=low * Yet another NMU. * Fix up the call to getopt. (Closes: #155847) (thanks, Joey Hess.) * Don't assume ftp-master and non-us are the only hosts that have a delayed queue. (thanks, Robert McQueen.) -- Steve Kowalik Sat, 10 Aug 2002 21:07:38 +1000 dput (0.9.2.6.3) unstable; urgency=low * Another NMU. * Fix up dput -h, and the manpage. -- Steve Kowalik Mon, 29 Jul 2002 21:38:27 +1000 dput (0.9.2.6.2) unstable; urgency=low * NMU, with shorty's blessing. * Apply my own patch to add DELAYED support. (-e command line argument, no support for config file.) * Thanks to Moshe Zadka for his last minute help getting it working. -- Steve Kowalik Sat, 1 Jun 2002 01:20:32 +1000 dput (0.9.2.6.1) unstable; urgency=low * NMU * Moving to main. -- Steve Kowalik Mon, 27 May 2002 22:49:47 +1000 dput (0.9.2.6) unstable; urgency=low * Changed lstat to stat for calculating file size. -- Christian Kurz Tue, 23 Apr 2002 10:08:02 +0200 dput (0.9.2.5) unstable; urgency=low * Fixed -o option. -- Christian Kurz Tue, 16 Apr 2002 09:15:15 +0200 dput (0.9.2.4) unstable; urgency=low * Included "--copy-links" to rsync. -- Christian Kurz Sun, 7 Apr 2002 13:01:05 +0200 dput (0.9.2.3) unstable; urgency=low * Check for NODATA tag in GnuPG output. (Closes: #140646) -- Christian Kurz Tue, 2 Apr 2002 09:23:47 +0200 dput (0.9.2.2) unstable; urgency=low * Changed error message for simulate process. (Closes: #138191) -- Christian Kurz Thu, 14 Mar 2002 13:50:21 +0100 dput (0.9.2.1) unstable; urgency=low * Changed output of -H option. (Closes: #118735) * Fixed typos in manpage. (Closes: #119343) * Integrated a patch from Steven Baker to parse the GnuPG output instead of depending on the exit value. (Closes: #122821) -- Christian Kurz Thu, 24 Jan 2002 09:17:24 +0100 dput (0.9.2) unstable; urgency=low * Bug fixed, that never occured during tests. (Closes: #118579) * Heading heavily towards a 1.0 release, which means ConfigParser2 and spawnvef are finally removed, since newer python don't need need this files anymore. -- Christian Kurz Fri, 9 Nov 2001 12:17:38 +0100 dput (0.9.1) unstable; urgency=low * Fixed explanation of dinstall checks in description. (Closes: #118134) * Rewrote module import code. (Closes: #118579) * New Option to list hosts with their handle and fqdn. (Closes: #118659) -- Christian Kurz Tue, 6 Nov 2001 22:08:05 +0100 dput (0.9.0.1) unstable; urgency=low * Applied patch from Steven Kowalik to fix the postinst. (Closes: #118483) -- Christian Kurz Tue, 6 Nov 2001 16:05:22 +0100 dput (0.9.0) unstable; urgency=low * Added support for verifying sha checksums. * Added passive ftp support. * Updated documentation. * Removed upload queue giano. (Closes: #113297) * Ensured that anon-ftp uploads are really anon-ftp uploads. * Introduced new option to active passive ftp from the command line. * Minor Code fixes, changes and cleanups. * Fixed Dependency according to suggestion in the forth-coming python policy. * Modified postinst according to the sample from python2.1-base. * Added the FAQ as new document. -- Christian Kurz Sat, 22 Sep 2001 20:25:10 +0200 dput (0.8.9.1) unstable; urgency=low * Moved package to non-US instead. (Closes: #113156) -- Christian Kurz Sat, 22 Sep 2001 19:38:59 +0200 dput (0.8.9) unstable; urgency=low * Changed output comment for lintian. (Closes: #110568) * Fixed wrong code to execute upload method. (Closes: #110807) * Applied patch from Steve Kowalik to support using compression on scp uploads. * Now we added a dependency on GnuPG. (Closes: #110913) * Changed a bit the code for executing GnuPG. (Closes: #109662) * Initializing now all variables. (Closes: #111564) -- Christian Kurz Wed, 29 Aug 2001 21:47:44 +0200 dput (0.8.8) unstable; urgency=low * Included a message to show that lintian is running. (Closes: #105257 * Changed code to call dinstall to work correctly. This has been reported by Martin Michlmayr. (Closes: #105481) * Rewrote login and method changing function. (Closes: #107559) * Added Brazilian portuguese debconf translation from Andre Luis Lopes. (Closes: #108520) * Small typo fixes. -- Christian Kurz Sun, 15 Jul 2001 11:30:02 +0200 dput (0.8.7) unstable; urgency=low * Included another "ugly" hack to guess the right upload host. Since no policy enforces one true writing, maybe some of the checks should be made case-insensitive. (Closes: #103247) * Included a patch from Martin Michlmayr to remove one exception. (Closes: #98002) * Fixed the path in the postinst to be hardcoded to the debian python one because we use a compileall.py which is different from the upstream. (Closes: #103721) -- Christian Kurz Tue, 3 Jul 2001 07:20:55 +0200 dput (0.8.6) unstable; urgency=low * Now we also check the size of the binary files to upload. * Added some comments to the code. * Rewrote version_check. * Fixed broken code to calculate and test the package size. * Fixed broken dput.cf, which has been noticed by JP Sugarbroad. (Closes: #102277) -- Christian Kurz Tue, 12 Jun 2001 16:22:23 +0200 dput (0.8.5) unstable; urgency=low * Incorporated an idea from Steve M. Robbins to define a default host for main and non-us with some fall back. * Fixed a typo in the scp upload which has been noted by Decklin Foster. (Closes #100476) * Included some hacks to make everything work smooth again. -- Christian Kurz Mon, 4 Jun 2001 09:40:17 +0200 dput (0.8.4) unstable; urgency=low * Added --progress to rsync to some progress indicator. * Fixed now upload_logfile_creation. (Closes: #98947) * Fixed scp upload definitely now. Thanks to JP Sugarbroad for catching the wrong fix. (Closes: #99300) * Fixed the broken chown command in scp upload. -- Christian Kurz Mon, 28 May 2001 20:49:59 +0200 dput (0.8.3) unstable; urgency=low * Fixed broken scp.py noted by Adrian Bunk. (Closes: #97047) * Integrated a patch from JP Sugarbroad to fix scp.py. (Closes: #97371) * Fixed the broken ftp-upload method, thanks to Martin Michlmayr for noticing it. (Closes: #97751) * Increased the version number of dput itself. (Closes: #97786) * Incorporated a hack because of a missing unique seperator between upstream version number and debian version number. (Closes: #97830) * Fixed broken command-line parser which has also been noticed by Martin Michlmayr. (Closes: #97785) * Some more asthetic patches by the "code artist" ;) Martin Michlmayr. (Closes: #98003) * Changed the code a bit more, so that we now also have a commands before the upload available. * Added a suggestion for rsync. * Fixed Upload Method for ftp-master. (Closes: #98745) * Changed names from ftp-master-scp and non-us-scp to ftp-master-secure and non-us-secure, since those host are also supported by the rsync upload method. -- Christian Kurz Fri, 11 May 2001 18:46:20 +0200 dput (0.8.2) unstable; urgency=low * Fixed the broken version_check() after Laurence J. Lane pointed me to it. (Closes: #95462) * And now we had to fix the simulate option since we broke it. Now simulating an upload should work again. Thanks to Matt Kraai for catching that one. (Closes: #95520) * Changed version_check to handle a package that is in state not-installed correctly as not installed on the system instead of assuming that it's installed. (Closes: #95941) * Changed wording of -V switch according to a suggestion from André Dahlqvist. * Changed scp to change permission on file. (Closes: #96366) * Changed the incoming path for non-us in dput.cf (Closes: #94852) * Specified username and password for the UploadQueues in dput.cf. * Removed Option -U, since it will be default. * Changed dput to handle the new gpg output. (Closes: #96438) -- Christian Kurz Fri, 27 Apr 2001 20:48:36 +0200 dput (0.8.1) unstable; urgency=low * Fixed two typos. (Closes: #93582) * Import also sys module in scp. (Closes: #93701) * Fixed binary only uploads. * Fixed some typos. (Closes: #94044) * Added German debconf translation from Sebastian Feller. (Closes: #94274) * Added Spanish debconf translation from Jordi Mallach. -- Christian Kurz Wed, 11 Apr 2001 22:14:11 +0200 dput (0.8) unstable; urgency=low * Switch to the rfc822 module to parse the .changes file. Thanks to Sean 'Shaleh' Perry for contributing this patch to dput. * New Option -U/--username introduced to extract the username from the enviroment. * Now the manpage shows where to name the host to upload too. * And the feature of running dinstall will now also work again. (Closes: #90101) * New Option -V/--check-version to check if the user has tested the package before putting it on the ftp-server. * Fix the call to lintian to work correctly with the current lintian implemenatation in perl. * Changed dput to use a modular concept for including upload functions. This has been suggested by Wichert Akkerman and the necessary patch has been created by Sean 'Shaleh' Perry. For more information about this look into the manpages. * Changed format of the config-file. (Closes: #88681) * Added a debconf note about the config-file change, only shown in upgrades from old versions. * Now we should be able to handle multiple .changes-files correctly. (Closes: #89104) * Now will now require a .dsc-file only if you do a source upload. In case of a binary upload, no such file is required anymore. (Closes: #89105) * Warning for a missing tar.gz or orig.tar.gz will only appear when really such a archive is missing. (Closes: #89936) * And now dput will correctly try to start dinstall and run it, if the user wants to do so. (Closes: #90101) * Oh, we also incorporated the UploadQueue on non-us as the default incoming directory for packages. (Closes: #92419) * Changed filename detection to handle all architectures. (Closes: #93155) -- Christian Kurz Fri, 23 Mar 2001 23:42:57 +0100 dput (0.7.1) unstable; urgency=low * Bugfix release, since the orig.tar.gz-check was broken. * Also fixed the broken upload_check. -- Christian Kurz Thu, 22 Mar 2001 10:18:58 +0100 dput (0.7) unstable; urgency=low * Changed some wording to sound better. (Closes: #88685) * Applied a patch from Sean 'Shaleh' Perry to parse a .dput.cf file on top of the system-wide /etc/dput.cf file. (Closes: #88684) * Explained some features in the README and also changed the description to name some of the features. * Changed behaviour to correctly identify the host where the upload should be put to, even when using multiple files. (Close: #89104) * Rewrote parser for the .changes file to also handle binary-only uploads from now on. * Rewrote error message if you named any other file then a .changes file on the command line. -- Christian Kurz Thu, 15 Mar 2001 22:00:26 +0100 dput (0.6) unstable; urgency=low * Included new manpages from Jordi Mallach. * Minor Code Cleanup. * Added -d/--debug to get debugging info if needed. * Now dput will refuse to start an upload until the maintainer really named the .changes file. ;) * Modified standard dput.cf to prefer scp over ftp. * Corrected behaviour of guessing the upload host to only guess it, when no host is named on the command line. * Added option run_dinstall to do a dry run of dinstall on the just uploaded files. Also there's the commandline option -D/--dinstall for this purpose. -- Christian Kurz Thu, 1 Mar 2001 22:14:53 +0100 dput (0.5) unstable; urgency=low * Removed COPYING from debian package and added copyright file. * Added option -l/--lintian and config-file option run_lintian to support the usage of lintian before the upload happens. * For some of our lazy maintainers ;) dput will guess the correct host to upload the package to. * Moved some more code into it's own function. -- Christian Kurz Sun, 25 Feb 2001 20:47:58 +0100 dput (0.4) unstable; urgency=low * The Test for tar.gz. should also handle debian native packages correctly and packages with an epoch. * Uploading of non-US software to an host != non-US will give an error message and refuse to work. * The scp upload will now run in Batched mode, so you need to enter your passphrase only once. * Fixed upload of packages, since I forgot to upload the * changes-file. * Added a manpage for dput.cf. * Support rsync uploads. -- Christian Kurz Sun, 25 Feb 2001 18:07:31 +0100 dput (0.3) unstable; urgency=low * Added option -c/--config to allow other config files. * Added option -o/--check-only for running only some checks against the package. * Now the signature test will also be run on the dsc-file. * Check for orig.tar.gz or tar.gz files in the upload and warn the user of they are not needed. This should also handle debian native packages correctly and packages with an epoch. * Uploading of non-US software to an host != non-US will give an error message and refuse to work. * The scp upload will now run in Batched mode, so you need to enter your passphrase only once. * Fixed upload of packages, since I forgot to upload the changes-file. * Added a manpage for dput.cf. -- Christian Kurz Mon, 19 Feb 2001 22:00:01 +0100 dput (0.2) unstable; urgency=low * Merged two config files into one config file. * Rewrote dput to use the single config file. -- Christian Kurz Mon, 19 Feb 2001 20:58:41 +0100 dput (0.1) unstable; urgency=low * Initial Release. -- Christian Kurz Mon, 19 Feb 2001 15:44:33 +0100 dput-0.9.6.4ubuntu3/http.py0000644000000000000000000001102312252030044012376 0ustar import os, sys, httplib, urllib2, urlparse, getpass, dputhelper # note: requires >= python 2.4 httplib # Custom password manager that prompts for a password using getpass() if # required, and mangles the saved URL so that only one password is prompted for. class PromptingPasswordMgr(urllib2.HTTPPasswordMgr): def __init__(self, username): urllib2.HTTPPasswordMgr.__init__(self) self.username = username def find_user_password(self, realm, authuri): # Hack so that we only prompt for a password once authuri = self.reduce_uri(authuri)[0] authinfo = urllib2.HTTPPasswordMgr.find_user_password(self, realm, authuri) if authinfo != (None, None): return authinfo password = getpass.getpass(" Password for %s:" % realm) self.add_password(realm, authuri, self.username, password) return (self.username, password) class AuthHandlerHackAround: # fake request and parent object... def __init__(self, url, resp_headers, pwman): # fake request header dict self.headers = {} # data self.url = url self.resp_headers = resp_headers self.authhandlers = [] self.timeout = {} # digest untested for authhandler_class in [urllib2.HTTPBasicAuthHandler, urllib2.HTTPDigestAuthHandler]: ah = authhandler_class(pwman) ah.add_parent(self) self.authhandlers.append(ah) # fake request methods def add_header(self, k, v): self.headers[k] = v def add_unredirected_header(self, k, v): self.headers[k] = v def get_full_url(self): return self.url # fake parent method def open(self,*args,**keywords): pass # and what we really want def get_auth_headers(self): for ah in self.authhandlers: try: ah.http_error_401(self, None, 401, None, self.resp_headers) except ValueError, e: pass if self.headers: return self.headers return self.headers # Upload the files via WebDAV def upload(fqdn, login, incoming, files_to_upload, debug, dummy, progress=0, protocol="http"): # EXCEPTION HANDLING! if protocol == 'https': connclass = httplib.HTTPSConnection elif protocol == 'http': connclass = httplib.HTTPConnection else: print >> sys.stderr, "Wrong protocol for upload http[s].py method" sys.exit(1) if not incoming.startswith('/'): incoming = '/'+incoming if not incoming.endswith('/'): incoming += '/' unprocessed_files_to_upload = files_to_upload[:] auth_headers = {} pwman = PromptingPasswordMgr(login) while unprocessed_files_to_upload: afile = unprocessed_files_to_upload[0] path_to_package, package_name = os.path.split(afile) # print without linefeed sys.stdout.write(" Uploading %s: "% package_name) sys.stdout.flush() try: size = os.stat(afile).st_size except: print >> sys.stderr, "Determining size of file '%s' failed"%afile sys.exit(1) f = open(afile,'r') if progress: f = dputhelper.FileWithProgress(f, ptype=progress, progressf=sys.stderr, size=size) url_path = incoming+package_name url = "%s://%s%s" % (protocol,fqdn,url_path) if debug: print "D: HTTP-PUT to URL: %s"%url conn = connclass(fqdn) conn.putrequest("PUT", url_path, skip_accept_encoding=True) # Host: should be automatic conn.putheader('User-Agent','dput') for k, v in auth_headers.items(): conn.putheader(k, v) conn.putheader('Connection','close') conn.putheader('Content-Length',str(size)) conn.endheaders() pos = 0 while pos < size: s = f.read(65536) # sending in 64k steps (screws progress a bit) conn.send(s) pos += len(s) f.close() s = "" res = conn.getresponse() if res.status >= 200 and res.status < 300: print "done." del unprocessed_files_to_upload[0] elif res.status == 401 and not auth_headers: print "need authentication." auth_headers = AuthHandlerHackAround(url, res.msg, pwman).get_auth_headers() else: if res.status == 401: print "Upload failed as unauthorized: %s"%res.reason print " Maybe wrong username or password?" else: print "Upload failed:", res.status, res.reason sys.exit(1) res.read() # must be done, but we're not interested dput-0.9.6.4ubuntu3/dput.cf0000644000000000000000000000553012357470761012365 0ustar # Example dput.cf that defines the host that can be used # with dput for uploading. [DEFAULT] login = * method = ftp hash = md5 allow_unsigned_uploads = 0 allow_dcut = 0 run_lintian = 0 run_dinstall = 0 check_version = 0 scp_compress = 0 post_upload_command = pre_upload_command = passive_ftp = 1 default_host_main = ubuntu allowed_distributions = (?!UNRELEASED) progress_indicator = 2 [ftp-master] fqdn = ftp.upload.debian.org incoming = /pub/UploadQueue/ login = anonymous allow_dcut = 1 method = ftp # Please, upload your package to the proper archive # http://www.debian.org/doc/manuals/developers-reference/pkgs.html#bug-security-upload allowed_distributions = (?!UNRELEASED|.*-security) # http://lists.debian.org/debian-project/2009/05/msg00036.html [ftp-eu] fqdn = ftp.eu.upload.debian.org method = ftp incoming = /pub/UploadQueue/ login = anonymous allow_dcut = 1 # Please, upload your package to the proper archive # http://www.debian.org/doc/manuals/developers-reference/pkgs.html#bug-security-upload allowed_distributions = (?!UNRELEASED|.*-security) # http://lists.debian.org/debian-devel-announce/2008/09/msg00007.html [ssh-upload] login = * # login = another_username fqdn = ssh.upload.debian.org method = scp incoming = /srv/upload.debian.org/UploadQueue/ allow_dcut = 1 # Please, upload your package to the proper archive # http://www.debian.org/doc/manuals/developers-reference/pkgs.html#bug-security-upload allowed_distributions = (?!UNRELEASED|.*-security) # And if you want to override one of the defaults, add it here. # For example, comment out the next line # post_upload_command = /path/to/some/script # pre_upload_command = /path/to/some/script [security-master] fqdn = security-master.debian.org method = ftp incoming = /pub/SecurityUploadQueue login = anonymous allow_dcut = 1 # This has been added at the request of the security team. # Please be sure to know what you are doing before taking it out. pre_upload_command = /usr/share/dput/helper/security-warning [security-master-unembargoed] fqdn = security-master.debian.org method = ftp incoming = /pub/OpenSecurityUploadQueue login = anonymous allow_dcut = 1 # This has been added at the request of the security team. # Please be sure to know what you are doing before taking it out. pre_upload_command = /usr/share/dput/helper/security-warning [ubuntu] fqdn = upload.ubuntu.com method = ftp incoming = /ubuntu login = anonymous [revu] fqdn = revu.ubuntuwire.com method = ftp incoming = /incoming login = anonymous [ppa] fqdn = ppa.launchpad.net method = ftp incoming = ~%(ppa)s login = anonymous [mentors] method = ftp fqdn = mentors.debian.net incoming = . login = anonymous [local] method = local incoming = ~/public_html/debian/mini-dinstall/incoming run_dinstall = 0 post_upload_command = /usr/bin/mini-dinstall --batch dput-0.9.6.4ubuntu3/dputhelper.py0000644000000000000000000001135412252030044013602 0ustar # wrap spawnv with error output import os, sys class DputException(Exception): pass class DputUploadFatalException(DputException): pass def spawnv(mode, file, args): ret = os.spawnv(mode,file,args) if ret == 127: print "Error: Failed to execute '"+file+"'." print " The file may not exist or not be executable." elif ret != 0: print "Warning: The execution of '"+file+"' as" print " '"+" ".join(args)+"'" print " returned a nonzero exit code." return ret class TimestampFile: def __init__(self, f): global time import time self.f = f self.buf = "" def __getattr__(self, name): return getattr(self.f, name) def write(self, s): self.buf += s idx = self.buf.find('\n') while idx>=0: self.f.write(str(time.time())+': '+self.buf[:idx+1]) self.buf = self.buf[idx+1:] idx = self.buf.find('\n') def close(self): if self.buf: self.f.write(str(time.time())+': '+self.buf) self.buf = "" f.close() class FileWithProgress: # FileWithProgress(f, args) # mimics a file (passed as f, an open file), but with progress. # args: ptype = 1,2 is the type ("|/-\" or numeric), default 0 (no progress) # progressf = file to output progress to (default sys.stdout) # size = size of file (or -1, the default, to ignore) # for numeric output # step = stepsize (default 1024) def __init__ (self, f, ptype=0, progressf=sys.stdout, size=-1, step=1024): self.f = f self.count = 0 self.lastupdate = 0 self.ptype = ptype self.ppos = 0 self.progresschars = ['|','/','-','\\'] self.progressf = progressf self.size=size self.step=step self.closed=0 def __getattr__(self, name): return getattr(self.f, name) def read(self, size=-1): a = self.f.read(size) self.count = self.count + len(a) if (self.count-self.lastupdate)>1024: if self.ptype == 1: self.ppos = (self.ppos+1)%len(self.progresschars) self.progressf.write((self.lastupdate!=0)*"\b"+ self.progresschars[self.ppos]) self.progressf.flush() self.lastupdate = self.count elif self.ptype == 2: s = str(self.count/self.step)+"k" if self.size >= 0: s += '/'+str((self.size+self.step-1)/self.step)+'k' s += min(self.ppos-len(s),0)*' ' self.progressf.write(self.ppos*"\b"+s) self.progressf.flush() self.ppos = len(s) return a def close(self): if not self.closed: self.f.close() self.closed = 1 if self.ptype==1: if self.lastupdate: self.progressf.write("\b \b") self.progressf.flush() elif self.ptype==2: self.progressf.write(self.ppos*"\b"+self.ppos*" "+self.ppos*"\b") self.progressf.flush() def __del__(self): self.close() def getopt(args, shortopts, longopts): args = args[:] optlist = [] while args and args[0].startswith('-'): if args[0] == '--': args = args[1:] break if args[0] == '-': break if args[0].startswith('--'): opt = args.pop(0)[2:] if '=' in opt: opt, optarg = opt.split('=',1) else: optarg = None prefixmatch = filter(lambda x: x.startswith(opt), longopts) if len(prefixmatch) == 0: raise DputException('unknown option --%s'%opt) elif len(prefixmatch) > 1: raise DputException('non-unique prefix --%s'%opt) opt = prefixmatch[0] if opt.endswith('=='): opt = opt[:-2] optarg = optarg or '' elif opt.endswith('='): opt = opt[:-1] if not optarg: if not args: raise DputException('option --%s requires argument'%opt) optarg = args.pop(0) else: if optarg != None: raise DputException('option --%s does not take arguments'%opt) optarg = '' optlist.append(('--'+opt, optarg)) else: s = args.pop(0)[1:] while s: pos = shortopts.find(s[0]) if pos == -1: raise DputException('option -%s unknown'%s[0]) if pos+1 >= len(shortopts) or shortopts[pos+1]!=':': optlist.append(('-'+s[0],'')) s = s[1:] elif len(s) > 1: optlist.append(('-'+s[0],s[1:])) s = '' elif args: optlist.append(('-'+s, args.pop(0))) s = '' else: raise DputException('option -%s requires argument'%s) return optlist, args if __name__ == '__main__': import time for i in range(1,3): sys.stdout.write("Reading dput ") sys.stdout.flush() a=FileWithProgress(open('/usr/bin/dput'),ptype=i,size=os.stat('/usr/bin/dput').st_size) b=' ' while b: b=a.read(4096) time.sleep(1) a.close() print dput-0.9.6.4ubuntu3/copyright0000644000000000000000000000220012252030044012775 0ustar This package was written by Christian Kurz on Fri, 25 Feb 2001 20:47:35 +0100. The following copyright applies to this package: Copyright (c) 2001,2002,2003,2004,2005 Christian Kurz. Copyright (c) 2004,2005,2006,2007,2008,2009 Thomas Viehmann. Copyright (c) 2008,2009 Y Giridhar Appaji Nag This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA On Debian GNU/Linux systems, the complete text of the GNU General Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. dput-0.9.6.4ubuntu3/dput0000755000000000000000000011102012252030044011745 0ustar #!/usr/bin/python # dput - debian package upload tool # (c) 2000,2001,2002,2003,2004,2005 Christian Kurz # (c) 2006,2007,2008 Thomas Viehmann # (c) 2008,2009 Y Giridhar Appaji Nag # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os, sys, string, re, glob, signal import pwd, stat, rfc822 from hashlib import md5, sha1 # Now import our modules import ConfigParser sys.path.insert(0,'/usr/share/dput/helper') import dputhelper dput_version = "dput 0.9.6" config = None upload_methods = {} files_to_upload = [] simulate = unsigned_upload = delay_upload = 0 debug = dinstall = check_only = 0 config_file = '' dput_modules = ('') # Function to import files from the /usr/share/dput and make them available # to this script def import_upload_functions(): files_to_import = glob.glob('/usr/share/dput/*.py') for file in files_to_import: if debug: print "D: File: %s" % file base = os.path.basename(file) if len(dput_modules) != 0: if base not in dput_modules: base = os.path.splitext(base)[0] else: base = os.path.splitext(base)[0] if debug: print "D: Base: %s" % base d = {} try: exec open(file) in d if debug: print "Imported: %s" % file except IOError: print "Couldn't import %s" % file continue register_upload_function(base, d['upload']) # add function to upload_methods dictionary using key of name def register_upload_function(name, function): global upload_methods upload_methods[name] = function # parse the changes file def parse_changes(chg_fd): check = chg_fd.read(5) if check != '-----': chg_fd.seek(0) else: # found a PGP header, gonna ditch the next 3 lines chg_fd.readline() # eat the rest of the line chg_fd.readline() # Hash: SHA1 chg_fd.readline() # empty line if not chg_fd.readline().find('Format') != -1: chg_fd.readline() changes = rfc822.Message(chg_fd) for a in changes.dict['files'].split('\n'): if len(a.split()) != 5: print >> sys.stderr, "Invalid Files line in .changes:\n %s"%a sys.exit(1) return changes # read configs in this order: # if specified on the command line, only read extra_config # otherwise, read /etc/dput.cf then ~/.dput.cf # the config parser will layer values def read_configs(extra_config, debug): global config config = ConfigParser.ConfigParser() config.set('DEFAULT', 'login', 'username') config.set('DEFAULT', 'method', 'scp') config.set('DEFAULT', 'hash', 'md5') config.set('DEFAULT', 'allow_unsigned_uploads', '0') config.set('DEFAULT', 'allow_dcut', '0') config.set('DEFAULT', 'distributions', '') config.set('DEFAULT', 'allowed_distributions', '') config.set('DEFAULT', 'run_lintian', '0') config.set('DEFAULT', 'run_dinstall', '0') config.set('DEFAULT', 'check_version', '0') config.set('DEFAULT', 'scp_compress', '0') config.set('DEFAULT', 'default_host_main', '') config.set('DEFAULT', 'post_upload_command', '') config.set('DEFAULT', 'pre_upload_command', '') config.set('DEFAULT', 'ssh_config_options', '') config.set('DEFAULT', 'passive_ftp', '1') config.set('DEFAULT', 'progress_indicator', '0') config.set('DEFAULT', 'delayed', '') if extra_config: config_files = (extra_config,) else: config_files = ('/etc/dput.cf', os.path.expanduser("~/.dput.cf")) fd = None for config_file in config_files: try: fd = open(config_file) except IOError, e: if debug: print >> sys.stderr, '%s: %s, skipping' % (e[1], config_file) continue if debug: print "D: Parsing Configuration File %s" % config_file try: config.readfp(fd) except ConfigParser.ParsingError, e: print >> sys.stderr, "Error parsing config file:\n%s"%str(e) sys.exit(1) fd.close() if fd == None: print >> sys.stderr, 'Error: Could not open any configfile, tried %s' % \ (', '.join(config_files)) sys.exit(1) # only check for fqdn and incoming dir, rest have reasonable defaults error = 0 for section in config.sections(): if config.get (section,'method') == 'local': config.set(section,'fqdn','localhost') if not config.has_option(section, 'fqdn') and \ config.get(section, 'method') != 'local': print >> sys.stderr, 'Config error: %s must have a fqdn set' % section error = 1 if not config.has_option(section, 'incoming'): print >> sys.stderr, 'Config error: %s must have an incoming directory set' % \ section error = 1 if error: sys.exit(1) # Convert a hex string into readable characters. hexStr = string.hexdigits def hexify_string(string): char = '' for c in string: char = char + hexStr[(ord(c) >> 4) & 0xF] + hexStr[ord(c) & 0xF] return char # Function to generatea checksum for a file. # Currently supports md5, sha1. ripemd may come in the future. def checksum_test(filename,hash): try: file_to_test = open(filename, 'r') except IOError: print "Can't open %s" % filename sys.exit(1) if hash == 'md5': hash_type = md5 else: hash_type = sha1 check_obj = hash_type() while 1: data = file_to_test.read(65536) if len(data) == 0: break check_obj.update(data) file_to_test.close() checksum = hexify_string(check_obj.digest()) return checksum # Verify the GnuPG signature on a file. def check_signature(filename): if os.access(filename, os.R_OK): if os.access("/usr/bin/gpg", os.X_OK): stream = os.popen("/usr/bin/gpg --status-fd 1 --verify --batch %s" % filename).read() if stream.count('[GNUPG:] GOODSIG'): print "Good signature on %s." % filename elif stream.count('[GNUPG:] BADSIG'): print "Bad signature on %s." % filename sys.exit(1) elif stream.count('[GNUPG:] ERRSIG'): print "Error verifying signature on %s." % filename sys.exit(1) elif stream.count('[GNUPG:] NODATA'): print "No signature on %s." % filename sys.exit(1) else: print "Error in finding signature verification status." else: print "Can't verify signature on %s without GnuPG" % filename print "If you are still using PGP, please read this:" print "http://www.gnupg.org/gph/en/pgp2x.html" sys.exit(1) else: print "Can't read %s" % filename sys.exit(1) # Check if this is a binary_upload only or not. def check_upload_variant(changes, debug): binary_upload = 0 if changes.dict.has_key('architecture'): arch = changes.dict['architecture'] if debug: print "D: Architecture: %s" % arch if arch.find('source') < 0: if debug: print "D: Doing a binary upload only." binary_upload = 1 return binary_upload # Check the signature on the two files given via function call. def verify_signature(host, changes_file, dsc_file, check_only, debug, unsigned_upload, binary_upload): if debug: print "D: .changes-File: %s" % changes_file print "D: .dsc-File: %s" % dsc_file if ((check_only or config.getboolean(host, 'allow_unsigned_uploads') == 0) and unsigned_upload == 0): print "Checking signature on .changes" check_signature(changes_file) if not binary_upload: print "Checking signature on .dsc" check_signature(dsc_file) # Check if an orig.tar.gz or tar.gz has to be included in the package or not. def source_check(changes, debug): include_orig = include_tar = 0 if changes.dict.has_key('version'): version = changes.dict['version'] if debug: print "D: Package Version: %s" % version # versions with a dash in them are for non-native only if version.find('-') == -1: # debian native include_tar = 1 else: if version.find(':') > 0: if debug: print "D: Epoch found" epoch, version = version.split(':', 1) pos = version.rfind('-') upstream_version = version[0:pos] debian_version = version[pos+1:] if debug: print "D: Upstream Version: %s" % upstream_version print "D: Debian Version: %s" % debian_version if debian_version == '0.1' or debian_version == '1' \ or debian_version == '1.1' or debian_version == '0ubuntu1': include_orig = 1 else: include_tar = 1 return (include_orig, include_tar) # Run some tests on the files before uploading them to # verify that they are in good shape. def verify_files(path, filename, host, check_only, check_version, unsigned_upload, debug): file_seen = include_orig_tar_gz = include_tar_gz = binary_only = 0 name_of_file = filename change_file = os.path.join(path, name_of_file) if debug: print "D: Validating contents of changes file %s" % change_file try: chg_fd = open(change_file, 'r') except IOError: print "Can't open %s" % change_file sys.exit(1) changes = parse_changes(chg_fd) chg_fd.close # Find out if it's a binary only upload or not binary_upload = check_upload_variant(changes, debug) if binary_upload: dsc_file = '' else: dsc_file = None for file in changes.dict['files'].split('\n'): filename = string.split(file)[4] # filename only if filename.find('.dsc') != -1: if debug: print "D: dsc-File: %s" % filename dsc_file = os.path.join(path, filename) if not dsc_file: print >> sys.stderr, "Error: no dsc file found in sourceful upload" sys.exit(1) # Run the check to verify that the package has been tested. try: if config.getboolean(host, 'check_version') == 1 or check_version: version_check (path, changes, debug) except ConfigParser.NoSectionError, e: print >> sys.stderr, "Error in config file:\n%s" % str(e) sys.exit(1) # Verify the signature of the maintainer verify_signature(host, change_file, dsc_file, check_only, debug,\ unsigned_upload, binary_upload) # Check the sources (include_orig_tar_gz, include_tar_gz) = source_check(changes, debug) # Check md5sum and the size file_list = changes.dict['files'].split('\n') hash_to_use = config.get('DEFAULT','hash') for line in file_list: (check_sum, size, section, priority, file) = line.split() file_to_upload = os.path.join(path, file) if debug: print "D: File to upload: %s" % file_to_upload if checksum_test(file_to_upload,hash_to_use) != check_sum: if debug: print "D: Checksum from .changes: %s" % check_sum print "D: Generated Checksum: %s" % \ checksum_test(file_to_upload,hash_to_use) print "Checksum doesn't match for %s" % file_to_upload sys.exit(1) else: if debug: print "D: Checksum for %s is fine" % file_to_upload if os.stat(file_to_upload)[stat.ST_SIZE] != int(size): if debug: print "D: size from .changes: %s" % size print "D: calculated size: %s" % \ os.stat(file_to_upload)[stat.ST_SIZE] print "size doesn't match for %s" % file_to_upload files_to_upload.append(file_to_upload) # Check filenames for file in files_to_upload: if file[-12:] == '.orig.tar.gz' and not include_orig_tar_gz: if debug: print "D: Filename: %s" % file print "D: Suffix: %s" % file[-12:] print "Package includes an .orig.tar.gz file although the debian revision suggests" print "that it might not be required. Multiple uploads of the .orig.tar.gz may be" print "rejected by the upload queue management software." elif file[-7:] == '.tar.gz' and not include_tar_gz \ and not include_orig_tar_gz: if debug: print "D: Filename: %s" % file print "D: Suffix: %s" % file[-7:] print "Package includes a .tar.gz file although the version suggests that it might" print "not be required. Multiple uploads of the .tar.gz may be rejected by the" print "upload queue management software." distribution = changes.get('distribution') allowed_distributions = config.get(host, 'allowed_distributions') if distribution and allowed_distributions: if debug: print "D: Checking: distribution %s matches %s" % (distribution, allowed_distributions) if not re.match(allowed_distributions, distribution): raise dputhelper.DputUploadFatalException("Error: uploading files for distribution %s to %s not allowed."%(distribution, host)) if debug: print "D: File to upload: %s" % change_file files_to_upload.append(change_file) # Print the configuration and exit. def print_config(config, debug): print config.write(sys.stdout) print # Write a logfile of the upload and call it .upload def create_upload_file(package, host, path, files_to_upload, debug): base = os.path.splitext(package)[0] # only need first part logfile_name = os.path.join(path, base + '.' + host + '.upload') if config.get(host, 'method') == 'local': fqdn = 'localhost' else: fqdn = config.get(host, 'fqdn') if debug: print "D: Writing logfile: %s" % logfile_name try: if os.access(logfile_name, os.R_OK): logfile_fd = open(logfile_name, 'a') else: logfile_fd = open(logfile_name, 'w') except IOError: print >> sys.stderr, "Could not write %s"%logfile_name sys.exit(1) for file in files_to_upload: entry_for_logfile = 'Successfully uploaded ' + os.path.basename(file) + \ ' to ' + fqdn + ' for ' + host + '.\n' logfile_fd.write(entry_for_logfile) logfile_fd.close() # Run lintian on the changes file and stop if it finds errors. def run_lintian_test(changes_file): if os.access(changes_file, os.R_OK): if os.access("/usr/bin/lintian", os.R_OK): old_signal = signal.signal(signal.SIGPIPE, signal.SIG_DFL) print "Package is now being checked with lintian." if dputhelper.spawnv(os.P_WAIT, "/usr/bin/lintian", ['lintian', '-i', changes_file]): print print "Lintian says this package is not compliant" +\ " with the current policy." print "Please check the current policy and your package." print "Also see lintian documentation about overrides." sys.exit(1) else: signal.signal(signal.SIGPIPE, old_signal) return 0 else: print "lintian is not installed, skipping package test." else: print "Can't read %s" % changes_file sys.exit(1) # Guess the host where the package should be uploaded to. This is based # on information from the changes file. def guess_upload_host(path, filename): non_us = 0 distribution = "" dist_re = re.compile(r'^Distribution: (.*)') name_of_file = filename changes_file = os.path.join(path, name_of_file) try: changes_file_fd = open(changes_file, 'r') except IOError: print "Can't open %s" % changes_file sys.exit(1) lines = changes_file_fd.readlines() for line in lines: match = dist_re.search(line) if match: distribution = match.group(1) # Try to guess a host based on the Distribution: field if distribution: for section in config.sections(): host_dists = config.get(section, 'distributions') if not host_dists: continue for host_dist in host_dists.split(','): if distribution == host_dist.strip(): if debug: print "D: guessing host %s based on distribution %s" % (section, host_dist) return section if len(config.get('DEFAULT', 'default_host_main')) != 0: print "Trying to upload package to %s" % config.get('DEFAULT', 'default_host_main') return config.get('DEFAULT', 'default_host_main') else: print "Trying to upload package to ftp-master (ftp.upload.debian.org)" return "ftp-master" # Run dinstall in test-mode and present the output to the user so that # he can see if his package would be installed or not. def dinstall_caller(filename, host, login, incoming, debug): command = ['ssh', '%s@%s' % (login, config.get(host, 'fqdn')), 'cd', '%s' % incoming, ';', 'dinstall', '-n', '%s' % filename] if debug: print "D: Logging into %s@%s:%s" % (login, host, incoming) print "D: dinstall -n %s" % filename if config.getboolean(host, 'run_dinstall') == 1 or dinstall: if dputhelper.spawnv(os.P_WAIT, '/usr/bin/ssh', command): print "Error occured while trying to connect, or while " +\ "attempting to run dinstall." sys.exit(1) # Check if the caller has installed the package also on his system # for testing purposes before uploading it. If not, we reject the upload. def version_check(path, changes, debug): files_to_check = [] # Get arch dpkg_stdin,dpkg_stdout,dpkg_stderr = os.popen3('dpkg --print-architecture') dpkg_stdin.close() dpkg_architecture = dpkg_stdout.read().strip() dpkg_stdout.close() dpkg_stderr_output = dpkg_stderr.read() dpkg_stderr.close() if debug and dpkg_stderr_output: print "D: dpkg-architecture stderr output:",repr(dpkg_stderr_output) if debug: print "D: detected architecture: '%s'"%dpkg_architecture # Get filenames of deb files: for file in changes.dict['files'].split('\n'): filename = os.path.join(path, string.split(file)[4]) if filename.endswith('.deb'): if debug: print "D: Debian Package: %s" % filename dpkg_stdin,dpkg_stdout,dpkg_stderr = os.popen3('dpkg --field %s' % filename) dpkg_stdin.close() dpkg_output = rfc822.Message(dpkg_stdout) dpkg_stdout.close() dpkg_stderr_output = dpkg_stderr.read() dpkg_stderr.close() if debug and dpkg_stderr_output: print "D: dpkg stderr output:",repr(dpkg_stderr_output) if dpkg_architecture and dpkg_output['architecture'] not in ['all',dpkg_architecture]: if debug: print "D: not install-checking %s due to arch mismatch"%filename else: package_name = dpkg_output['package'] version_number = dpkg_output['version'] if debug: print "D: Package to Check: %s" % package_name if debug: print "D: Version to Check: %s" % version_number files_to_check.append((package_name,version_number)) for file,version_to_check in files_to_check: if debug: print "D: Name of Package: %s" % file dpkg_stdin,dpkg_stdout,dpkg_stderr = os.popen3('dpkg -s %s' % file) dpkg_stdin.close() dpkg_output = rfc822.Message(dpkg_stdout) dpkg_stdout.close() dpkg_stderr_output = dpkg_stderr.read() dpkg_stderr.close() if debug and dpkg_stderr_output: print "D: dpkg stderr output:",repr(dpkg_stderr_output) if dpkg_output.has_key('version'): installed_version = dpkg_output.dict['version'] if debug: print "D: Installed-Version: %s" % installed_version if debug: print "D: Check-Version: %s" % \ version_to_check if installed_version != version_to_check: print "Package to upload is not installed, but it appears " +\ "you have an older version installed." else: print "Uninstalled Package. Test it before uploading it." sys.exit(1) # Run a command that the user-defined in the config_file. def execute_command(host, debug, type): lookup_command = type + '_upload_command' if debug: print "D: Command: %s" % config.get(host, lookup_command) if os.system(config.get(host, lookup_command)): raise dputhelper.DputUploadFatalException("Error: %s upload command failed."%type) # Open a Logfile and check if the user already put # this package on the specified host or not: def check_upload_logfile(changes_file, host, check_only, call_lintian, force_upload, debug): uploaded = 0 upload_logfile = changes_file[:-8] + '.' + host + '.upload' if not check_only and not force_upload: if not os.path.exists(upload_logfile): return try: fd_logfile = open(upload_logfile) except IOError: print "Couldn't open %s" % upload_logfile sys.exit(1) for line in fd_logfile.readlines(): if config.get(host, 'method') == 'local': fqdn = 'localhost' else: fqdn = config.get(host, 'fqdn') if line.find(fqdn) != -1: uploaded = 1 if uploaded: print "Package has already been uploaded to %s on %s" % (host, fqdn) print "Nothing more to do for %s" % changes_file sys.exit(0) # Help Message to print USAGE = """Usage: dput [options] [host] Supported options (see man page for long forms): -c: Config file to parse. -d: Enable debug messages. -D: Run dinstall after upload. -e: Upload to a delayed queue. Takes an argument from 0 to 15. -f: Force an upload. -h: Display this help message. -H: Display a list of hosts from the config file. -l: Run lintian before upload. -U: Do not write a .upload file after uploading. -o: Only check the package. -p: Print the configuration. -P: Use passive mode for ftp uploads. -s: Simulate the upload only. -u: Don't check GnuPG signature. -v: Display version information. -V: Check the package version and then upload it. """ # Main function, no further comment needed. :) def main(): global simulate global debug global check_only global dinstall global unsigned_upload global config_file global delay_upload check_version = config_print = force_upload = \ call_lintian = no_upload_log = config_host_list = 0 ftp_passive_mode = 0 preferred_host = '' # Parse Command Line Options. (opts, args) = dputhelper.getopt(sys.argv[1:], 'c:dDe:fhHlUopPsuvV', ['debug', 'dinstall', 'check-only', 'check-version', 'config=', 'force', 'help', 'host-list', 'lintian', 'no-upload-log', 'passive', 'print', 'simulate', 'unchecked', 'delayed=', 'version']) for option, arg in opts: if option in ('-h', '--help'): print USAGE return elif option in ('-v', '--version'): print dput_version return elif option in ('-d', '--debug'): debug = 1 elif option in ('-D', '--dinstall'): dinstall = 1 elif option in ('-c', '--config'): config_file = arg elif option in ('-f', '--force'): force_upload = 1 elif option in ('-H', '--host-list'): config_host_list = 1 elif option in ('-l', '--lintian'): call_lintian = 1 elif option in ('-U', '--no-upload-log'): no_upload_log = 1 elif option in ('-o', '--check-only'): check_only = 1 elif option in ('-p', '--print'): config_print = 1 elif option in ('-P', '--passive'): ftp_passive_mode = 1 elif option in ('-s', '--simulate'): simulate = 1 elif option in ('-u', '--unchecked'): unsigned_upload = 1 elif option in ('-e', '--delayed'): if arg in map(str, range(16)): delay_upload = arg else: print "Incorrect delayed argument, dput only understands 0 to 15." sys.exit(1) elif option in ('-V', '--check_version'): check_version = 1 # Always print the version number in the debug output # so that in case of bugreports, we know which version # the user has installed if debug: print "D: %s" % dput_version # Try to get the login from the enviroment if os.environ.has_key('USER'): login = os.environ['USER'] if debug: print "D: Login: %s" % login else: print "$USER not set, will use login information." # Else use the current username login = pwd.getpwuid(os.getuid( ))[0] if debug: print "D: User-ID: %s" % os.getuid() print "D: Login: %s" % login # Start Config File Parsing. read_configs(config_file, debug) if config_print: print_config(config, debug) sys.exit(0) if config_host_list: print print "Default Method: %s" % config.get('DEFAULT','method') print for section in config.sections(): distributions = "" if config.get(section,'distributions'): distributions = ", distributions: %s" % \ config.get(section,'distributions') print "%s => %s (Upload method: %s%s)" % (section, \ config.get(section,'fqdn'), config.get(section,'method'), \ distributions) print sys.exit(0) # Process further command line options. if len(args) == 0: print "No package or host has been provided, see dput -h" sys.exit(0) elif len(args) == 1 and not check_only: package_to_upload = args[0:] else: if ':' in args[0]: args[0], hostArgument = args[0].split(":", 1) else: hostArgument = "" if config.has_section(args[0]): config.set(args[0], args[0], hostArgument) else: # Let the code below handle this as it is sometimes okay (ie. -o) pass if not check_only: if debug: print "D: Checking if a host was named on the command line." if config.has_section(args[0]): if debug: print "D: Host %s found in config" % args[0] # Host was also named, so only the rest will be a list # of packages to upload. preferred_host = args[0] package_to_upload = args[1:] elif not config.has_section(args[0]) and not args[0].endswith('.changes'): print >> sys.stderr, "No host %s found in config" % args[0] if args[0]=='gluck_delayed': print >> sys.stderr, """ The delayed upload queue has been moved back to ftp-master (aka ftp.upload.debian.org).""" sys.exit(1) else: if debug: print "D: No host named on command line." # Only packages have been named on the command line. preferred_host = '' package_to_upload = args[0:] else: if debug: print "D: Checking for the package name." if config.has_section(args[0]): print "D: Host %s found in config." % args[0] preferred_host = args[0] package_to_upload = args[1:] elif len(args) > 1: print "D: No host %s found in config" % args[0] package_to_upload = args[1:] else: print "D: No host specified." package_to_upload = args[0:] # Now Import the Upload functions import_upload_functions() # Run the same checks for all packages that have been given on # the command line for package_name in package_to_upload: # Check that a .changes file was given on the command line # and no matching .upload file exists. if package_name[-8:] != '.changes': print "Not a .changes file." print "Please select a .changes file to upload." print "Tried to upload: %s" % package_name sys.exit(1) files_to_upload[:] = [] # Construct the package name for further usage. path, name_of_package = os.path.split(package_name) if path == '': path = os.getcwd() # Define the host to upload to. if preferred_host == '': host = guess_upload_host(path, name_of_package) else: host = preferred_host if not config.has_section(host): print "E: No host %s found in config" % host sys.exit(1) # Check if we already did this upload or not check_upload_logfile(package_name, host, check_only, call_lintian, force_upload, debug) # Run the change file tests. verify_files(path, name_of_package, host, check_only, check_version, unsigned_upload, debug) # Run the lintian test if the user asked us to do so. if (call_lintian or config.getboolean(host, 'run_lintian') == 1): run_lintian_test(os.path.join(path, name_of_package)) elif check_only: print "Warning: The option -o does not automatically include " print "a lintian run any more. Please use the option -ol if " print "you want to include running lintian in your checking." # don't upload, skip to the next item if check_only: print "Package checked by dput." continue # Pre-Upload Commands if len(config.get(host, 'pre_upload_command')) !=0: type = 'pre' execute_command(host, debug, type) # Check the upload methods that we have as default and per host if debug: print "D: Default Method: %s" % \ config.get('DEFAULT', 'method') if not upload_methods.has_key(config.get('DEFAULT', 'method')): print "Unknown upload method: %s" % \ config.get('DEFAULT', 'method') sys.exit(1) if debug: print "D: Host Method: %s" % config.get(host, 'method') if not upload_methods.has_key(config.get(host, 'method')): print "Unknown upload method: %s" % config.get(host, 'method') sys.exit(1) # Inspect the Config and set appropriate upload method if not config.get(host, 'method'): method = config.get('DEFAULT', 'method') else: method = config.get(host, 'method') # Check now the login and redefine it if needed if (len(config.get(host, 'login')) != 0 and \ config.get(host, 'login') != 'username'): login = config.get(host, 'login') if debug: print "D: Login %s from section %s used"%(login,host) elif (len(config.get('DEFAULT', 'login')) != 0 and \ config.get('DEFAULT', 'login') != 'username'): login = config.get('DEFAULT', 'login') if debug: print "D: Default login %s used"%login else: if debug: print "D: Neither host %s nor default login used. Using %s" %(host,login) # Messy, yes. But it isn't referenced by the upload method anyway. if config.get(host, 'method') == 'local': fqdn = 'localhost' else: fqdn = config.get(host, 'fqdn') incoming = config.get(host, 'incoming') # if delay_upload wasn't passed via -e/--delayed if not delay_upload: delay_upload = config.get(host, 'delayed') if not delay_upload: delay_upload = config.get('DEFAULT', 'delayed') if delay_upload: if int(delay_upload) == 0: print "Uploading to DELAYED/0-day." if incoming[-1] == '/': first_char = '' else: first_char = '/' incoming += first_char + 'DELAYED/' + delay_upload + '-day' delayed = ' [DELAYED/' + delay_upload + ']' else: delayed = '' # Do the actual upload if not simulate: print "Uploading to %s%s (via %s to %s):"%(host,delayed,method,fqdn) if debug: print "D: FQDN: %s" % fqdn print "D: Login: %s" % login print "D: Incoming: %s" % incoming progress = config.getint(host,'progress_indicator') if not os.isatty(1): progress = 0 if method == 'ftp': if ':' in fqdn: fqdn, port = fqdn.rsplit(":",1) else: port = 21 ftp_mode = config.getboolean(host, 'passive_ftp') if ftp_passive_mode == 1: ftp_mode = 1 if debug: print "D: FTP port: %s" % port if ftp_mode == 1: print "D: Using passive ftp" else: print "D: Using active ftp" upload_methods[method]( fqdn, login, incoming, files_to_upload, debug, ftp_mode, progress=progress, port=port) elif method == 'scp': if debug and config.getboolean(host, 'scp_compress'): print "D: Setting compression for scp" scp_compress = config.getboolean(host, 'scp_compress') ssh_config_options = filter(None, map(lambda x: x.strip(), config.get (host ,'ssh_config_options').split('\n'))) if debug: print "D: ssh config options:\n "+'\n '.join(ssh_config_options) upload_methods[method](fqdn, login, incoming, \ files_to_upload, debug, scp_compress, ssh_config_options) else: upload_methods[method](fqdn, login, incoming, \ files_to_upload, debug, 0, progress=progress) # Or just simulate it. else: for file in files_to_upload: print 'Uploading with %s: %s to %s:%s' % (method, \ file, fqdn, incoming) # Create the logfile after the package has # been put into the archive. if not simulate: if not no_upload_log: create_upload_file(name_of_package, host, path, \ files_to_upload, debug) print "Successfully uploaded packages." else: print "Simulated upload." # Run dinstall if the user asked us to do so. if debug: print "D: dinstall: %s" % dinstall print "D: Host Config: %s" % config.getboolean(host, 'run_dinstall') if config.getboolean(host, 'run_dinstall') == 1 or dinstall: if not simulate: dinstall_caller(name_of_package, host, login, incoming, debug) else: print "Will run dinstall now." # Post-Upload Command if len(config.get(host, 'post_upload_command')) != 0: type = 'post' execute_command(host, debug, type) return # Main if __name__ == '__main__': try: main() except KeyboardInterrupt: print "Exiting due to user interrupt." sys.exit(1) except dputhelper.DputException, e: print >> sys.stderr, e sys.exit(1) dput-0.9.6.4ubuntu3/dcut0000755000000000000000000003722212252030044011743 0ustar #!/usr/bin/python # dcut --- debian command upload tool # Copyright (c) 2004,2005,2008 Thomas Viehmann # portions ripped from dput: # Copyright (c) 2000,2001,2002,2003,2004 Christian Kurz # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import sys, getopt, os, tempfile, string, time, subprocess sys.path.insert(0,'/usr/share/dput/helper') import dputhelper files_to_remove = [] progname = "dcut" version = "0.2.1" USAGE = """Usage: %s [options] [host] command [, command] Supported options (see man page for long forms): -c file Config file to parse. -d Enable debug messages. -h Display this help message. -s Simulate the commands file creation only. -v Display version information. -m maintaineraddress Use maintainer information in "Uploader:" field. -k keyid Use this keyid for signing. -O file Write commands to file. -U file Upload specified commands file (presently no checks). -i changes Upload a commands file to remove files listed in .changes. Supported commands: mv, rm (No paths or command-line options allowed on ftp-master.) """%(sys.argv[0]) validcommands = ('rm','cancel','reschedule') def getoptions(): # seed some defaults options = {'debug':0, 'simulate':0, 'config':None, 'host':None, 'uploader':None, 'keyid':None, 'passive':0, 'filetocreate':None, 'filetoupload':None, 'changes':None} # enable debugging very early if ('-d' in sys.argv[1:] or '--debug' in sys.argv[1:]): options['debug']=1 print "D: %s %s" % (progname,version) # check environment for maintainer if options['debug']: print "D: trying to get maintainer email from environment" if os.environ.has_key('DEBEMAIL'): if os.environ['DEBEMAIL'].find('<')<0: options['uploader']=os.environ.get("DEBFULLNAME",'') if options['uploader']: options['uploader'] += ' ' options['uploader'] += '<%s>'%(os.environ['DEBEMAIL']) else: options['uploader'] = os.environ['DEBEMAIL'] if options['debug']: print "D: Uploader from env: %s"%(options['uploader']) elif os.environ.has_key('EMAIL'): if os.environ['EMAIL'].find('<')<0: options['uploader']=os.environ.get("DEBFULLNAME",'') if options['uploader']: options['uploader'] += ' ' options['uploader'] += '<%s>'%(os.environ['EMAIL']) else: options['uploader'] = os.environ['EMAIL'] if options['debug']: print "D: Uploader from env: %s"%(options['uploader']) else: if options['debug']: print "D: Guessing uploader" import pwd pwrec = pwd.getpwuid(os.getuid()) try: s = open('/etc/mailname').read().strip() except IOError: s = '' if not s: if options['debug']: print "D: Guessing uploader: /etc/mailname was a failure" s = os.popen('/bin/hostname --fqdn').read().strip() if s: options['uploader'] = '%s <%s@%s>'%(pwrec[4].split(',')[0],pwrec[0],s) if options['debug']: print "D: Guessed uploader: %s"%(options['uploader']) else: if options['debug']: print "D: Couldn't guess uploader" # parse command line arguments (opts, arguments) = dputhelper.getopt(sys.argv[1:], 'c:dDhsvm:k:PU:O:i:', ['config=', 'debug', 'help', 'simulate', 'version','host=', 'maintainteraddress=', 'keyid=', 'passive', 'upload=', 'output=', 'input=' ]) for (option, arg) in opts: if options['debug']: print 'D: processing arg "%s", option "%s"'%(option,arg) if option in ('-h', '--help'): print USAGE sys.exit(0) elif option in ('-v', '--version'): print progname,version sys.exit(0) elif option in ('-d', '--debug'): options['debug'] = 1 elif option in ('-c', '--config'): options['config'] = arg elif option in ('-m', '--maintaineraddress'): options['uploader'] = arg elif option in ('-k', '--keyid'): options['keyid'] = arg elif option in ('-s', '--simulate'): options['simulate'] = 1 elif option in ('-P', '--passive'): options['passive'] = 1 elif option in ('-U', '--upload'): options['filetoupload'] = arg elif option in ('-O', '--output'): options['filetocreate'] = arg elif option=='--host': options['host'] = arg elif option in ('-i', '--input'): options['changes'] = arg else: print >> sys.stderr, "%s internal error: Option %s, argument %s unknown"%( progname,option,arg) sys.exit(1) if not options['host'] and arguments and arguments[0] not in validcommands: options['host'] = arguments[0] if options['debug']: print 'D: first argument "%s" treated as host'%(options['host']) del arguments[0] # we don't create command files without uploader if not options['uploader'] and (options['filetoupload'] or options['changes']): print >> sys.stderr, "%s error: command file cannot be created without maintainer email"%progname print >> sys.stderr, '%s please set $DEBEMAIL, $EMAIL or use the "-m" option'%(len(progname)*' ') sys.exit(1) return options, arguments def parse_queuecommands(arguments,options,config): commands = [] arguments = arguments[:] # want to consume a copy of arguments arguments.append(0) curarg = [] while arguments: if arguments[0] in validcommands: curarg = [arguments[0]] if arguments[0] == 'rm': if len(arguments)>1 and arguments[1]=='--nosearchdirs': del arguments[1] else: curarg.append('--searchdirs') else: if not curarg and arguments[0]!=0: print >> sys.stderr, 'Error: Could not parse commands at "%s"'%(arguments[0]) sys.exit(1) if str(arguments[0])[-1] in (',',';',0): curarg.append(arguments[0][0:-1]) arguments[0] = ',' if arguments[0] in (',',';',0) and curarg: # TV-TODO: syntax check for #args etc. if options['debug']: print 'D: Successfully parsed command "%s"'%(' '.join(curarg)) commands.append(' '.join(curarg)) curarg = [] else: # TV-TODO: maybe syntax check the arguments here curarg.append(arguments[0]) del arguments[0] if not commands: print >> sys.stderr, 'Error: no arguments given, see dcut -h' sys.exit(1) return commands def write_commands(commands, options, config, tempdir): if options['filetocreate']: filename = options['filetocreate'] else: translationorig = ''.join(map(chr, range(256)))+string.ascii_letters+string.digits translationdest = 256*'_'+string.ascii_letters+string.digits uploadpartforname = string.translate(options['uploader'], string.maketrans( translationorig,translationdest)) filename = (progname+'.%s.%d.%d.commands'% (uploadpartforname,int(time.time()),os.getpid())) if tempdir: filename = os.path.join(tempdir,filename) files_to_remove.append(filename) f = open(filename,"w") f.write("Uploader: %s\n"%options['uploader']) f.write("Commands:\n %s\n\n"%('\n '.join(commands))) f.close() debsign_cmdline = ['debsign'] debsign_cmdline.append('-m%s' % options['uploader']) if options['keyid']: debsign_cmdline.append('-k%s' % options['keyid']) debsign_cmdline.append('%s' % filename) if options['debug']: print "D: calling debsign:",debsign_cmdline debsign_prog = subprocess.Popen(debsign_cmdline) if os.waitpid(debsign_prog.pid, 0)[1]: print >> sys.stderr, "Error: debsign failed." sys.exit(1) return filename def upload_stolen_from_dput_main(host, upload_methods, config,debug,simulate,files_to_upload,ftp_passive_mode): # Check the upload methods that we have as default and per host if debug: print "D: Default Method: %s" % \ config.get('DEFAULT', 'method') if not upload_methods.has_key(config.get('DEFAULT', 'method')): print >> sys.stderr, "Unknown upload method: %s" % \ config.get('DEFAULT', 'method') sys.exit(1) if debug: print "D: Host Method: %s" % config.get(host, 'method') if not upload_methods.has_key(config.get(host, 'method')): print >> sys.stderr, "Unknown upload method: %s" % config.get(host, 'method') sys.exit(1) # Inspect the Config and set appropriate upload method if not config.get(host, 'method'): method = config.get('DEFAULT', 'method') else: method = config.get(host, 'method') # Check now the login and redefine it if needed if config.has_option(host, 'login') and config.get(host, 'login') != 'username': login = config.get(host, 'login') elif config.has_option('DEFAULT', 'login') and config.get('DEFAULT', 'login') != 'username': login = config.get('DEFAULT', 'login') else: # Try to get the login from the enviroment if os.environ.has_key('USER'): login = os.environ['USER'] else: print "$USER not set, will use login information." # Else use the current username login = pwd.getpwuid(os.getuid( ))[0] if debug: print "D: User-ID: %s" % os.getuid() if debug: print "D: Neither host %s nor default login used. Using %s" %(host,login) if debug: print "D: Login to use: %s" % login # Messy, yes. But it isn't referenced by the upload method anyway. if config.get(host, 'method') == 'local': fqdn = 'localhost' else: fqdn = config.get(host, 'fqdn') incoming = config.get(host, 'incoming') # Do the actual upload if not simulate: if debug: print "D: FQDN: %s" % fqdn print "D: Login: %s" % login print "D: Incoming: %s" % incoming if method == 'ftp': ftp_mode = config.getboolean(host, 'passive_ftp') if ftp_passive_mode == 1: ftp_mode = 1 if ftp_mode == 1: if debug: if ftp_passive_mode == 1: print "D: Using passive ftp" else: print "D: Using active ftp" upload_methods[method](fqdn, login, incoming, \ files_to_upload, debug, ftp_mode) elif method == 'scp': if debug and config.getboolean(host, 'scp_compress'): print "D: Setting compression for scp" scp_compress = config.getboolean(host, 'scp_compress') ssh_config_options = filter(None, map(lambda x: x.strip(), config.get (host ,'ssh_config_options').split('\n'))) upload_methods[method](fqdn, login, incoming, \ files_to_upload, debug, scp_compress, ssh_config_options) else: upload_methods[method](fqdn, login, incoming, \ files_to_upload, debug, 0) # Or just simulate it. else: for file in files_to_upload: print >> sys.stderr, 'Uploading with %s: %s to %s:%s' % (method, \ file, fqdn, incoming) os.system("cat %s"%file) def load_dput(options): if options['debug']: print 'D: loading dput' d = {} execfile("/usr/bin/dput",d) return d def dcut(): options,arguments = getoptions() dput = load_dput(options) # dput read_configs sets dput.config if options['debug']: print 'D: calling dput.read_configs' dput['read_configs'](options['config'], options['debug']) config = dput['config'] if not options['host'] and config.has_option('DEFAULT', 'default_host_main'): options['host'] = config.get('DEFAULT', 'default_host_main') if options['debug']: print 'D: Using host "%s" (default_host_main)'%(options['host']) if not options['host']: options['host'] = 'ftp-master' if options['debug']: print 'D: Using host "%s" (hardcoded)'%(options['host']) tempdir = None filename = None try: if not (options['filetoupload'] or options['filetocreate']): tempdir = tempfile.mkdtemp(prefix=progname+'.') if not options['filetocreate']: if not options['host']: print "Error: No host specified and no default found in config" sys.exit(1) if not config.has_section(options['host']): print "No host %s found in config" % (options['host']) sys.exit(1) else: if config.has_option(options['host'], 'allow_dcut'): dcut_allowed = config.getboolean(options['host'], 'allow_dcut') else: dcut_allowed = config.getboolean('DEFAULT', 'allow_dcut') if not dcut_allowed: print 'Error: dcut is not supported for this upload queue.' sys.exit(1) if options['filetoupload']: if arguments: print 'Error: cannot take commands when uploading existing file,' print ' "%s" found'%(' '.join(arguments)) sys.exit(1) commands = None filename = options['filetoupload'] if not filename.endswith(".commands"): print 'Error: I\'m insisting on the .commands extension, which' print ' "%s" doesnt seem to have.'%filename # TV-TODO: check file to be readable? elif options['changes']: parse_changes = dput['parse_changes'] removecommands = create_commands(options, config, parse_changes) filename = write_commands(removecommands, options, config, tempdir) else: commands = parse_queuecommands(arguments,options,config) filename = write_commands(commands, options, config, tempdir) if not options['filetocreate']: # hack to get upload_methods myglobals={'dput':dput} dput['import_upload_functions']() upload_methods = dput['upload_methods'] upload_stolen_from_dput_main(options['host'],upload_methods, config,options['debug'],options['simulate'],[filename],options['passive']) finally: # we use sys.exit, so we need to clean up here if tempdir: # file is temporary iff in tempdir for filename in files_to_remove: os.unlink(filename) os.rmdir(tempdir) # Parses a .changes file and returns commands to remove files named in it def create_commands(options, config, parse_changes): changes_file = options['changes'] if options['debug']: print "D: Parsing changes file (%s) for files to remove" % changes_file try: chg_fd = open(changes_file, 'r') except IOError: print "Can't open changes file: %s" % changes_file sys.exit(1) the_changes = parse_changes(chg_fd) chg_fd.close removecommands = ['rm --searchdirs ' + os.path.basename(changes_file)] for file in the_changes.dict['files'].split('\n'): fn = string.split(file)[4] # filename only rm = 'rm --searchdirs ' + fn if options['debug']: print "D: Will remove %s with '%s'" % (fn, rm) removecommands.append(rm) return removecommands if __name__=="__main__": try: dcut() except dputhelper.DputException, e: print >> sys.stderr, e sys.exit(1) dput-0.9.6.4ubuntu3/dput.cf.50000644000000000000000000001466112252030044012511 0ustar .\" Hey, Emacs! This is an -*- nroff -*- source file. .TH dput.cf 5 "April 8, 2001" .SH NAME .B dput.cf \- Debian package upload tool configuration file .SH DESCRIPTION This manpage gives a brief overview of dput's configuration file and the available options in it. \fBdput\fP is a tool to upload Debian packages to the archive. .PP .SH FORMAT dput.cf consists of different groups of configuration options, one for each host where you want to be able to upload packages. Hosts are defined using an identifier header with a short name for the host, enclosed in square brackets. Note that only if multiple such headers are encountered in the configuration, only the group following the last header is considered. This is done to avoid confusion when overriding a global configuration file with a user-specific one. There's a special identifier, [DEFAULT], which holds default parameters for all the hosts. The defaults can be overridden by redefining them again in each host section. The available parameters are listed below: .TP .B fqdn This is the fully qualified domain name that will be used (can be specified as host:port for HTTP, HTTPS and FTP). .TP .B login Your login on the machine named before. A single asterisk \fB*\fR will cause the scp and rsync uploaders to not use supply a login name when calling to ssh, scp, and rsync. .TP .B incoming The directory that you should upload the files to. .TP .B method The method that you want to use for uploading the files. Currently, dput accepts the following values for \fBmethod\fR: .RS .TP .I ftp the package will be uploaded via ftp, either anonymously or using a login/password. Note that ftp is unencrypted so you should not use password authentication with this. .TP \fIhttp\fR and \fIhttps\fR the package will be uploaded via http or https using the PUT method as specified in WebDAV. The upload method will prompt for a password if necessary. .TP .I scp the package will be uploaded using ssh's scp. This transfers files using a secure ssh tunnel, and needs an account on the upload machine. .TP .I sftp the package will be uploaded using ssh's sftp. This transfers files using a secure ssh tunnel, and needs sftp access on the upload machine. .TP .I rsync the package will be uploaded using rsync over ssh. This is similar to scp, but can save some bandwidth if the destination file already exists on the upload server. It also needs a login on the remote machine as it uses ssh. .TP .I local the package will be "uploaded" locally using /usr/bin/install. This transfers files to a local incoming directory, and needs appropriate permissions set on that directory. .RE .TP .B hash The hash algorithm that should be used in calculating the checksum of the files before uploading them. Currently, dput accepts the following values for \fBhash\fR: .RS .TP .I md5 use the md5 algorithm for calculation .TP .I sha use the sha algorithm for calculation .RE .TP .B allow_unsigned_uploads This defines if you are allowed to upload files without a GnuPG signature to this host or not. .TP .B allow_dcut This defines if you are allowed to upload a dcut changes file to the queue to remove or move files. .TP .B distributions This defines a comma-separated list of distributions that this host accepts, used to guess the host to use when none is given on the command line. .TP .B allowed_distributions A regular expression (of Python \fBre\fR module syntax) that the distribution field must match or dput will refuse the upload. .TP .B delayed Set a numeric default parameter for delayed uploads (i.e. uploads to this queue will be delayed the specified number of days. Defaults to the empty string, meaning no delay. This only works with upload queues that support delayed uploads. .TP .B run_lintian This option defines if lintian should be run before the package will be uploaded or not. If the package is not lintian clean, the upload will not happen. .TP .B run_dinstall This options defines if dinstall \-n should be run after the package has been uploaded or not. This is an easy way to test if your package would be installed into the archive or not. .TP .B check_version This option defines if dput should check if the user has installed the package in his system for testing it before putting it into the archive. If the user has not installed and tested it, dput will reject the upload. .TP .B passive_ftp This option defines if dput should use passive ftp or active ftp for uploading a package to one of the upload queues. By default, dput uses passive ftp connections. If you need to use active ftp connections, set passive_ftp to 0. .TP .B progress_indicator This integer option defines if dput should display a progress indicator for the upload. (Currently implemented in ftp only.) .br Supported values: 0 (default) \- no progress, 1 \- rotating progress indicator, and 2 \- kilobyte counter. .TP .B scp_compress This option defines if the scp upload to the host will be compressed, or not. This option is only used for the 'scp' upload method, and has been found to decrease upload time for slow links, and increase upload times for faster links. .TP .B ssh_config_options The arguments of this config options should be ssh config file options in the style documented in \&\fBssh_config\fR\|(5). They will be passed to all automatic invocations of \fIssh\fR and \fIscp\fR by dput. Note that you can define multiline (dput) configuration options by indenting the second line with whitespace (i.e. similar to RFC822 header continuations). .TP .B post_upload_command This option defines a command to be run by dput after a successful upload. .TP .B pre_upload_command This option defines a command to be run by dput before a upload happens. .TP .B default_host_main This defines the default host for packages that are allowed to be uploaded to the main archive. This variable is used when guessing the host to upload to. .SH HOST ARGUMENT .P If a user passes an argument to a host by appending the hostname with a colon, .B %(HOSTNAME)s will be replaced with the specified argument. Otherwise, it will be replaced with an empty string. .SH BUGS .P Please send bug reports to the author. .SH FILES .TP .I /etc/dput.cf global dput configuration file .TP .I ~/.dput.cf peruser dput configuration file .SH AUTHOR Christian Kurz. Updated by Thomas Viehmann <\fBtv@beamnet.de\fR>. Many other people have contributed to this code. See the Thanks file. .SH SEE ALSO .PD 0 .TP \&\fBdput\fR\|(1) .TP \fI/usr/share/doc/dput\fP .SH COMMENTS The author appreciates comments and suggestions from you, if any. dput-0.9.6.4ubuntu3/README0000644000000000000000000000334012252030044011730 0ustar This is the debian package upload tool, or dput. dput has been developed because dupload, the only tool for doing uploads, has quite a few open bug reports and the code is in my opinion not very clean. So I decided to start again and create a new tool for uploading packages into debian. This tool is dput, which will include more features and be (hopefully) bug free. It is written in python, since the author believes that python is a very good language. The features include: * Test of the GnuPG signature on the dsc-File * Verification of the check sums in the dsc-File. * Support for md5 and sha check sums. * Check for unnecessary .tar.gz's or missing .tar.gz's * Running lintian before putting the package into the archive * Running dinstall after the package is in the archive and making sure that the package will be put on the correct server. * Running user-defined commands before and after an upload. A lot of the tests can be run without really putting the package into the archive. If you are still using PGP instead of GnuPG, please consider switching to GnuPG instead. You can find a Howto about "Replacing PGP 2.x with GnuPG" at the following URL: http://www.gnupg.org/gph/en/pgp2x.html This tool is released under the GPL and a copy of this license can be found at /usr/share/common-licenses/GPL. The source code and the current repository can always be accessed via git://git.debian.org/git/collab-maint/dput.git or http://git.debian.org/git/collab-maint/dput.git see http://git.debian.org/?p=collab-maint/dput.git Patches for Bugfixing, Improvement, etc. are always welcome and should be against the latest version. Christian Kurz Jordi Mallach Sean 'Shaleh' Perry dput-0.9.6.4ubuntu3/scp.py0000644000000000000000000000320112252030044012203 0ustar # Upload the files with scp in a batch. import os,sys,stat,dputhelper def upload(fqdn,login,incoming,files_to_upload,debug,compress, ssh_config_options=[],progress=0): files_to_fix = [] for file in files_to_upload: to_fix = os.path.basename(file) file_to_fix = os.path.join(incoming, to_fix) files_to_fix.append(file_to_fix) command = ['scp', '-p'] if compress: command.append('-C') for anopt in ssh_config_options: command += ['-o', anopt] # TV-Note: Are these / Should these be escaped? command += files_to_upload if login and login != '*': login_spec = '%s@'%login else: login_spec = '' command.append('%s%s:%s' % (login_spec, fqdn, incoming)) change_mode = 0 for file in files_to_upload: if not stat.S_IMODE(os.lstat(file)[stat.ST_MODE])==0644: change_mode = 1 if debug: print "D: Uploading with scp to %s%s:%s" % \ (login_spec, fqdn, incoming) print "D: %s" % command if dputhelper.spawnv(os.P_WAIT, '/usr/bin/scp', command): print "Error while uploading." sys.exit(1) if change_mode: fix_command = ['ssh'] for anopt in ssh_config_options: fix_command += ['-o', anopt] fix_command += ['%s%s' % (login_spec, fqdn), 'chmod', '0644'] \ + files_to_fix if debug: print "D: Fixing some permissions" print "D: %s" % fix_command if dputhelper.spawnv(os.P_WAIT, '/usr/bin/ssh', fix_command): print "Error while fixing permissions." sys.exit(1) dput-0.9.6.4ubuntu3/sftp.py0000644000000000000000000000315112252030044012376 0ustar # sftp.py - dput method for sftp transport # # @author Cody A.W. Somerville # @company Canonical Ltd. # @date 07 November 2008 # import os, sys, dputhelper def upload(fqdn, login, incoming, files, debug, compress, progress=0): try: import bzrlib.transport except Exception, e: print "E: bzrlib must be installed to use sftp transport." sys.exit(1) if not login or login == '*': login = os.getenv("USER") if not incoming.endswith("/"): incoming = "%s/" % incoming try: t = bzrlib.transport.get_transport("sftp://%s@%s/%s" % (login, fqdn, incoming)) except Exception, e: print "%s\nE: Error connecting to remote host." % e sys.exit(1) for f in files: baseFilename = f.split("/")[len(f.split("/"))-1] sys.stdout.write(" %s: " % baseFilename) sys.stdout.flush() try: fileobj = open(f, 'rb') if progress: try: size = os.stat(f).st_size except: size = -1 if debug: print "D: Determining size of file '%s' failed" % f fileobj = dputhelper.FileWithProgress(fileobj, ptype=progress, progressf=sys.stdout, size=size) t.put_file(baseFilename, fileobj) fileobj.close() except Exception, e: print "\n%s\nE: Error uploading file." % e sys.exit(1) print "done." dput-0.9.6.4ubuntu3/dput.10000644000000000000000000000673212252030044012116 0ustar .\" Hey, Emacs! This is an -*- nroff -*- source file. .TH dput 1 "October 5, 2001" .SH NAME .B dput \- package upload tool for Debian .SH SYNTAX .B dput [\fIoptions\fR] [\fBhost\fR[:\fBargument\fR]] \fBpackage.changes\fR ... .SH DESCRIPTION This is a tool for uploading Debian packages into the archive. You may specify to which host it should upload the file by passing it an .I host argument. If omitted, dput uses the host specified by .I default_host (or, historically \fIdefault_host_non-us\fR) configuration option. You also can pass an argument to the host by appending the hostname with a colon followed by the argument. For example, you can upload easily to different launchpad PPAs by passing the PPAs' id to the ppa host without having to modify dput.cf. .P You have to pass the program one or more name of .I package.changes files and then they will be sequentially uploaded. .P This program will then upload the package for you into the archive, using a selected upload method. Currently dput supports ftp, scp, rsync, http, sftp, https, and local. The method scripts have been split from the main script so it is easy to add new methods. Look in /usr/share/dput/ for examples. Should something go wrong with your upload to destinations using the Debian upload queue daemon (e.g. ftp-master), you can remove files from the upload queue with \fBdcut\fP(1). .SH OPTIONS .BR "\-c", .B \-\-config \- define a config file to use. .P .BR "\-d", .B \-\-debug \- activate debugging mode, helpful if bugs occur. .P .BR "\-D", .B \-\-dinstall \- do a dry run of dinstall after the upload. .P .BR "\-f", .B \-\-force \- force an upload of an already uploaded package. .P .BR "\-h", .B \-\-help \- print help information and exit. .P .BR "\-H", .B \-\-host\-list \- print the lists of hosts that dput knows about. .P .BR "\-l", .B \-\-lintian \- run lintian before the upload. .P .BR "\-U", .B \-\-no-upload\-log \- do not write a .upload log file after uploading. .P .BR "\-o", .B \-\-check-only \- check only the package and do not upload. .P .BR "\-p", .B \-\-print \- print the configuration that dput is using. .P .BR "\-P", .B \-\-passive \- use passive ftp instead of active. Note that passive ftp is the default unless specified otherwise in the configuration file. .P .BR "\-s", .B \-\-simulate \- simulate an upload only. .P .BR "\-u", .B \-\-unchecked \- don't check GnuPG signature on the changes file. .P .BR "\-e", .B \-\-delayed \- Upload to a DELAYED queue, rather than the usual Incoming. This takes an argument from 0 to 15. Note that a delay of 0 is different from no delay at all. .P .BR "\-v", .BR \-\-version \- print version information and exit. .P .BR "\-V", .BR \-\-check\-version \- check if the user has already installed and tested the package before putting it into the archive. .P .SH ENVIRONMENT This program doesn't depend on any environment variables. But if the variable USER is set, it will be used. .SH LICENSE This program is distributed under the terms of the GPL. .SH BUGS .P Please send bug reports to the author. .SH FILES .TP .I /etc/dput.cf global dput configuration file .TP .I ~/.dput.cf peruser dput configuration file .SH SEE ALSO .PD 0 .TP \fBdput.cf\fP(5) .TP \fBdcut\fP(1) .TP \fI/usr/share/doc/dput\fP .TP \fI/usr/share/dput\fP .SH AUTHOR \fIdput\fP was written Christian Kurz. The current maintainer is Thomas Viehmann . Many other people have contributed to this code. See the Thanks file. .SH COMMENTS The author does appreciate comments and suggestions from you. dput-0.9.6.4ubuntu3/bash_completion0000644000000000000000000000243512252030044014145 0ustar #-*- mode: shell-script;-*- # Debian GNU/Linux dput(1) completion # Copyright 2002 Roland Mas have dput && _dput() { local cur prev options paroptions special i delayed_options hosts COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} options='-c --config -d --debug -D --dinstall -f --force -h --help \ -H --host-list -l --lintian -o --check-only -p --print \ -P --passive -s --simulate -u --unchecked -e --delayed \ -v --version -V --check-version' hosts=$( { grep "^\[.*\]" $HOME/.dput.cf 2> /dev/null | tr -d [] || /bin/true grep "^\[.*\]" /etc/dput.cf 2> /dev/null | tr -d [] || /bin/true } | grep -v '^DEFAULT$' | sort -u) paroptions="$options $hosts" case $prev in --delayed|-e) delayed_options='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15' COMPREPLY=( $( compgen -W "$delayed_options" | grep ^$cur ) ) ;; --config|-c) COMPREPLY=( $( compgen -o filenames -G "$cur*" ) ) ;; *) COMPREPLY=( $( compgen -G "${cur}*.changes" compgen -G "${cur}*.asc" compgen -G "${cur}*.sig" compgen -W "$paroptions" | grep "^$cur" ) ) ;; esac return 0 } [ "$have" ] && complete -F _dput -o filenames -o plusdirs dput dput-0.9.6.4ubuntu3/FAQ0000644000000000000000000001144112252030044011403 0ustar 1. Why can't the option -D be used with ftp uploads? Because the ftp upload method uses anonymous upload queues, which don't know anything about the user or dinstall. They will just accept every Debian package and later upload it to the incoming directory of ftp.upload.debian.org. 2. Why don't you change the suffix .cf to .conf for consistency purpose? At the time, where I had to decide on a suffix for the configuration file, I had the offer to user either "rc", ".cf" or ".conf". If you look at the dot files in your homedir or the files in /etc, you'll notice that there's no standard and that every of these three extension is used. Since I wanted to have a short suffix, I had to decide between "rc" or ".cf". I decided to use ".cf" as suffix, because it's an obvious abbreviation for configuration and also I noticed that postfix uses it as extension. Since this extension has now been used for quite some time, I'm not planning to change it. Any change would need a lot of work or introduce problems for the users. 3. Why can't dput act like dupload and just use every file in the directory? Well, dput was not written as a dupload-in-Python, but as an alternative tool for uploading Debian packages. dput and dupload are completely different, especially since dput supports modules. I only took one or two ideas from dupload, especially the hooks, but won't implement any further options or features. 4. Why should I switch to dput since dupload works for me? Because dput will make you rich and attract women. Now, seriously, it's a matter of preferences. If you use dupload and like its behaviour, then continue to use it. But in every case, I would suggest that you try dput, since it will check the GnuPG signature and the checksums before uploading and offer to run dinstall in dry-run mode after the upload. It also offers the usage of other upload methods via modules. 5. Where are modules and what are they exactly used for? dput uses modules for the different upload methods that it offers. All upload methods are implemented via seperate modules that will be loaded at runtime. That way we can easily extend the number of upload methods that dput offers. So if you write or already wrote a new upload method, then please inform the author of dput, so that it maybe can be added to dput in the future. 6. Can I just copy /etc/dput.cf into my homedir as .dput.cf? No, this shouldn't be done, because .dput.cf is a configuration file for the user. It should only contain configuration variables which have a value different from the default and which the user needs to define. This will reduce the risk of breaking dput, if either some default value in /etc/dput.cf is changed or a new configuration variable is added. 7. How can I set up my own local apt repository and use dput for installing? There are many ways to maintain apt repositories. Using Colin Walters' mini-dinstall-Package is perhaps the easiest way (if you run sarge or later). If you want to have the repository on a remote machine, see question 8. For a local repository you might use our MICRO RECIPE FOR PERSONAL MINI-DINSTALL REPOSITORY The following dput and mini-dinstall configuration works for the mainters of dput. For your convenience we have included a "local" dput target in the stock debian dput.cf which can be used with the mini-dinstall configuration below. For simplicity, we do not use the daemon mode of mini-dinstall. As mini-dinstall has rather flexible configuration options, you might want to consider reading the documentation yourself, but the file file below should work out of the box to implement most simple setup. After copying the configuration file below into your home directory do mkdir -p public_html/debian ; mini-dinstall --batch in your home directory to setup your repository. ~/.mini-dinstall.conf: # Adapted Colin's mini-dinstall.conf [DEFAULT] architectures = all, i386 archivedir = ~/public_html/debian/ use_dnotify = 0 verify_sigs = 0 extra_keyrings = ~/.gnupg/pubring.gpg mail_on_success = 0 archive_style = flat poll_time = 10 mail_log_level = NONE [stable] [testing] [unstable] 8. How do I set up dput to fill my remote apt repository? Assuming you have remote ssh access, you can use the following You can use the same mini-dinstall configuration file (and setup command) as for a local repository on the remote machine. As ~/.dput.cf you now can use [myremote] fqdn = remote.machine.net login = usernameonremote method = scp incoming = ~/public_html/debian/mini-dinstall/incoming run_dinstall = 0 post_upload_command = ssh usernameonremote@remote.machine.net /usr/bin/mini-dinstall --batch dput-0.9.6.4ubuntu3/COPYING0000644000000000000000000004310712252030044012110 0ustar GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.