--- brag-1.4.1.orig/brag +++ brag-1.4.1/brag @@ -332,6 +332,7 @@ ;# different newsgroups variable combineServers 0 ;# Don't combine parts from different ;# servers + variable keepFileNames 0 ;# Don't keep original file names variable getSingle 0 ;# If true, get single-part msgs, too variable finishedThread 1 ;# Flag to signify that a thread is ;# ready for another task @@ -443,6 +444,7 @@ variable password variable combine variable combineServers + variable keepFileNames variable total variable max variable getSingle @@ -508,6 +510,9 @@ "-C" { set combineServers 1 } + "-k" { + set keepFileNames 1 + } "-A" { incr i loadAcceptFile [lindex $argList $i] @@ -1220,26 +1225,32 @@ proc brag::getDestination {file dir subject} { + variable keepFileNames + # The message subject might be well formatted, so we gan get a good file # name from it. Otherwise use the original file name - regsub -all -- { - } $subject "|" subject - regsub -all -- {y[eE]nc} $subject "" subject - set fields [split $subject "|"] - if {[llength $fields] > 1} { - set base [lindex $fields end] - if {[regexp {[0-9,]+ bytes} $base] || [regexp {[0-9,]+[KM]} $base]} { - set base [lindex $fields [expr {[llength $fields] - 2}]] - } - regsub "\\(\\)|\\\[\\\]" $base "" base - set base [file tail [string trim [string trim $base {~}]]] + if {$keepFileNames} { + set base $file } else { - set base [file tail [string trim $file {~}]] + regsub -all -- { - } $subject "|" subject + regsub -all -- {y[eE]nc} $subject "" subject + set fields [split $subject "|"] + if {[llength $fields] > 1} { + set base [lindex $fields end] + if {[regexp {[0-9,]+ bytes} $base] || [regexp {[0-9,]+[KM]} $base]} { + set base [lindex $fields [expr {[llength $fields] - 2}]] + } + regsub "\\(\\)|\\\[\\\]" $base "" base + set base [file tail [string trim [string trim $base {~}]]] + } else { + set base [file tail [string trim $file {~}]] + } + regsub -all -- { [0-9,]+ bytes} $base {} base + regsub -all -- { [0-9,]+[KM]B*} $base {} base + set base [string trim $base {"}] + regsub -all -- {[^a-zA-Z0-9_. ]} $base "_" base } - regsub -all -- { [0-9,]+ bytes} $base {} base - regsub -all -- { [0-9,]+[KM]B*} $base {} base - set base [string trim $base {"}] - regsub -all -- {[^a-zA-Z0-9_. ]} $base "_" base # If the file doesn't already exist in the destination directory, # return it, otherwise create a unique name based on the original @@ -1262,7 +1273,7 @@ puts stderr "brag - Grab multipart binaries from news server Usage: brag \[-s server\] \[-P port\] \[-g group\] \[-l user\] \[-p pass\] - \[-o dir\] \[-n n\] \[-q\] \[-u\] \[-c\] \[-C\] \[-X\] + \[-o dir\] \[-n n\] \[-q\] \[-u\] \[-c\] \[-C\] \[-k\] \[-X\] \[-a pattern \[-a pattern\] ...\] \[-r pattern \[-r pattern\] ...\] \[-A file\] \[-R file\] \[-t number\] \[ -m max \] or @@ -1280,6 +1291,7 @@ -u Save message subjects, too -c Combine parts even if they are from different groups -C Combine parts even if they are from different servers + -k Keep original filenames when possible -X Process single-part messages, too -a pattern Accept messages matching the pattern -r pattern Reject messages matching the pattern --- brag-1.4.1.orig/brag.1 +++ brag-1.4.1/brag.1 @@ -58,6 +58,10 @@ .I ".sub" extension added .TP +.I "-k" +Keep original file names when possible, only rename when necessary to +avoid a collission with existing files +.TP .I "\-o dir" Set output directory to .I "dir" --- brag-1.4.1.orig/debian/brag.dirs +++ brag-1.4.1/debian/brag.dirs @@ -0,0 +1,3 @@ +usr/bin +usr/share/icons +usr/share/doc/brag --- brag-1.4.1.orig/debian/changelog +++ brag-1.4.1/debian/changelog @@ -0,0 +1,81 @@ +brag (1.4.1-2.1) unstable; urgency=medium + + * Non-maintainer upload. + * Updated DH to level 10. (Closes: #817383) + * debian/control: + - Bumped Standards-Version to 3.9.8. + - Added ${misc:Depends} on Depends field. + - Added Homepage field. + - Little improvements in long description. (Closes: #363187, #608198) + * debian/watch: created. + + -- Paulo Henrique de Lima Santana (phls) Mon, 03 Oct 2016 11:40:07 -0300 + +brag (1.4.1-2) unstable; urgency=low + + * Added -k option, to avoid unpleasant filename mangling (closes: #167662) + * Move to DebHelper 4 + + -- Simon Kelley Tue, 11 Oct 2005 18:35:34 +0100 + +brag (1.4.1-1) unstable; urgency=low + + * New upstream which uses different decoder, updated dependencies to + reflect this. + + -- Simon Kelley Sat, 27 Dec 2003 18:25:30 +0000 + +brag (1.3.1-1) unstable; urgency=low + + * New upstream. (closes: #219756) + + -- Simon Kelley Sat, 8 Nov 2003 20:02:30 +0000 + +brag (1.2.9-6) unstable; urgency=low + + * Use base64-code rather than mimencode. (closes: #212338) + + -- Simon Kelley Tues, 23 Sep 2003 19:35:20 +0100 + +brag (1.2.9-5) unstable; urgency=low + + * Send MODE READER command _after_ athenticating. (closes: #210448) + + -- Simon Kelley Sun, 14 Sep 2003 21:40:40 +0100 + +brag (1.2.9-4) unstable; urgency=low + + * Better check for return code from MODE READER command (closes: #205649) + + -- Simon Kelley Wed, 3 Sep 2003 17:26:00 +0100 + +brag (1.2.9-3) unstable; urgency=low + + * Applied patch to send MODE READER command (closes: #188753) + + -- Simon Kelley Sun, 1 Jun 2003 20:01:39 +0100 + +brag (1.2.9-2) unstable; urgency=low + + * Added Build-depends: debphelper (closes: #187946) + + -- Simon Kelley Mon, 7 Apr 2003 14:46:19 +0100 + +brag (1.2.9-1) unstable; urgency=low + + * New upstream. + + -- Simon Kelley Sun, 29 Sept 2002 16:55:09 +0100 + +brag (1.2.8-1) unstable; urgency=low + + * New upstream. + + -- Simon Kelley Sun, 18 Aug 2002 22:25:09 +0100 + +brag (1.2.1-1) unstable; urgency=low + + * Initial release. + + -- Simon Kelley Tues, 20 Jun 2002 21:08:07 +0100 + --- brag-1.4.1.orig/debian/compat +++ brag-1.4.1/debian/compat @@ -0,0 +1 @@ +10 --- brag-1.4.1.orig/debian/control +++ brag-1.4.1/debian/control @@ -0,0 +1,23 @@ +Source: brag +Section: news +Priority: optional +Maintainer: Simon Kelley +Standards-Version: 3.9.8 +Build-depends: debhelper (>=10) +Homepage: http://brag.sourceforge.net + +Package: brag +Architecture: all +Depends: ${misc:Depends}, uudeview,tcl8.3 | tclsh +Description: Downloads and assembles multipart Usenet binaries + Brag collects and assembles multipart binary attachments from + newsgroups. This is a robust command-line tool, well suited to run + as a cron job. + * Collects and downloads multipart binary attachments + * Supported encodings: uuencode, MIME base64 and yenc + * Filters messages using accept/reject patterns + * Optionally saves message subjects + * Supports NNTP authentication + * Supports non-default NNTP ports + * Can combine parts from different newsgroups or even different servers + * Bulletproof: Restarts from the last successful operation. --- brag-1.4.1.orig/debian/copyright +++ brag-1.4.1/debian/copyright @@ -0,0 +1,40 @@ +This package was Debianized by Simon Kelley +. The only substantial change made was to +allow the use of yydecode (rather than ydec) and base64-code (rather +than mimencode). + +Brag was downloaded from: + + http://brag.sourceforge.net + +See README.gz for author and acknowledgement information. + +Copyright: + +Copyright (c) 2000-2003 by Akos Polster. + +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. + +The text of the GNU General Public License is available in the file +/usr/share/common-licenses/GPL on this system. + + + + + + + + --- brag-1.4.1.orig/debian/rules +++ brag-1.4.1/debian/rules @@ -0,0 +1,41 @@ +#!/usr/bin/make -f +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +clean: + dh_testdir + dh_testroot + dh_clean + +# Build architecture-independent files here. +binary-indep: + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + install brag debian/brag/usr/bin/brag + install -m 644 brag-rpm.xpm debian/brag/usr/share/icons/brag.xpm + dh_installman brag.1 + dh_installdocs README + dh_installchangelogs CHANGES + + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + + + +binary: binary-indep +binary-arch: +build: +.PHONY: build clean binary-indep binary-arch binary + + + + + + --- brag-1.4.1.orig/debian/watch +++ brag-1.4.1/debian/watch @@ -0,0 +1,2 @@ +version=4 +http://brag.sourceforge.net/brag-(\d\S+)\.tar\.(?:bz2|gz|xz)