# HG changeset patch # User Pascal Bellard # Date 1548888164 -3600 # Node ID c49ffc024a6cb078cfc6ae4367dbecd02e7f6d36 # Parent 3232bb7236785528de19c8ad65239ff7bf607497 Add imapbox diff -r 3232bb723678 -r c49ffc024a6c Qt4-qca-ossl/receipt --- a/Qt4-qca-ossl/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/Qt4-qca-ossl/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -9,7 +9,7 @@ MAINTAINER="ben@seawolfsanctuary.com" LICENSE="LGPL2.1" TARBALL="$NAME-$VERSION.tar.bz2" -WEB_SITE="http://delta.affinix.com/$NAME" +WEB_SITE="https://github.com/highfidelity/qca/tree/master/plugins/qca-ossl" WGET_URL="http://delta.affinix.com/download/qca/$MAJORVERSION/plugins/$TARBALL" DEPENDS="glibc-locale libQtCore libQtGui libQtNetwork libQtSvg libQtXml \ diff -r 3232bb723678 -r c49ffc024a6c gecko-mediaplayer/receipt --- a/gecko-mediaplayer/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/gecko-mediaplayer/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -7,7 +7,7 @@ MAINTAINER="jozee@slitaz.org" LICENSE="GPL2" TARBALL="$PACKAGE-$VERSION.tar.gz" -WEB_SITE="https://code.google.com/archive/p/gecko-mediaplayer" +WEB_SITE="https://sites.google.com/site/kdekorte2/gecko-mediaplayer" WGET_URL="http://gecko-mediaplayer.googlecode.com/files/$TARBALL" TAGS="player audio video browser" diff -r 3232bb723678 -r c49ffc024a6c gitso/receipt --- a/gitso/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/gitso/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -7,7 +7,7 @@ MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL3" TARBALL="${PACKAGE}_${VERSION}_src.tar.bz2" -WEB_SITE="https://code.google.com/archive/p/gitso/" +WEB_SITE="https://github.com/AustP/Gitso" WGET_URL="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/gitso/$TARBALL" CONFIG_FILES="/etc/gitso-hosts" diff -r 3232bb723678 -r c49ffc024a6c imapbox/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imapbox/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -0,0 +1,28 @@ +# SliTaz package receipt. + +PACKAGE="imapbox" +GITHASH="c7265e34b03ee41963aad243055a5508c9e88fc9" +VERSION=${GITHASH:0:7} +CATEGORY="network" +SHORT_DESC="Dump imap inbox in a backupable format: html, json and attachements" +MAINTAINER="pascal.bellard@slitaz.org" +LICENSE="MIT" +TARBALL="$PACKAGE-$VERSION.zip" +WEB_SITE="https://github.com/polo2ro/imapbox" +WGET_URL="https://codeload.github.com/polo2ro/imapbox/zip/$GITHASH" + +DEPENDS="python-chardet python-six" +SUGGESTED="python-pdfkit" + +# Rules to configure and make the package. +compile_rules() +{ + patch -p1 < $stuff/slitaz.patch +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/share/imapbox + cp $src/* $fs/usr/share/imapbox +} diff -r 3232bb723678 -r c49ffc024a6c imapbox/stuff/slitaz.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imapbox/stuff/slitaz.patch Wed Jan 30 23:42:44 2019 +0100 @@ -0,0 +1,254 @@ +--- imapbox/mailboxresource.py ++++ imapbox/mailboxresource.py +@@ -9,6 +9,8 @@ + import hashlib + from message import Message + import datetime ++import time ++import rfc822 + + + +@@ -16,10 +18,22 @@ + """Operations on a mailbox""" + + def __init__(self, host, port, username, password, remote_folder): ++ if port == '143': ++ self.mailbox = imaplib.IMAP4(host, port) ++ elif port == '993': + self.mailbox = imaplib.IMAP4_SSL(host, port) + self.mailbox.login(username, password) + self.mailbox.select(remote_folder, readonly=True) + ++ if remote_folder=='INBOX': ++ self.remote_folder='' ++ else ++ r_f=re.sub('INBOX','',remote_folder) ++ if re.findall('^\.',r_f): ++ self.remote_folder=re.sub('\.','/',rf) ++ else: ++ self.remote_folder='/'+r_f ++ + def copy_emails(self, days, local_folder, wkhtmltopdf): + + n_saved = 0 +@@ -50,9 +64,19 @@ + + + def getEmailFolder(self, msg, data): +- if msg['Message-Id']: +- foldername = re.sub('[^a-zA-Z0-9_\-\.()\s]+', '', msg['Message-Id']) ++ if msg['To'] and re.findall('Sent',self.remote_folder): ++ foldername = re.findall("<.*>", msg['To']) ++ if foldername: ++ foldername = re.sub('[\<\>]+', '', foldername[0]) + else: ++ foldername=msg['To'] ++ elif msg['From']: ++ foldername = re.findall("<.*>", msg['From']) ++ if foldername: ++ foldername = re.sub('[\<\>]+', '', foldername[0]) ++ else: ++ foldername=msg['From'] ++ else: + foldername = hashlib.sha224(data).hexdigest() + + year = 'None' +@@ -62,20 +86,33 @@ + year = match.group(1) + + +- return os.path.join(self.local_folder, year, foldername) ++ return os.path.join(self.local_folder+self.remote_folder, self.normalizeDate(msg['Date'])+'_'+foldername) + ++ def normalizeDate(self, datestr): ++ t = email.utils.parsedate_tz(datestr) ++ timeval = time.mktime(t[:-1]) ++ date = email.utils.formatdate(timeval, True) ++ utc = time.gmtime(email.utils.mktime_tz(t)) ++# rfc2822 = '{} {:+03d}00'.format(date[:-6], t[9]//3600) ++ iso8601 = time.strftime('%Y%m%dT%H%M%SZ', utc) + ++ return (iso8601) + ++ + def saveEmail(self, data): + for response_part in data: + if isinstance(response_part, tuple): +- msg = email.message_from_string(response_part[1].decode("utf-8")) ++ try: ++ msg = email.message_from_string(re.sub('^>', '', response_part[1]).decode("utf-8")) # supprime '>' dans l'email ++ except UnicodeError: ++ msg = email.message_from_string(re.sub('^>', '', response_part[1]).decode('latin1').encode('utf-8')) # supprime '>' dans l'email + directory = self.getEmailFolder(msg, data[0][1]) + + if os.path.exists(directory): + return False + + os.makedirs(directory) ++ os.utime(directory,(time.mktime(rfc822.parsedate(msg['Date'])), time.mktime(rfc822.parsedate(msg['Date'])))) + + try: + message = Message(directory, msg) +@@ -86,9 +123,12 @@ + if self.wkhtmltopdf: + message.createPdfFile(self.wkhtmltopdf) + ++ os.utime(directory,(time.mktime(rfc822.parsedate(msg['Date'])), time.mktime(rfc822.parsedate(msg['Date'])))) ++ + except Exception as e: + # ex: Unsupported charset on decode + print(directory) ++ os.utime(directory,(time.mktime(rfc822.parsedate(msg['Date'])), time.mktime(rfc822.parsedate(msg['Date'])))) + if hasattr(e, 'strerror'): + print("MailboxClient.saveEmail() failed:", e.strerror) + else: +--- imapbox/message.py ++++ imapbox/message.py +@@ -15,6 +15,8 @@ + import cgi + import time + import pkgutil ++import rfc822 ++import sys + + from six.moves import html_parser + +@@ -82,14 +84,15 @@ + except email.Errors.HeaderParseError: + # This already append in email.base64mime.decode() + # instead return a sanitized ascii string +- return header_text.encode('ascii', 'replace').decode('ascii') ++ return header_text.encode('ascii', 'replace').decode(default) + else: + for i, (text, charset) in enumerate(headers): + headers[i]=text + if charset: +- headers[i]=str(text, charset) ++ text = unicode(text,charset) ++ headers[i]=text + else: +- headers[i]=str(text) ++ headers[i]=text.decode('utf-8') + return u"".join(headers) + + +@@ -102,21 +105,27 @@ + # use the same for both and see later + name=addr + ++ headers=decode_header(name) + try: +- # address must be ascii only +- addr=addr.encode('ascii') ++ addr = addr.encode("ascii") + except UnicodeError: +- addr='' ++ addr = '' + else: + # address must match adress regex + if not email_address_re.match(addr.decode("utf-8")): + addr='' +- addrs[i]=(self.getmailheader(name), addr.decode("utf-8")) ++ addrs[i]=(self.getmailheader(name), "utf-8") + return addrs + + def getSubject(self): +- if not hasattr(self, 'subject'): +- self.subject = self.getmailheader(self.msg.get('Subject', '')) ++# if not hasattr(self, 'subject'): ++# self.subject = self.getmailheader(self.msg.get('Subject'),'') ++ headers=decode_header(self.msg.get('Subject')) ++ for i, (text, charset) in enumerate(headers): ++ if charset: ++ self.subject = unicode(text,charset) ++ else: ++ self.subject=text.decode('utf-8') + return self.subject + + def getFrom(self): +@@ -172,6 +181,7 @@ + json_file.write(data) + + json_file.close() ++ os.utime('%s/metadata.json' %(self.directory),(time.mktime(rfc822.parsedate(self.msg['Date'])), time.mktime(rfc822.parsedate(self.msg['Date'])))) + + + +@@ -180,6 +190,7 @@ + f = gzip.open('%s/raw.eml.gz' %(self.directory), 'wb') + f.write(data) + f.close() ++ os.utime('%s/raw.eml.gz' %(self.directory),(time.mktime(rfc822.parsedate(self.msg['Date'])), time.mktime(rfc822.parsedate(self.msg['Date'])))) + + + def getPartCharset(self, part): +@@ -192,14 +203,23 @@ + if not hasattr(self, 'text_content'): + self.text_content = '' + for part in parts: ++ raw_content_0 = part.get_payload() + raw_content = part.get_payload(decode=True) + charset = self.getPartCharset(part) + self.text_content += raw_content.decode(charset, "replace") ++ if charset!='utf-8' and self.text_content: ++ try: ++ self.text_content=self.text_content.encode('raw_unicode_escape').decode('utf-8') # Double-decoding unicode ++ except UnicodeError: ++ self.text_content=raw_content_0.decode('utf_8') + return self.text_content + + + def createTextFile(self, parts): +- utf8_content = self.getTextContent(parts) ++ intro='' ++ if self.getSubject(): ++ intro='==> ' + self.getSubject() + '\r\n\r\n' ++ utf8_content = intro + self.getTextContent(parts) + with open(os.path.join(self.directory, 'message.txt'), 'wb') as fp: + fp.write(bytearray(utf8_content, 'utf-8')) + +@@ -208,9 +228,15 @@ + self.html_content = '' + + for part in parts: ++ raw_content_0 = part.get_payload() + raw_content = part.get_payload(decode=True) + charset = self.getPartCharset(part) + self.html_content += raw_content.decode(charset, "replace") ++ if charset!='utf-8' and self.html_content: ++ try: ++ self.html_content.encode('raw_unicode_escape').decode('utf-8') # Double-decoding unicode ++ except UnicodeError: ++ self.html_content=raw_content_0.decode('utf_8') + + m = re.search(']*>(.+)<\/body>', self.html_content, re.S | re.I) + if (m != None): +@@ -304,9 +330,11 @@ + + if message_parts['text']: + self.createTextFile(message_parts['text']) ++ os.utime('%s/message.txt' %(self.directory),(time.mktime(rfc822.parsedate(self.msg['Date'])), time.mktime(rfc822.parsedate(self.msg['Date'])))) + + if message_parts['html']: + self.createHtmlFile(message_parts['html'], message_parts['embed_images']) ++ os.utime('%s/message.html' %(self.directory),(time.mktime(rfc822.parsedate(self.msg['Date'])), time.mktime(rfc822.parsedate(self.msg['Date'])))) + + if message_parts['files']: + attdir = os.path.join(self.directory, 'attachments') +@@ -317,6 +345,8 @@ + payload = afile[0].get_payload(decode=True) + if payload: + fp.write(payload) ++ os.utime('%s/attachments/%s' %(self.directory,afile[1]),(time.mktime(rfc822.parsedate(self.msg['Date'])), time.mktime(rfc822.parsedate(self.msg['Date'])))) ++ os.utime('%s/attachments' %(self.directory),(time.mktime(rfc822.parsedate(self.msg['Date'])), time.mktime(rfc822.parsedate(self.msg['Date'])))) + + + def createPdfFile(self, wkhtmltopdf): +@@ -325,5 +355,6 @@ + pdf_path = os.path.join(self.directory, 'message.pdf') + config = pdfkit.configuration(wkhtmltopdf=wkhtmltopdf) + pdfkit.from_file(html_path, pdf_path, configuration=config) ++ os.utime('%s/message.pdf' %(self.directory),(time.mktime(rfc822.parsedate(self.msg['Date'])), time.mktime(rfc822.parsedate(self.msg['Date'])))) + else: + print("Couldn't create PDF message, since \"pdfkit\" module isn't installed.") diff -r 3232bb723678 -r c49ffc024a6c libQtMimeTypes-dev/receipt --- a/libQtMimeTypes-dev/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/libQtMimeTypes-dev/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -7,7 +7,7 @@ SHORT_DESC="A Qt4 backport of the Qt5 mimetypes API (development)" MAINTAINER="al.bobylev@gmail.com" LICENSE="LGPL2.1" -WEB_SITE="https://qt.gitorious.org/qtplayground/mimetypes" +WEB_SITE="https://web.archive.org/web/20121025184403/http://qt.gitorious.org/qtplayground/mimetypes" WANTED="libQtMimeTypes" DEPENDS="libQtMimeTypes pkg-config" diff -r 3232bb723678 -r c49ffc024a6c libQtMimeTypes/receipt --- a/libQtMimeTypes/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/libQtMimeTypes/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -7,7 +7,7 @@ SHORT_DESC="A Qt4 backport of the Qt5 mimetypes API" MAINTAINER="al.bobylev@gmail.com" LICENSE="LGPL2.1" -WEB_SITE="https://qt.gitorious.org/qtplayground/mimetypes" +WEB_SITE="https://web.archive.org/web/20121025184403/http://qt.gitorious.org/qtplayground/mimetypes" TARBALL="$PACKAGE-$BRANCH.tar.gz" WGET_URL="$WEB_SITE/archive/$BRANCH.tar.gz" diff -r 3232bb723678 -r c49ffc024a6c openbox-theme-blinder/receipt --- a/openbox-theme-blinder/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/openbox-theme-blinder/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -6,7 +6,7 @@ SHORT_DESC="Blinder - theme for Openbox 3" MAINTAINER="al.bobylev@gmail.com" LICENSE="PublicDomain" -WEB_SITE="http://desktopstylish.tumblr.com/post/120897023300/blinder-the-openbox-3-theme-download" +WEB_SITE="https://web.archive.org/web/20151101012710/http://desktopstylish.tumblr.com/post/120897023300/blinder-the-openbox-3-theme-download" TARBALL="$PACKAGE-$VERSION.tar.bz2" WGET_URL="https://drive.google.com/uc?export=download&id=0B4Re2DvqOMqlQURSR3V5dzB4aXc" TAGS="hackdorte openbox" diff -r 3232bb723678 -r c49ffc024a6c p2c/receipt --- a/p2c/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/p2c/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -7,7 +7,7 @@ MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL2" TARBALL="$PACKAGE-$VERSION.tar.gz" -WEB_SITE="https://schneider.ncifcrf.gov/p2c/" +WEB_SITE="http://users.fred.net/tds/lab/p2c/" WGET_URL="http://darkstar.ist.utl.pt/slackware/slackware_source/d/p2c/$TARBALL" TAGS="pascal" diff -r 3232bb723678 -r c49ffc024a6c qtwitter/receipt --- a/qtwitter/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/qtwitter/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -7,7 +7,7 @@ MAINTAINER="ben@seawolfsanctuary.com" LICENSE="LGPL3" TARBALL="$PACKAGE-$VERSION-src.tar.gz" -WEB_SITE="http://blog.ayoy.net/qtwitter" +WEB_SITE="https://web.archive.org/web/20130113073128/http://blog.ayoy.net/qtwitter" WGET_URL="http://files.ayoy.net/$PACKAGE/release/$VERSION/src/$TARBALL" DEPENDS="glibc-locale libQtCore libQtGui libQtNetwork libQtSvg libQtXml \ diff -r 3232bb723678 -r c49ffc024a6c slim-theme-japan-art/receipt --- a/slim-theme-japan-art/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/slim-theme-japan-art/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -6,7 +6,7 @@ SHORT_DESC="Japan Art - theme for SLiM" MAINTAINER="al.bobylev@gmail.com" LICENSE="PublicDomain" -WEB_SITE="http://desktopstylish.tumblr.com/post/120590949085/japan-art-slim-theme-download" +WEB_SITE="https://web.archive.org/web/20151101010005/http://desktopstylish.tumblr.com/post/120590949085/japan-art-slim-theme-download" TAGS="hackdorte slim" COOKOPTS="!pngquant" diff -r 3232bb723678 -r c49ffc024a6c smx-dev/receipt --- a/smx-dev/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/smx-dev/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -6,7 +6,7 @@ SHORT_DESC="text-embedded macro processing language, development files." MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL2" -WEB_SITE="http://www.smxlang.org/" +WEB_SITE="https://web.archive.org/web/20180323014153/http://www.smxlang.org/" WANTED="smx" DEPENDS="smx" diff -r 3232bb723678 -r c49ffc024a6c smx/receipt --- a/smx/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/smx/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -7,7 +7,7 @@ MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL2" TARBALL="$PACKAGE-$VERSION.tar.gz" -WEB_SITE="http://www.smxlang.org/" +WEB_SITE="https://web.archive.org/web/20180323014153/http://www.smxlang.org/" WGET_URL="http://$PACKAGE.googlecode.com/files/$TARBALL" DEPENDS="unixODBC sqlite libgd libcrypto gcc-lib-base zlib" diff -r 3232bb723678 -r c49ffc024a6c superswitcher/receipt --- a/superswitcher/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/superswitcher/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -7,7 +7,7 @@ MAINTAINER="mallory@sweetpeople.org" LICENSE="GPL2" TARBALL="$PACKAGE-$VERSION.tar.gz" -WEB_SITE="https://code.google.com/archive/p/superswitcher/" +WEB_SITE="https://github.com/nigeltao/superswitcher" WGET_URL="http://$PACKAGE.googlecode.com/files/$TARBALL" DEPENDS="gtk+ libwnck GConf" diff -r 3232bb723678 -r c49ffc024a6c ttf-inconsolata-dz/receipt --- a/ttf-inconsolata-dz/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/ttf-inconsolata-dz/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -6,7 +6,7 @@ SHORT_DESC="Monospace font for pretty code listings and for the terminal (modified to have straight single and double quotes)" MAINTAINER="al.bobylev@gmail.com" LICENSE="SIL_OFL" -WEB_SITE="http://nodnod.net/2009/feb/12/adding-straight-single-and-double-quotes-inconsola/" +WEB_SITE="https://web.archive.org/web/20170521002049/http://nodnod.net/2009/feb/12/adding-straight-single-and-double-quotes-inconsola/" TARBALL="$PACKAGE-$VERSION.zip" WGET_URL="http://media.nodnod.net/Inconsolata-dz.otf.zip" TAGS="font otf" diff -r 3232bb723678 -r c49ffc024a6c verbiste/receipt --- a/verbiste/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/verbiste/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -7,7 +7,7 @@ MAINTAINER="pankso@slitaz.org" LICENSE="GPL2" TARBALL="$PACKAGE-$VERSION.tar.gz" -WEB_SITE="http://perso.b2b2c.ca/~sarrazip/dev/verbiste.html" +WEB_SITE="https://web.archive.org/web/20180606070141/http://perso.b2b2c.ca/~sarrazip/dev/verbiste.html" WGET_URL="http://perso.b2b2c.ca/~sarrazip/dev/$TARBALL" DEPENDS="gtk+ libxml2" diff -r 3232bb723678 -r c49ffc024a6c vidalia/receipt --- a/vidalia/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/vidalia/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -7,7 +7,7 @@ MAINTAINER="paul@slitaz.org" LICENSE="GPL2 LGPL3" TARBALL="$PACKAGE-$VERSION.tar.gz" -WEB_SITE="https://www.torproject.org/vidalia/" +WEB_SITE="https://web.archive.org/web/20141121142650/https://www.torproject.org/projects/vidalia" WGET_URL="https://www.torproject.org/dist/$PACKAGE/$TARBALL" DEPENDS="tor libQtGui libQtXml libegl-mesa" diff -r 3232bb723678 -r c49ffc024a6c wepbuster/receipt --- a/wepbuster/receipt Tue Jan 29 18:11:07 2019 +0100 +++ b/wepbuster/receipt Wed Jan 30 23:42:44 2019 +0100 @@ -6,7 +6,7 @@ SHORT_DESC="A set of tools for auditing wireless networks" MAINTAINER="pascal.bellard@slitaz.org" LICENSE="BSD" -WEB_SITE="https://code.google.com/archive/p/wepbuster/" +WEB_SITE="https://github.com/google-code-export/wepbuster" TARBALL="$PACKAGE-$VERSION.tgz" WGET_URL="http://wepbuster.googlecode.com/files/$TARBALL"