diff options
author | Mattia Rizzolo <mattia@debian.org> | 2015-12-13 18:21:11 +0100 |
---|---|---|
committer | Mattia Rizzolo <mattia@debian.org> | 2015-12-13 18:21:11 +0100 |
commit | 2d7ce7ef2319d3acdbd4ebe1a3660307bd2ddf5e (patch) | |
tree | 0454584d1b41118758b2d2a2d40d1db4d94bcfd4 /debian/patches/87_use_existing_cddb_category.patch | |
parent | 97d87e1fa0808cf747bf0a4fe3b39d1cbdb5efc8 (diff) |
jack (3.1.1+cvs20050801-29.1) unstable; urgency=medium
* Non-maintainer upload.
* Build with dh-python instead of python-support. Closes: #786042
* Update watch file.
[dgit import package jack 3.1.1+cvs20050801-29.1]
Diffstat (limited to 'debian/patches/87_use_existing_cddb_category.patch')
-rw-r--r-- | debian/patches/87_use_existing_cddb_category.patch | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/debian/patches/87_use_existing_cddb_category.patch b/debian/patches/87_use_existing_cddb_category.patch new file mode 100644 index 0000000..d9cf6e2 --- /dev/null +++ b/debian/patches/87_use_existing_cddb_category.patch @@ -0,0 +1,121 @@ +When submitting updated CDDB entries, use the existing CDDB category of the +CD instead of prompting the user for it. Debian #335299. (Note that there +might be no CDDB category yet when -Q and --cont-failed-query is used; +Debian #453724). + + +Won't cleanly apply without 25_ignore_empty_freedb_info.patch but doesn't +depend on it. + + +diff -urN a/jack_freedb.py jack-3.1.1+cvs20050801/jack_freedb.py +--- a/jack_freedb.py 2006-02-05 15:37:18.000000000 +0000 ++++ jack-3.1.1+cvs20050801/jack_freedb.py 2006-02-05 15:37:12.000000000 +0000 +@@ -651,34 +651,35 @@ + + return cat[x] + +-def do_freedb_submit(file, cd_id): ++def do_freedb_submit(file, cd_id, cat = None): + import httplib + +- hello = "hello=" + cf['_username'] + " " + cf['_hostname'] + " " + prog_name + " " + prog_version +- print "Info: querying categories..." +- url = "http://" + freedb_servers[cf['_freedb_server']]['host'] + "/~cddb/cddb.cgi?" + urllib.quote_plus("cmd=cddb lscat" + "&" + hello + "&proto=6", "=&") +- f = urllib2.urlopen(url) +- buf = f.readline() +- if buf[0:3] == "500": +- print "Info: LSCAT failed, using builtin categories..." +- cat = choose_cat() +- +- elif buf[0:3] == "210": +- cat = ["null", ] +- while 1: +- buf = f.readline() +- if not buf: +- break +- buf = string.rstrip(buf) +- if buf != ".": +- cat.append(buf) +- f.close() +- cat = choose_cat(cat) ++ if not cat: ++ hello = "hello=" + cf['_username'] + " " + cf['_hostname'] + " " + prog_name + " " + prog_version ++ print "Info: querying categories..." ++ url = "http://" + freedb_servers[cf['_freedb_server']]['host'] + "/~cddb/cddb.cgi?" + urllib.quote_plus("cmd=cddb lscat" + "&" + hello + "&proto=6", "=&") ++ f = urllib2.urlopen(url) ++ buf = f.readline() ++ if buf[0:3] == "500": ++ print "Info: LSCAT failed, using builtin categories..." ++ cat = choose_cat() ++ ++ elif buf[0:3] == "210": ++ cat = ["null", ] ++ while 1: ++ buf = f.readline() ++ if not buf: ++ break ++ buf = string.rstrip(buf) ++ if buf != ".": ++ cat.append(buf) ++ f.close() ++ cat = choose_cat(cat) + +- else: +- error("LSCAT failed: " + string.rstrip(buf) + f.read()) ++ else: ++ error("LSCAT failed: " + string.rstrip(buf) + f.read()) + +- print "OK, using `" + cat + "'." ++ print "OK, using category `" + cat + "'." + email = freedb_servers[cf['_freedb_server']]['my_mail'] + print "Your e-mail address is needed to send error messages to you." + x = raw_input("enter your e-mail-address [" + email + "]: ") +@@ -757,11 +758,12 @@ + print "consider submitting via mail (" + progname + " -m). full error:\n" + print err, msg + +-def do_freedb_mailsubmit(file, cd_id): ++def do_freedb_mailsubmit(file, cd_id, cat = None): + warning("Support for freedb submission via e-mail may be dropped in future versions. Please begin to use HTTP to submit your entries (--submit)") + sendmail = '/usr/lib/sendmail -t' + #sendmail = 'cat > /tmp/jack.test.mailsubmit' +- cat = choose_cat() ++ if not cat: ++ cat = choose_cat() + print "OK, using `" + cat + "'." + if string.find(freedb_servers[cf['_freedb_server']]['my_mail'], "@") >= 1 and len(freedb_servers[cf['_freedb_server']]['my_mail']) > 3: + return os.system("( echo 'To: " + freedb_servers[cf['_freedb_server']]['mail'] + "'; echo From: '" + freedb_servers[cf['_freedb_server']]['my_mail'] + "'; echo 'Subject: cddb " + cat + " " + cd_id + "' ; cat '" + file + "' ) | " + sendmail) +diff -urN a/jack_prepare.py jack-3.1.1+cvs20050801/jack_prepare.py +--- a/jack_prepare.py 2006-02-05 15:37:18.000000000 +0000 ++++ jack-3.1.1+cvs20050801/jack_prepare.py 2006-02-05 15:37:12.000000000 +0000 +@@ -461,7 +461,7 @@ + + return status + +-def freedb_submit(): ++def freedb_submit(cat = None): + "submit freedb data on user's request" + if not is_submittable: + error("can't submit in current state, please fix jack.freedb") +@@ -471,9 +471,9 @@ + error("invalid freedb file") + else: + if cf['_freedb_mailsubmit']: +- jack_freedb.do_freedb_mailsubmit(cf['_freedb_form_file'], cd_id) ++ jack_freedb.do_freedb_mailsubmit(cf['_freedb_form_file'], cd_id, cat) + else: +- jack_freedb.do_freedb_submit(cf['_freedb_form_file'], cd_id) ++ jack_freedb.do_freedb_submit(cf['_freedb_form_file'], cd_id, cat) + + ### (9) do query on start + +@@ -516,7 +516,7 @@ + x = raw_input("Would you like to submit these changes to the FreeDB server? (y/N) ") + if string.upper(x[0]) == "Y": + jack_freedb.update_revision(file) +- freedb_submit() ++ freedb_submit(jack_progress.status_all.get('freedb_cat', None)) + + if cf['_query_on_start']: + err, jack_tag.track_names, jack_tag.locale_names, freedb_rename, revision = jack_freedb.interpret_db_file(jack_ripstuff.all_tracks, todo, cf['_freedb_form_file'], verb = cf['_query_on_start'], dirs = 1) |