Projects
Multimedia
cclive
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 6
View file
cclive.changes
Changed
@@ -1,4 +1,40 @@ ------------------------------------------------------------------- +Tue Oct 28 04:16:38 UTC 2014 - avvissu@yandex.ru + +- Update to 0.9.3 (unstable): + * improved option parsing + * improved input parsing + * libquvi 0.9+ support + * licensing changes +- Spec file cleanup + +------------------------------------------------------------------- +Sun Oct 26 16:30:15 UTC 2014 - avvissu@yandex.ru + +- Update to 0.7.16: + * fix network options work only partially or not at all +- Change in 0.7.15: + * add --timestamp: Try to preserve modification time +- Change in 0.7.14: + * --filename-format: Print a notice of deprecated %h sequence + * fix warning message for "--query-formats deprecated" +- Change in 0.7.13: + * add --print-config + * add short-option for --verbose-libcurl + * fix skip transfer with USR1, do not retry transfer +- Change in 0.7.12: + * add quvi compatibility layer + * add short-option -h + * add short-option -v + * deprecate --format, add --stream + * deprecate --query-formats, add --print-streams + * fix do not ignore I/O errors during file transfer +- Change in 0.7.11 (no user-visible changes) +- Change in 0.7.10: + * manual: Revise descriptions for option sections + * fix return non-zero exit status if failure + +------------------------------------------------------------------- Sun Jul 8 09:15:40 UTC 2012 - dnh@opensuse.org - update to 0.7.9
View file
cclive.spec
Changed
@@ -1,19 +1,42 @@ -# vim: set ts=4 sw=4 et: +# +# spec file for package cclive +# +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + Name: cclive -Version: 0.7.9 +Version: 0.9.3 Release: 0 Summary: Command Line Video Extraction Utility -Source: http://sourceforge.net/projects/cclive/files/0.7/cclive-%{version}.tar.bz2 -URL: http://cclive.sourceforge.net/ +License: AGPL-3.0 and GPL-3.0 Group: Productivity/Networking/Other -License: GNU General Public License version 3 (GPL v3) -BuildRoot: %{_tmppath}/build-%{name}-%{version} -BuildRequires: libcurl-devel >= 7.20 +Url: http://cclive.sourceforge.net/ +Source: http://sourceforge.net/projects/cclive/files/0.7/cclive-%{version}.tar.xz +BuildRequires: autoconf +BuildRequires: automake BuildRequires: boost-devel -BuildRequires: pcre-devel >= 8.02 +BuildRequires: gcc-c++ +BuildRequires: glibc-devel +BuildRequires: glibmm2-devel +BuildRequires: libcurl-devel >= 7.20 BuildRequires: libquvi-devel >= 0.2.0 -BuildRequires: gcc-c++ make glibc-devel pkg-config autoconf automake libtool +BuildRequires: libtool +BuildRequires: make +BuildRequires: pcre-devel >= 8.02 +BuildRequires: pkg-config +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description cclive is a command line video extraction utility similar to clive but focuses @@ -28,19 +51,18 @@ %setup -q %build +#autoreconf -fiv %configure make %{?_smp_mflags} V=1 %install -%makeinstall - -%clean -%{?buildroot:%__rm -rf "%{buildroot}"} +make DESTDIR=%{buildroot} install %{?_smp_mflags} %files %defattr(-,root,root) %doc ChangeLog COPYING NEWS README +%{_bindir}/ccl %{_bindir}/cclive %doc %{_mandir}/man1/cclive.1%{ext_man}
View file
cclive-0.7.9.tar.bz2/doc/man1/cclive.1.pod
Deleted
@@ -1,388 +0,0 @@ -=pod - -=head1 NAME - -cclive - media download tool - -=head1 SYNOPSIS - -cclive [options] [url | file...] - -=head1 DESCRIPTION - -cclive is a tool for downloading media from YouTube and similar -websites. It has a low memory footprint compared to other existing -tools. - -=head1 OPTIONS - -Unless an arg is specified in the command line, cclive reads from the -stdin. The command line args may be either URLs or files to read. -If cclive reads from either stdin or files, it expects each URL to be -separated by a newline or whitespace character. - -=head2 --version - -Print version and exit. - -=head2 --help - -Print help and exit. - -=head2 --license - -Print license and exit. - -=head2 --support - -Print supported hosts and exit. - -=head2 --verbose-libcurl - -Turn on libcurl verbose output. - -=head2 -q, --quiet - -Turn off all output to stdout and stderr with the exception of -C<--verbose-libcurl>, if enabled, libcurl will continue to print -messages to stderr. - -=head2 -b, --background - -Go to background after startup. Output will be written to -the file specified with C<--log-file>. - -=head2 -F, --query-formats - -Query available formats to the URL. The returned array is created -from the data returned by the server. You can use the -I<format strings> in this array with C<--format>. - -The available formats are determined by the I<libquvi script> -responsible for parsing the media details. - -See also L</EXAMPLES>, C<--format> and C<--prefer-format>. - -=head2 -f, --format I<arg> (=default) - -Download the format I<arg> of the media. The I<arg> may also be C<default>, -C<best>, C<help> or C<list>. Note, however, that the C<list> and the C<help> -are I<deprecated> and will be removed in the later versions of cclive. -The I<arg> value is used with B<all> of the URLs fed to cclive. - -If the I<arg> is C<best>, the I<libquvi script> responsible for parsing -the media details will determine the C<best> format available to an URL. - -If the I<arg> is C<default> the I<libquvi script> attempts to return an -URL to whatever it deemed to be the C<default> format for the URL. - -The I<libquvi script> will return the C<default> format if the I<arg> -was unrecognized or the requested format was not available. - -You can find more information about the YouTube specific "fmt" IDs at: - <http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs> - -See also L</EXAMPLES>, C<--query-formats> and C<--prefer-format>. - -=head2 -c, --continue - -Resume partially downloaded media. - -=head2 -W, --overwrite - -Overwrite existing media. - -=head2 -O, --output-file I<arg> - -Write media to I<arg>. Overrides C<--filename-format>. - -=head2 -n, --no-download - -Do not download the media, print details only. - -=head2 -r, --no-resolve - -Do not resolve URL redirections. If enabled, breaks the compatibility -with most "shortened" URLs. - -=head2 --no-proxy - -Disable use of HTTP proxy. Overrides both C<--proxy> and http_proxy environment -settings. - -=head2 --log-file I<arg> (=cclive_log) - -Write log output to I<arg>. Ignored unless used with C<--background>. -Overwrites the existing I<arg> file (if any). See also C<--background> -and C<--update-interval>. - -=head2 --config-file I<arg> (=~/.ccliverc) - -Path to a file to read cclive arguments from. - -=head1 OPTIONS - CONFIGURATION - -In addition to the command line, the configurable options may also be read -from the configuration file. See L</FILES>. - -=head2 -p, --prefer-format I<arg> - -Download the I<specified> format of the media when the pattern matches -to the media page URL. - -I<arg> is a B<string pair> of I<pattern> (regular expression) and -I<format>. The character ':' is expected to separate these two -strings, e.g. C<pattern:format>. - -C<--format> overrides C<--prefer-format>. cclive accepts multiple -occurrences of C<--prefer-format>. - -See also L</EXAMPLES>, C<--query-formats> and C<--format>. - -=head2 --progressbar I<arg> (=normal) - -Use the progressbar of type I<arg>. Ignored with C<--background> which -will always use the C<dotline> type. Possible values: - - normal (default) - dotline (implied by --background) - simple (basic) - -=head2 --update-interval I<arg> (=1) - -Specify I<arg> progressbar update interval in seconds. Use of decimal -fractions, e.g. "0.2" or "1.99", is acceptable. - -=head2 --filename-format I<arg> (="%t.%s") - -How the downloaded media file should be named. Each occurence of the -following specifiers will be replaced in the I<arg>: - - %t .. Media title - %i .. Media ID - %h .. Media host ID (e.g. "vimeo") - %s .. Media file suffix (e.g. "flv") - -See also C<--tr>. - -=head2 --output-dir I<arg> - -Write downloaded media to I<arg> directory. - -=head2 -t, --tr I<arg> - -Where I<arg> is a pattern (regular expression). C<--tr> can be used to -translate the characters in the media titles before they are used in -the filenames of the downloaded media. Default is C</(\w|\s)/g>. - -cclive accepts multiple occurrences of C<--tr>. See also L</EXAMPLES>. - -=head2 --exec I<arg> - -Invoke I<arg> after each successfully finished download. Each occurence -of the following specifiers will be replaced in the I<arg>: - - %f .. Full path to the downloaded media file - %n .. Name of the downloaded media file - %t .. Media title (unfiltered) - -The I<arg> is also invoked if the media is fully retrieved already. -cclive accepts multiple occurrences of C<--exec>. See also L</EXAMPLES>. - -=head2 --agent I<arg> (="Mozilla/5.0") - -Identify cclive as I<arg> to the HTTP servers. - -=head2 --proxy I<arg> - -Use I<arg> for HTTP proxy, e.g. "http://foo:1234". Overrides -http_proxy environment setting.
View file
cclive-0.7.9.tar.bz2/m4/version.m4
Deleted
@@ -1,1 +0,0 @@ -m4_define([_CCLIVE_VERSION], [0.7.9])
View file
cclive-0.7.9.tar.bz2/src/cc/license.cpp
Deleted
@@ -1,41 +0,0 @@ -/* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> - * - * 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 3 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, see <http://www.gnu.org/licenses/>. - */ - -namespace cc -{ - -char LICENSE[] = - "/* cclive\n" - " * Copyright (C) 2010,2011 Toni Gundogdu <legatvs@gmail.com>\n" - " *\n" - " * This program is free software: you can redistribute it and/or modify\n" - " * it under the terms of the GNU General Public License as published by\n" - " * the Free Software Foundation, either version 3 of the License, or\n" - " * (at your option) any later version.\n" - " *\n" - " * This program is distributed in the hope that it will be useful,\n" - " * but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" - " * GNU General Public License for more details.\n" - " *\n" - " * You should have received a copy of the GNU General Public License\n" - " * along with this program. If not, see <http://www.gnu.org/licenses/>.\n" - " */"; - -} // namspace cclive - -// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/cc/log.cpp
Deleted
@@ -1,135 +0,0 @@ -/* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> - * - * 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 3 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, see <http://www.gnu.org/licenses/>. - */ - -#include <stdexcept> -#include <cerrno> - -#include <boost/filesystem.hpp> - -#include <ccutil> -#include <cclog> - -namespace cc -{ - -namespace io = boost::iostreams; - -io::filtering_ostream log; - -omit_sink::omit_sink(bool b/*=false*/) : _omit(b) { } - -std::streamsize omit_sink::write(const char *s, std::streamsize n) -{ - if (!_omit) std::clog.write(s,n); - return n; -} - -// Constructor. - -flushable_file_sink::flushable_file_sink( - const std::string& fpath, - const std::ios_base::openmode mode/*=std::ios::trunc|std::ios::out*/) - : _mode(mode), _fpath(fpath) -{ - _open(); -} - -// Copy constructor. - -flushable_file_sink::flushable_file_sink(const flushable_file_sink& f) -{ - _swap(f); -} - -// Copy assignment operator. - -flushable_file_sink& -flushable_file_sink::operator=(const flushable_file_sink& f) -{ - if (this != &f) _swap(f); - return *this; -} - -void flushable_file_sink::_swap(const flushable_file_sink& f) -{ - close(); - _fpath = f._fpath; - _mode = f._mode; - _open(); -} - -bool flushable_file_sink::is_open() const -{ - return _f.is_open(); -} - -std::streamsize -flushable_file_sink::write(const char *s, std::streamsize n) -{ - _f.write(s,n); - return n; -} - -std::streampos flushable_file_sink::seek( - std::streamoff o, - std::ios_base::seekdir d) -{ - _f.seekp(o,d); - _f.seekg(o,d); - return o; -} - -std::streamsize flushable_file_sink::read(char_type *t, std::streamsize n) -{ - _f.read(t,n); - return n; -} - -bool flushable_file_sink::flush() -{ - _f.flush(); - return true; -} - -void flushable_file_sink::close() -{ - flush(); - _f.close(); -} - -namespace fs = boost::filesystem; - -void flushable_file_sink::_open() -{ - _fpath = fs::system_complete(fs::path(_fpath)).string(); - _f.open(_fpath.c_str(), _mode); - if (_f.fail()) - { - std::string s = _fpath + ": "; - - if (errno) - s += cc::perror(); - else - s += "unknown file open error"; - - throw std::runtime_error(s); - } -} - -} // namspace cclive - -// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/cc/options.cpp
Deleted
@@ -1,275 +0,0 @@ -/* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> - * - * 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 3 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, see <http://www.gnu.org/licenses/>. - */ - -#include <ccinternal> - -#include <iostream> -#include <fstream> -#include <cstring> - -#include <boost/filesystem.hpp> -#include <boost/foreach.hpp> - -#ifndef foreach -#define foreach BOOST_FOREACH -#endif - -#include <ccre> -#include <ccoptions> - -namespace cc -{ - -namespace opts = boost::program_options; -namespace fs = boost::filesystem; - -typedef std::vector<std::string> vst; - -void options::exec(int argc, char **argv) -{ - // Path to ccliverc. - -#if BOOST_FILESYSTEM_VERSION > 2 - fs::path conf_path(fs::current_path()); -#else - fs::path conf_path(fs::current_path<fs::path>()); -#endif - - const char *home = getenv("HOME"); - - if (home && strlen(home) > 0) - conf_path = fs::system_complete(fs::path(home)); - - conf_path /= -#ifndef _WIN32 - std::string(".") + -#endif - std::string("ccliverc"); - - // Construct options. - - opts::options_description generic; - std::string conf_file; - - generic.add_options() - ("version", - "Print version and exit") - ("help", - "Print help and exit") - ("license", - "Print license and exit") - ("support", - "Print supported websites and exit") - ("verbose-libcurl", - "Turn on libcurl verbose output") - ("quiet,q", - "Turn off all output, excl. errors") -#ifdef HAVE_FORK - ("background,b", - "Go to background") -#endif - ("query-formats,F", - "Query available formats to URL") - ("format,f", - opts::value<std::string>(), - "Download media format") - ("continue,c", - "Resume partially downloaded media") - ("overwrite,W", - "Overwrite existing media") - ("output-file,O", - opts::value<std::string>(), - "Write media to arg") - ("no-download,n", - "Do not download media, print details") - ("no-resolve,r", - "Do not resolve URL redirections") - ("no-proxy", - "Do not use HTTP proxy") - ("log-file", - opts::value<std::string>()->default_value("cclive_log"), - "Write log output to arg") - ("config-file", - opts::value<std::string>(&conf_file)->default_value(conf_path.string()), - "Read args from arg") - ; - - // Config. - - opts::options_description config("Configuration"); - - config.add_options() - ("prefer-format,p", - opts::value<std::vector<std::string> >()->composing(), - "Preferred format [domain:format[,...]]") - ("progressbar", - opts::value<std::string>()->default_value("normal"), - "Use progressbar arg") - ("update-interval", - opts::value<double>()->default_value(1.0), - "Update interval of progressbar") - ("filename-format", - opts::value<std::string>()->default_value("%t.%s"), - "Downloaded media filename format") - ("output-dir", - opts::value<std::string>(), - "Write downloaded media to arg directory") - ("tr,t", - opts::value<vst>()->composing(), - "Translate characters in media title") - ("regexp", - opts::value<std::string>(), - "Regexp to cleanup media title (depr.)") - ("subst", opts::value<std::string>(), - "Replace matched occurences in filename (depr.)") - ("exec", opts::value<vst>()->composing(), - "Invoke arg after each finished download") - ("agent", - opts::value<std::string>()->default_value("Mozilla/5.0"), - "Identify as arg to HTTP servers") - ("proxy", opts::value<std::string>(), - "Use proxy for HTTP connections") - ("throttle", opts::value<int>()->default_value(0), - "Do not exceed transfer rate arg KB/s") - ("connect-timeout", opts::value<int>()->default_value(30), - "Seconds connecting allowed to take") - ("transfer-timeout", opts::value<int>()->default_value(0), - "Seconds transfer allowed to take") - ("dns-cache-timeout", opts::value<int>()->default_value(60), - "Seconds DNS resolves kept in memory") - ("max-retries", opts::value<int>()->default_value(5), - "Max download attempts before giving up") - ("retry-wait", opts::value<int>()->default_value(5), - "Time to wait before retrying") - ; - - // Hidden. - - opts::options_description hidden; - - hidden.add_options() - ("url", opts::value<vst>(), "url"); - - // Visible. - - _visible.add(generic).add(config); - - // Command line options. - - opts::options_description cmdline_options; - cmdline_options.add(generic).add(config).add(hidden); - - // Config file options. - - opts::options_description config_file_options; - config_file_options.add(config); - - // Positional. - - opts::positional_options_description p; - p.add("url", -1); - - // Parse. - - store(opts::command_line_parser(argc,argv) - .options(cmdline_options).positional(p).run(), _map); - notify(_map); - - // Read config. - - std::ifstream ifs(conf_file.c_str()); - - if (ifs) - { - store(parse_config_file(ifs, config_file_options), _map); - notify(_map);
View file
cclive-0.7.9.tar.bz2/src/cc/progressbar.cpp
Deleted
@@ -1,427 +0,0 @@ -/* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> - * - * 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 3 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, see <http://www.gnu.org/licenses/>. - */ - -#include <ccinternal> - -#include <iomanip> -#include <cstdio> -#include <ctime> - -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif - -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif - -#ifdef HAVE_SIGNAL_H -#include <signal.h> -#endif - -#ifdef HAVE_SYS_IOCTL_H -#include <sys/ioctl.h> -#endif - -#include <boost/date_time/posix_time/posix_time.hpp> -#include <boost/program_options/variables_map.hpp> -#include <boost/filesystem.hpp> - -#include <ccquvi> -#include <ccfile> -#include <cclog> -#include <ccprogressbar> - -#if defined(SIGWINCH) && defined(TIOCGWINSZ) -#define WITH_RESIZE -#endif - -namespace cc -{ -#ifdef WITH_RESIZE -static volatile sig_atomic_t recv_sigwinch; - -static void handle_sigwinch(int s) -{ - recv_sigwinch = 1; -} - -static size_t get_term_width() -{ - const int fd = fileno(stderr); - - winsize wsz; - - if (ioctl(fd, TIOCGWINSZ, &wsz) < 0) - return 0; - - return wsz.ws_col; -} -#endif // WITH_RESIZE - -namespace po = boost::program_options; - -progressbar::progressbar(const file& f, - const quvi::url& u, - const po::variables_map& map) - : _update_interval(1), - _expected_bytes(u.content_length()), - _initial_bytes(f.initial_length()), - _time_started(0), - _last_update(0), - _term_width(0), - _dot_count(0), - _count(0), - _width(0), - _file(f), - _done(false), - _mode(normal) -{ - if (_initial_bytes > _expected_bytes) - _expected_bytes = _initial_bytes; - -#ifdef WITH_RESIZE - signal(SIGWINCH, handle_sigwinch); - - if (!_term_width || recv_sigwinch) - { - _term_width = get_term_width(); - - if (!_term_width) - _term_width = default_term_width; - } -#else - _term_width = default_term_width; -#endif - - _width = _term_width; - - time(&_time_started); - - if (map.count("background")) - _mode = dotline; - else - { - const std::string s = map["progressbar"].as<std::string>(); - if (s == "simple") - _mode = simple; - else if (s == "dotline") - _mode = dotline; - } - - _update_interval = fabs(map["update-interval"].as<double>()); -} - -static double to_mb(const double bytes) -{ - return bytes/(1024*1024); -} - -namespace pt = boost::posix_time; - -static std::string to_s(const int secs) -{ - pt::time_duration td = pt::seconds(secs); - return pt::to_simple_string(td); -} - -static std::string to_unit(double& rate) -{ - std::string units = "K/s"; - if (rate >= 1024.0*1024.0*1024.0) - { - rate /= 1024.0*1024.0*1024.0; - units = "G/s"; - } - else if (rate >= 1024.0*1024.0) - { - rate /= 1024.0*1024.0; - units = "M/s"; - } - else - rate /= 1024.0; - return units; -} - -namespace fs = boost::filesystem; - -void progressbar::update(double now) -{ - time_t tnow; - - time(&tnow); - - const time_t elapsed = tnow - _time_started; - - bool force_update = false; - -#ifdef WITH_RESIZE - if (recv_sigwinch && _mode == normal) - { - const size_t old_term_width = _term_width; - - _term_width = get_term_width(); - - if (!_term_width) - _term_width = default_term_width; - - if (_term_width != old_term_width) - { - _width = _term_width; - force_update = true; - } - - recv_sigwinch = 0; - } -#endif // WITH_RESIZE - - const bool inactive = now == 0; - - if (!_done) - { - if ((elapsed - _last_update) < _update_interval - && !force_update) - { - return;
View file
cclive-0.7.9.tar.bz2/src/quvi
Deleted
-(directory)
View file
cclive-0.7.9.tar.bz2/src/quvi/ccquvi.h
Deleted
@@ -1,177 +0,0 @@ -/* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> - * - * 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 3 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, see <http://www.gnu.org/licenses/>. - */ - -#ifndef cclive_ccquvi_h -#define cclive_ccquvi_h - -#include <string> -#include <vector> -#include <map> - -#include <quvi/quvi.h> - -namespace quvi -{ - -class options; -class query; -class media; -class error; -class url; - -// Version. - -std::string version(); -std::string version_long(); - -// To string. - -std::string support_to_s(const std::map<std::string,std::string>&); - -// Options. - -class options -{ - friend class query; - friend class error; -public: - options(); - options(const options&); - options& operator=(const options&); - virtual ~options(); -public: - void statusfunc(quvi_callback_status); - void format(const std::string&); - void resolve(const bool); - void verify(const bool); -private: - void _swap(const options&); -private: - quvi_callback_status _statusfunc; - std::string _format; - bool _resolve; - bool _verify; -}; - -// Query. - -class query -{ -public: - query(); - query(const query&); - query& operator=(const query&); - virtual ~query(); -public: - std::string formats(const std::string& url, const options&) const; - media parse(const std::string& url, const options&) const; - std::map<std::string,std::string> support() const; - void* curlHandle() const; -private: - void _set_opts(const options&) const; - void _init(); - void _close(); -private: - quvi_t _quvi; - void*_curl; -}; - -// Link. - -class url -{ -public: - url(); - url(quvi_media_t); - url(const url&); - url& operator=(const url&); - virtual ~url(); -public: - const std::string& content_type() const; - const std::string& media_url() const; - const std::string& suffix() const; - double content_length() const; - bool ok() const; -private: - void _swap(const url&); -private: - std::string _contentType; - double _contentLength; - std::string _suffix; - std::string _url; -}; - -// Media. - -class media -{ - friend std::ostream& operator<<(std::ostream&, const media&); -public: - media(); - media(quvi_media_t); - media(const media&); - media& operator=(const media&); - virtual ~media(); -public: - const std::string& title() const; - const std::string& host() const; - const std::string& url() const; - const std::string& id() const; - const std::string& format() const; - void print(std::ostream&); - long http_code() const; - quvi::url next_url(); - std::string to_s(); -private: - void _swap(const media&); -private: - std::vector<quvi::url>::const_iterator _current_url; - std::vector<quvi::url> _urls; - std::string _format; - std::string _title; - std::string _host; - std::string _url; - std::string _id; - long _http_code; -}; - -// Error. - -class error -{ -public: - error(quvi_t, QUVIcode); - error(const error&); - error& operator=(const error&); - virtual ~error(); -public: - const std::string& what() const; - long response_code() const; - QUVIcode quvi_code() const; -private: - void _swap(const error&); -private: - QUVIcode _quvi_code; - std::string _what; - long _resp_code; -}; - -} // namespace quvi - -#endif // cclive_quvi_h - -// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/quvi/err.cpp
Deleted
@@ -1,81 +0,0 @@ -/* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> - * - * 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 3 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, see <http://www.gnu.org/licenses/>. - */ - -#include <ccquvi> - -namespace quvi -{ - -// Constructor. - -error::error(quvi_t q, QUVIcode c) - : _quvi_code(QUVI_OK), _resp_code(0) -{ - // Friend of quvi::error class -> clean API. - _what = quvi_strerror(q, c); - quvi_getinfo(q, QUVIINFO_RESPONSECODE, &_resp_code); -} - -// Copy constructor. - -error::error(const error& e) - : _quvi_code(QUVI_OK), _resp_code(0) -{ - _swap(e); -} - -// Copy assignment operator. - -error& error::operator=(const error& e) -{ - if (this != &e) - _swap(e); - return *this; -} - -// Destructor. -error::~error() { } - -// Swap. - -void error::_swap(const error& e) -{ - _quvi_code = e._quvi_code; - _resp_code = e._resp_code; - _what = e._what; -} - -// Get. - -const std::string& error::what() const -{ - return _what; -} - -long error::response_code() const -{ - return _resp_code; -} - -QUVIcode error::quvi_code() const -{ - return _quvi_code; -} - -} // namespace quvi - -// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/quvi/media.cpp
Deleted
@@ -1,186 +0,0 @@ -/* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> - * - * 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 3 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, see <http://www.gnu.org/licenses/>. - */ - -#include <sstream> -#include <iomanip> - -#include <ccquvi> - -namespace quvi -{ - -// Constructors. - -media::media() - : _current_url( _urls.begin() ), _http_code(-1) -{ } - -media::media(quvi_media_t qv) - : _current_url( _urls.begin() ), _http_code(-1) -{ -#define _wrap(id,dst,type) \ - do { \ - type tmp; \ - quvi_getprop(qv,id,&tmp); \ - dst = tmp; \ - } while (0) - _wrap(QUVIPROP_HOSTID, _host, char*); - _wrap(QUVIPROP_PAGEURL, _url, char*); - _wrap(QUVIPROP_PAGETITLE, _title, char*); - _wrap(QUVIPROP_MEDIAID, _id, char*); - _wrap(QUVIPROP_FORMAT, _format, char*); -#undef _wrap - - do - { - _urls.push_back( quvi::url(qv) ); - } - while (quvi_next_media_url(qv) == QUVI_OK); - - _current_url = _urls.begin(); -} - -// Copy constructor. - -media::media(const media& v) - : _current_url( _urls.begin() ), _http_code(-1) -{ - _swap(v); -} - -// Copy assignment operator. - -media& media::operator=(const media& v) -{ - if (this != &v) - _swap(v); - return *this; -} - -// Destructor. - -media::~media() { } - -// Swap. - -void media::_swap(const media& v) -{ - _urls = v._urls; - _title = v._title; - _host = v._host; - _url = v._url; - _id = v._id; - _format = v._format; - _http_code = v._http_code; - _current_url = _urls.begin(); -} - -// Get. - -const std::string& media::title() const -{ - return _title; -} - -const std::string& media::host() const -{ - return _host; -} - -const std::string& media::url() const -{ - return _url; -} - -const std::string& media::id() const -{ - return _id; -} - -const std::string& media::format() const -{ - return _format; -} - -long media::http_code() const -{ - return _http_code; -} - -// Next URL. - -quvi::url media::next_url() -{ - if (_current_url == _urls.end()) - { - _current_url = _urls.begin(); - return quvi::url(); - } - return *(_current_url)++; -} - -// To string. Emulates quvi command's behaviour. - -std::string media::to_s() -{ - std::stringstream b; - - b.setf(std::ios::fixed); - - b << "title\t: " << _title << "\n" - << "host\t: " << _host << "\n" - << "url\t: " << _url << "\n" - << "id\t: " << _id << "\n" - << "format\t: " << _format << "\n" - << "httpcode: " << _http_code << "\n"; - - for (int i=0;; ++i) - { - const quvi::url u = next_url(); - - if (!u.ok()) break; - - b << "url #" - << i - << "\t: " - << u.media_url() - << "\n:: length\t: " - << std::setprecision(0) - << u.content_length() - << "\n:: content-type\t: " - << u.content_type() - << "\n:: suffix\t: " - << u.suffix() - << "\n"; - } - - return b.str(); -} - -std::ostream& operator<<(std::ostream& os, media& v) -{ - return os << v.to_s(); -} - -void media::print(std::ostream& os) -{ - os << to_s(); -} - -} // namespace quvi - -// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/quvi/misc.cpp
Deleted
@@ -1,60 +0,0 @@ -/* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> - * - * 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 3 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, see <http://www.gnu.org/licenses/>. - */ - -#include <pcrecpp.h> -#include <sstream> - -#include <ccquvi> - -namespace quvi -{ - -// Version. - -std::string version() -{ - return quvi_version(QUVI_VERSION); -} - -std::string version_long() -{ - return quvi_version(QUVI_VERSION_LONG); -} - -typedef std::map<std::string,std::string>::const_iterator smci; - -static const std::string _domain_patt_to_s(smci i) -{ - std::string d = (*i).first; - pcrecpp::RE("%w\\+").GlobalReplace("com", &d); - pcrecpp::RE("%").GlobalReplace("", &d); - return d; -} - -std::string support_to_s(const std::map<std::string,std::string>& map) -{ - std::stringstream b; - - for (smci iter = map.begin(); iter != map.end(); ++iter) - b << _domain_patt_to_s(iter) << "\n"; - - return b.str(); -} - -} // namespace quvi - -// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/quvi/opts.cpp
Deleted
@@ -1,94 +0,0 @@ -/* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> - * - * 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 3 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, see <http://www.gnu.org/licenses/>. - */ - -#include <cassert> -#include <iostream> - -#include <ccquvi> - -namespace quvi -{ - -options::options() - : _statusfunc(NULL), - _format("default"), - _resolve(true), - _verify(true) -{ } - -// Copy constructor. - -options::options(const options& opts) - : _statusfunc(NULL), - _format("default"), - _resolve(true), - _verify(true) -{ - _swap(opts); -} - -// Copy assignment operator. - -options& options::operator=(const options& qo) -{ - if (this != &qo) - _swap(qo); - return *this; -} - -// Destructor. - -options::~options() -{ - _statusfunc = NULL; -} - -// Swap. - -void options::_swap(const options& qo) -{ - _format = qo._format; - _verify = qo._verify; - _resolve = qo._resolve; - _statusfunc = qo._statusfunc; -} - -// Set. - -void options::format(const std::string& fmt) -{ - _format = fmt; -} - -void options::verify(const bool b) -{ - _verify = b; -} - -void options::resolve(const bool b) -{ - _resolve = b; -} - -void options::statusfunc(quvi_callback_status cb) -{ - _statusfunc = cb; -} - -} // namespace quvi - -// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/quvi/query.cpp
Deleted
@@ -1,180 +0,0 @@ -/* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> - * - * 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 3 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, see <http://www.gnu.org/licenses/>. - */ - -#include <cassert> - -#include <ccquvi> - -namespace quvi -{ - -// Constructor. - -query::query() - : _quvi(NULL), _curl(NULL) -{ - _init(); -} - -// Copy constructor. - -query::query(const query& q) - : _quvi(NULL), _curl(NULL) -{ - _init(); -} - -// Copy assignment operator. - -query& query::operator=(const query& q) -{ - if (this != &q) - { - _close(); - _init(); - } - return *this; -} - -// Destructor. - -query::~query() -{ - _close(); -} - -// Init. - -void query::_init() -{ - - const QUVIcode rc = quvi_init(&_quvi); - - if (rc != QUVI_OK) - throw error(_quvi,rc); - - assert(_quvi != NULL); - - quvi_getinfo(_quvi, QUVIINFO_CURL, &_curl); - assert(_curl != NULL); -} - -// Close. - -void query::_close() -{ - if (_quvi) - quvi_close(&_quvi); // Resets to NULL. - assert(_quvi == NULL); - _curl = NULL; -} - -// Set common libquvi options. - -void query::_set_opts(const options& opts) const -{ - // Friend of quvi::options class -> clean API. - - if (!opts._format.empty()) - quvi_setopt(_quvi, QUVIOPT_FORMAT, opts._format.c_str()); - - quvi_setopt(_quvi, QUVIOPT_STATUSFUNCTION, opts._statusfunc); -#ifdef _0 - quvi_setopt(_quvi, QUVIOPT_NOVERIFY, opts._verify ? 1L:0L); -#endif - - quvi_setopt(_quvi, QUVIOPT_NORESOLVE, opts._resolve ? 1L:0L); - quvi_setopt(_quvi, QUVIOPT_CATEGORY, QUVIPROTO_HTTP); -} - -// Query formats. - -std::string query::formats(const std::string& url, - const options& opts) const -{ - _set_opts(opts); - - char *formats = NULL; - - QUVIcode rc = quvi_query_formats(_quvi, - const_cast<char*>(url.c_str()), - &formats); - if (rc != QUVI_OK) - throw error(_quvi,rc); - - std::string r = formats; - quvi_free(formats); - - return r; -} - - -// Parse. - -media query::parse(const std::string& pageURL, const options& opts) const -{ - _set_opts(opts); - - quvi_media_t qm; - - QUVIcode rc = - quvi_parse(_quvi, const_cast<char*>(pageURL.c_str()), &qm); - - if (rc != QUVI_OK) - throw error(_quvi,rc); - - assert(qm != NULL); - - media m(qm); - quvi_parse_close(&qm); - - return m; -} - -// Get. - -void* query::curlHandle() const -{ - return _curl; -} - -// Support. - -std::map<std::string,std::string> query::support() const -{ - std::map<std::string,std::string> map; - char *d=NULL, *f=NULL; - - // cclive handles HTTP stream URLs only. Ignore all other - // categories but HTTP. - quvi_setopt(_quvi, QUVIOPT_CATEGORY, QUVIPROTO_HTTP); - - while (quvi_next_supported_website(_quvi, &d, &f) == QUVI_OK) - { - map[d] = f; - quvi_free(d); - d = NULL; - quvi_free(f); - f = NULL; - } - - return map; -} - -} // namespace quvi - -// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/quvi/url.cpp
Deleted
@@ -1,106 +0,0 @@ -/* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> - * - * 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 3 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, see <http://www.gnu.org/licenses/>. - */ - -#include <ccquvi> - -namespace quvi -{ - -// Constructors. - -url::url() - : _contentLength(-1) -{ -} - -url::url(quvi_media_t qv) - : _contentLength(-1) -{ -#define _wrap(id,dst,type) \ - do { \ - type tmp; \ - quvi_getprop(qv,id,&tmp); \ - dst = tmp; \ - } while (0) - _wrap(QUVIPROP_MEDIAURL, _url, char*); - _wrap(QUVIPROP_MEDIACONTENTTYPE, _contentType, char*); - _wrap(QUVIPROP_MEDIACONTENTLENGTH, _contentLength, double); - _wrap(QUVIPROP_FILESUFFIX, _suffix, char*); -#undef _wrap -} - -// Copy constructor. - -url::url(const url& u) - : _contentLength(-1) -{ - _swap(u); -} - -// Copy assignment operator. - -url& url::operator=(const url& u) -{ - if (this != &u) - _swap(u); - return *this; -} - -// Destructor. - -url::~url() { } - -// Swap. - -void url::_swap(const url& u) -{ - _contentLength = u._contentLength; - _contentType = u._contentType; - _suffix = u._suffix; - _url = u._url; -} - -// Get. - -const std::string& url::content_type() const -{ - return _contentType; -} - -const std::string& url::suffix() const -{ - return _suffix; -} - -const std::string& url::media_url() const -{ - return _url; -} - -double url::content_length() const -{ - return _contentLength; -} - -bool url::ok() const -{ - return _contentLength > -1; -} - -} // namespace quvi - -// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/AUTHORS
Added
@@ -0,0 +1,1 @@ +Toni Gundogdu <legatvs at sign gmail com>
View file
cclive-0.7.9.tar.bz2/COPYING -> cclive-0.9.3.tar.xz/COPYING
Changed
@@ -1,5 +1,5 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies @@ -7,17 +7,15 @@ Preamble - The GNU General Public License is a free, copyleft license for -software and other kinds of works. + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to +our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. +software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you @@ -26,44 +24,34 @@ 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 prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. 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. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. The precise terms and conditions for copying, distribution and modification follow. @@ -72,7 +60,7 @@ 0. Definitions. - "This License" refers to version 3 of the GNU General Public License. + "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. @@ -549,35 +537,45 @@ the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - 13. Use with the GNU Affero General Public License. + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single +under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of -the GNU 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 +the GNU Affero 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 that a certain numbered version of the GNU General +Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published +GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's +versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. @@ -635,40 +633,29 @@ Copyright (C) <year> <name of author> 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 + it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 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. + GNU Affero General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Also add information on how to contact you by electronic and paper mail. - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program 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, your program's commands
View file
cclive-0.7.9.tar.bz2/ChangeLog -> cclive-0.9.3.tar.xz/ChangeLog
Changed
@@ -1,3 +1,2955 @@ +commit 9f77d01 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-11-23 + + Update NEWS for v0.9.3 + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +NEWS + +commit 02ce85f +Merge: 4389ac9 17a0e27 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-11-14 + + Merge branch 'tg/next__improvements_round#1' into next + +commit 17a0e27 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-11-12 + + cc::input: Reduce duplicate code + + * Rename `read_from_escaped_uri' function + * Introduce `determine_input' function + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +src/cc/input.h + +commit 34026cb +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-11-09 + + cc::input: Do not unescape input URIs + + Rationale: + - This was previously done because quvi-dump(1) escaped the entire URLs + (incl. the "reserved chars") + + - cclive uses Glib::uri_parse_scheme to determine the action it should + take with the input URL which would fail with the completely escaped + URIs + + - Applications would typically leave the "reserved chars" unescaped, + e.g. the web browsers + + See also: + - https://tools.ietf.org/html/rfc3986#section-2.2 + - https://en.wikipedia.org/wiki/Percent-encoding + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +src/cc/input.h + +commit 8a60f4e +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-11-09 + + cc::log: Rewrite, make header-only + + Other notable changes: + * Relocate cc::log (boost::iostreams::filtering_ostream) to cc::var + * Remove cc_debug and cc::_debug + * Add cc::sink namespace + * Rename sinks + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +src/Makefile.am +src/cc/application.cpp +src/cc/background.cpp +src/cc/log.cpp +src/cc/log.h +src/cc/var.h + +commit 2dbbdf0 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-08-18 + + Rename cc::progressbar::mode + + * Make it part of cc::options + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +src/cc/options.h + +commit 711dc10 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-11-04 + + cc::file: Rewrite for cc::sig (sigusr1) + + Notable changes: + * Do not setup/handle SIGUSR1, leave all that to cc::sig + + Other: + * SIGUSR1 handler is now set only once, not everytime a transfer begins + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +src/cc/file.cpp + +commit 8236649 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-08-18 + + cc::file: Use updated cc::progressbar + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +src/cc/file.cpp + +commit c723e66 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-08-14 + + cc::file: Make "exists" a static member function + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +src/cc/file.cpp +src/cc/file.h + +commit fdf4565 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-08-14 + + cc::file::_init: Rewrite/cleanup + + Address any remaining inefficiencies, avoid code-duplication and improve + code readability. + + Other notable changes: + * Remove (BOOST_FILESYSTEM_VERSION >2) if-else -blocks (Boost v1.49+ have v3) + * Rewrite `output_dir' as `output_fpath' (return output-dir + filename) + * Add cc::file::store_path + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +src/cc/file.cpp +src/cc/file.h + +commit 91f9c52 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-08-11 + + cc::file: Remove unused macro definition + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +src/cc/file.cpp + +commit 5431098 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-08-18 + + cc::progressbar: Rewrite, make header-only + + * Remove bloat and reorganize + * Use IEEE-1541 symbols + * Use cc::sig + + Other: + * SIGWINCH handler is now set only once, not everytime progressbar is created + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +src/Makefile.am +src/cc/progressbar.cpp +src/cc/progressbar.h + +commit 378f9be +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-08-14 + + cc::progressbar: Remove unused code + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +src/cc/progressbar.cpp + +commit 5ecfac5 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-08-18 + + cc::fstream: Rename shared_ptr type + + Signed-off-by: Toni Gundogdu <legatvs@gmail.com> + +src/cc/fstream.h + +commit 211924a +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2013-11-01 + + Add cc::var +
View file
cclive-0.7.9.tar.bz2/INSTALL -> cclive-0.9.3.tar.xz/INSTALL
Changed
@@ -1,38 +1,370 @@ +Installation Instructions +************************* +Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, +Inc. -Prerequisites -------------- + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. -* libquvi (0.2.16.1+) -* libboost (1.42.0+) -* libpcre(cpp) (8.02+) -* libcurl (7.20.0+) +Basic Installation +================== -Note that cclive may or may not compile with earlier versions. -The above versions are the ones that I've tested. + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). -Installation from source ------------------------- + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. -"./configure && make install", typically. See also "./configure --help". -If you are compiling cclive from the development code from the git -repository, see "Installation from development code", instead. + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. - --enable-ccl Make a symbolic link from 'cclive' (binary) to 'ccl' - --without-manual Do not install manual page(s) + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + The simplest way to compile this package is: -Installation from development code ----------------------------------- + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. -If you are compiling cclive from the development code, run "autogen.sh", -first. This generates the configuration files that are not in the git -repository. You will need: + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. - * Perl (with pod2man) - * GNU autoconf - * GNU automake + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of
View file
cclive-0.7.9.tar.bz2/Makefile.am -> cclive-0.9.3.tar.xz/Makefile.am
Changed
@@ -6,7 +6,7 @@ SUBDIRS+= doc endif -.PHONY: ChangeLog VERSION +.PHONY: ChangeLog VERSION doc VERSION: @if test -d "$(top_srcdir)/.git" -o -f "$(top_srcdir)/.git"; then \ @@ -19,4 +19,7 @@ --after="Thu Aug 12 15:54:58 2010" > $@; \ fi +doc: + @make -C $(top_builddir)/doc/man1/ doc + dist-hook: ChangeLog VERSION
View file
cclive-0.7.9.tar.bz2/Makefile.in -> cclive-0.9.3.tar.xz/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,6 +15,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -38,16 +55,15 @@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure COPYING ChangeLog INSTALL NEWS \ - config.aux/config.guess config.aux/config.sub \ - config.aux/depcomp config.aux/install-sh config.aux/ltmain.sh \ - config.aux/missing + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + config.aux/ar-lib config.aux/config.guess \ + config.aux/config.sub config.aux/depcomp config.aux/install-sh \ + config.aux/ltmain.sh config.aux/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/boost.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/version.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -71,6 +87,11 @@ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ @@ -113,12 +134,13 @@ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).tar.xz GZIP_ENV = --best +DIST_ARCHIVES = $(distdir).tar.xz distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print +A2X = @A2X@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -155,6 +177,7 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DATE = @DATE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ @@ -232,6 +255,10 @@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +glib_CFLAGS = @glib_CFLAGS@ +glib_LIBS = @glib_LIBS@ +glibmm_CFLAGS = @glibmm_CFLAGS@ +glibmm_LIBS = @glibmm_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -285,15 +312,15 @@ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -507,13 +534,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -546,6 +570,7 @@ dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) + dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) @@ -575,8 +600,6 @@ $(am__remove_distdir) dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) @@ -602,7 +625,7 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) + chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) @@ -792,7 +815,7 @@ uninstall uninstall-am -.PHONY: ChangeLog VERSION +.PHONY: ChangeLog VERSION doc VERSION: @if test -d "$(top_srcdir)/.git" -o -f "$(top_srcdir)/.git"; then \ @@ -805,6 +828,9 @@ --after="Thu Aug 12 15:54:58 2010" > $@; \ fi +doc: + @make -C $(top_builddir)/doc/man1/ doc + dist-hook: ChangeLog VERSION # Tell versions [3.59,3.63) of GNU make to not export all variables.
View file
cclive-0.7.9.tar.bz2/NEWS -> cclive-0.9.3.tar.xz/NEWS
Changed
@@ -1,3 +1,142 @@ +v0.9.3 [2013-11-23] + +Limao Luo: + - %e has been renamed to %s (--help) [fef8987] +Toni Gundogdu: + - AC_PREREQ: Bump to 2.69 [c6591e6] + - Cleanup and devise more C++ eloquence + - Add cc::sig [b3dfaf2] + - Setup sig{winch,usr1} handlers only once + - Use sigaction(2) instead of signal(2) + - cc::file + - Rewrite for cc::sig (sigusr1) [711dc10] + - Use updated cc::progressbar [8236649] + - _init: Rewrite/cleanup [fdf4565] + - cc::input: Do not unescape input URIs [34026cb] + - Reduce duplicate code [17a0e27] + - cc::log: Rewrite, make header-only [8a60f4e] + - cc::progressbar: Rewrite, make header-only [5431098] + - Rewrite for cc::sig (sigwinch) + - Use IEEE-1541 symbols + - cc::re: Throw Boost.Exception based exception [dc132f7] + + 22 files changed, 773 insertions(+), 859 deletions(-) + + +v0.9.2 [2013-08-08] + +Toni Gundogdu: + [!] glibmm 2.24+ is now a prerequisite + - Add --timestamp: Try to preserve modification time (PORT) [50213d7] + - Bump the required Boost version to v1.49 [86978ab] + - [DOC] --update-interval: Accepts now integers only [6426f8f] + - Improve cc::input (complete rewrite) [81303f9] + - Improve cc:options (complete rewrite) [314e722] + + 28 files changed, 1434 insertions(+), 873 deletions(-) + + +v0.9.1 [2013-07-16] + +Toni Gundogdu: + [!] GLib 2.24+ is now a prerequisite + [!] Relicense under AGPLv3+ + - Add cc::input -- improve input parsing [ad1f2e6] + - DOC: cclive(1): Revise INPUT section [75d1b5c] + - DOC: Revise --stream description [401e8c0] + - FIX: configure.ac: AS_IF for date(1) [0019e62] + - Deprecate --prefer-format in favor of --stream with libquvi 0.9+ [f55f70d] + - Rewrite status_callback for libquvi v0.9.2 [7d94207] + - Make --stream configurable [993a0be] + - Move --support implementation to print_support [3d35e5e] + - --filename-format: Remove depr. support for %h sequence [ad214c7] + - --print-streams: Make output similar to quvi(1) 0.9+ [2294e93] + - --version: Add CXX and CXXFLAGS to the output [65f8373] + - --version: Print copyr notice to stderr instead of stdout [6c1f678] + - --version: Provide additional info about libquvi [9e6e50e] + + 45 files changed, 976 insertions(+), 616 deletions(-) + + +v0.9.0 [2013-05-25] + +Toni Gundogdu: + - Add libquvi 0.9+ compatibility layer + - Add --print-config [bf22b60] + - Add short-option for --verbose-libcurl [239ea61] + - Drop libquvi 0.2.16.x support + - README: Bump libquvi prereq. to 0.4.0+ [99b47eb] + - FIX: Regression in retrying introduced by 4b118378 [b57e47b] + - FIX: Skip transfer with USR1, do not retry transfer [293dbc9] + - Merge --version and --license options [474c143] + - Add build time to --version output [ca5e80f] + - Remove all deprecated options/features + - Remove depr. --format [e32fc26] + - Remove depr. --query-formats [e8114a0] + - Remove depr. --regexp [0392fb0] + - Remove depr. --subst [8d2ac37] + - Update m4/boost.m4 to the latest [982bbc7] + + 28 files changed, 782 insertions(+), 422 deletions(-) + + +v0.7.12 -- [2013-02-10, r:Toni Gundogdu] + +Toni Gundogdu: + - Add quvi compatibility layer [cda6cc4] + - Add short-option -h [8a279a6] + - Add short-option -v [ec969f1] + - Deprecate --format, add --stream [949d476] + - Deprecate --query-formats, add --print-streams [7188199] + - doc: Revise manual [777d82a] + - FIX: Do not ignore I/O errors during file transfer [6f2e711] + - options: Make 'continue' configurable [92bd61f] + - options: Make 'no-resolve' configurable [4afab3e] + - Upgrade boost.m4 to the latest [c436150] + +See ChangeLog for a more detailed list of changes. + + 47 files changed, 1881 insertions(+), 1993 deletions(-) + + +v0.7.11 -- [2012-12-12, r:Toni Gundogdu] + +Adam Sampson: + - Check .error() for user-provided regexps [03d69e0] + - Copy strings passed to StringPiece [5325ecc] + + 3 files changed, 31 insertions(+), 19 deletions(-) + + +v0.7.10 (2012-08-28) / Toni Gundogdu + +Toni Gundogdu: + - Append contents of INSTALL file to README file [a90c854] + - README file will contain the cclive specific information + - INSTALL file will now be provided by GNU Autotools + - configure.ac: Add AC_PROG_LN_S [da6c39a] + - configure.ac: Install ccl symlink by default [9ecaaf8] + - configure.ac: Lower AC_PREREQ to 2.67 [e317832] + - configure.ac: Modernize AM_INIT options [76fd2d0] + - configure.ac: Modernize libtool options [0f39e93] + - configure.ac: Replace deprecated macros [59fce53] + - configure.ac: Run gen-ver.sh to get version value [4f0d4a8] + - DOC: Manual: Revise descriptions for option sections [fe31766] + - DOC: Rewrite EXIT STATUS section [6690303] + - FIX: Return non-zero exit status if failure (#18) [4d3c506] + - exit_status: Redefine as ok (EXIT_SUCCESS) and error (EXIT_FAILURE) [20cbf6d] + - Replace "invalid_option" with "error" [980792e] + - main: Use exit_status, have caught exceptions set exit status [99bd1b2] + - gen-ver.sh: Rewrite completely [df0a4ce] + - go_background: Return application::error instead [36158a1] + - Install ccl symlink now by default, see --disable-ccl in README + - install-exec-hook: Remove the 'ccl' symlink [e394f71] + - m4/boost.m4: Update to the most recent [1044d88] + - m4/version.m4: Remove the file [d1e6bae] + + 17 files changed, 206 insertions(+), 139 deletions(-) + + v0.7.9 (2012-03-03) / Toni Gundogdu Toni Gundogdu:
View file
cclive-0.7.9.tar.bz2/README -> cclive-0.9.3.tar.xz/README
Changed
@@ -1,3 +1,5 @@ +General +======= cclive is a tool for downloading media from YouTube and similar websites. It has a low memory footprint compared to other existing @@ -5,3 +7,104 @@ Home : http://cclive.sourceforge.net/ gitweb: http://repo.or.cz/w/cclive.git + +Installation +============ + +Notes +----- + +* This document does not cover how to use GNU Autotools for building + and installing software, instead, refer to the GNU Autotools + documentation, the INSTALL file and the "configure --help" output for + more information. + +* If you're not familiar with GNU Autotools and/or installing software + from the source code, you may prefer to install cclive using a binary + package, instead. You can find cclive packaged for many distros + already. + +* If you have previously installed cclive from the source code to your + system, the recommended practice is to uninstall the previous + installation first, before you continue with the new one. You would, + typically, run "make uninstall" (as root if necessary) from the same + directory you ran "make install" from. + +* If you are building cclive from the git repository code, run the + `bootstrap.sh' first. This generates the configuration files. See also + the -h output for any additional info. + + +Simple install procedure +------------------------ + + % ./configure && make + + [ Become root if necessary ] + % make install + +The configure script supports also the following options which are +relevant to the installation: + + --with(out)-manual + Install the manual page for cclive + + --(enable|disable)-ccl (default:yes) + Make a symbolic link from 'cclive' (executable) to 'ccl'. + + +Requirements +------------ + +* libquvi 0.4 + http://quvi.sourceforge.net/ + $ sudo aptitude install libquvi-dev + +* libpcre 8.02 + http://pcre.org + $ sudo aptitude install libpcre3-dev + +* libboost 1.49.0 + http://www.boost.org/ + $ sudo aptitude install libboost-program-options-dev libboost-system-dev \ + libboost-filesystem-dev libboost-iostreams-dev \ + libboost-date-time-dev + +* libcurl 7.20.0 + http://curl.haxx.se/ + $ sudo aptitude install libcurl4-gnutls-dev + (or libcurl4-openssl-dev) + +* glibmm 2.24.2 + http://library.gnome.org/devel/glibmm/ + $ sudo aptitude install libglibmm-2.4-dev + +* GLib 2.24.2 + http://library.gnome.org/devel/glib/ + $ sudo aptitude install libglib2.0-dev + +* pkg-config for tracking the compilation flags needed for libraries + http://www.freedesktop.org/software/pkgconfig/ + $ sudo aptitude install build-essential + +* GNU make is recommended + http://www.gnu.org/software/make/ + $ sudo aptitude install build-essential + + +How to report bugs +================== + +Please see: http://cclive.sourceforge.net/#bugs + + +Patches +======= + +Please see: http://cclive.sourceforge.net/contrib/ + + +License +======= + +cclive is Free Software, licensed under the GNU Affero GPLv3+.
View file
cclive-0.7.9.tar.bz2/VERSION -> cclive-0.9.3.tar.xz/VERSION
Changed
@@ -1,1 +1,1 @@ -v0.7.9 +v0.9.3
View file
cclive-0.7.9.tar.bz2/aclocal.m4 -> cclive-0.9.3.tar.xz/aclocal.m4
Changed
@@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, @@ -14,8 +14,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) @@ -198,7 +198,7 @@ [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.3], [], +m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -214,11 +214,72 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.3])dnl +[AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_AR([ACT-IF-FAIL]) +# ------------------------- +# Try to determine the archiver interface, and trigger the ar-lib wrapper +# if it is needed. If the detection of archiver interface fails, run +# ACT-IF-FAIL (default is to abort configure with a proper error message). +AC_DEFUN([AM_PROG_AR], +[AC_BEFORE([$0], [LT_INIT])dnl +AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([ar-lib])dnl +AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) +: ${AR=ar} + +AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], + [am_cv_ar_interface=ar + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], + [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + ]) + ]) + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; +esac +AC_SUBST([AR])dnl +]) + # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. @@ -918,6 +979,25 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
View file
cclive-0.9.3.tar.xz/config.aux/ar-lib
Added
@@ -0,0 +1,270 @@ +#! /bin/sh +# Wrapper for Microsoft lib.exe + +me=ar-lib +scriptversion=2012-03-01.08; # UTC + +# Copyright (C) 2010, 2012 Free Software Foundation, Inc. +# Written by Peter Rosin <peda@lysator.liu.se>. +# +# 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, 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, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat <<EOF +Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...] + +Members may be specified in a file named with @FILE. +EOF + exit $? + ;; + -v | --v*) + echo "$me, version $scriptversion" + exit $? + ;; +esac + +if test $# -lt 3; then + func_error "you must specify a program, an action and an archive" +fi + +AR=$1 +shift +while : +do + if test $# -lt 2; then + func_error "you must specify a program, an action and an archive" + fi + case $1 in + -lib | -LIB \ + | -ltcg | -LTCG \ + | -machine* | -MACHINE* \ + | -subsystem* | -SUBSYSTEM* \ + | -verbose | -VERBOSE \ + | -wx* | -WX* ) + AR="$AR $1" + shift + ;; + *) + action=$1 + shift + break + ;; + esac +done +orig_archive=$1 +shift +func_file_conv "$orig_archive" +archive=$file + +# strip leading dash in $action +action=${action#-} + +delete= +extract= +list= +quick= +replace= +index= +create= + +while test -n "$action" +do + case $action in + d*) delete=yes ;; + x*) extract=yes ;; + t*) list=yes ;; + q*) quick=yes ;; + r*) replace=yes ;; + s*) index=yes ;; + S*) ;; # the index is always updated implicitly + c*) create=yes ;; + u*) ;; # TODO: don't ignore the update modifier + v*) ;; # TODO: don't ignore the verbose modifier + *) + func_error "unknown action specified" + ;; + esac + action=${action#?} +done + +case $delete$extract$list$quick$replace,$index in + yes,* | ,yes) + ;; + yesyes*) + func_error "more than one action specified" + ;; + *) + func_error "no action specified" + ;; +esac + +if test -n "$delete"; then + if test ! -f "$orig_archive"; then + func_error "archive not found" + fi + for member + do + case $1 in + @*)
View file
cclive-0.7.9.tar.bz2/config.aux/config.guess -> cclive-0.9.3.tar.xz/config.aux/config.guess
Changed
@@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. -timestamp='2012-01-01' +timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ # 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. +# along with this program; if not, see <http://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -863,6 +861,13 @@ i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -1320,6 +1325,9 @@ i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2
View file
cclive-0.7.9.tar.bz2/config.aux/config.sub -> cclive-0.9.3.tar.xz/config.aux/config.sub
Changed
@@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. -timestamp='2012-01-01' +timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ # 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. +# along with this program; if not, see <http://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -132,6 +130,10 @@ os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -223,6 +225,12 @@ -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; -lynx*) os=-lynxos ;; @@ -247,6 +255,7 @@ # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ @@ -319,7 +328,7 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -332,7 +341,10 @@ strongarm | thumb | xscale) basic_machine=arm-unknown ;; - + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; xscaleeb) basic_machine=armeb-unknown ;; @@ -355,6 +367,7 @@ # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ @@ -1530,6 +1543,9 @@ c4x-* | tic4x-*) os=-coff ;; + hexagon-*) + os=-elf + ;; tic54x-*) os=-coff ;;
View file
cclive-0.7.9.tar.bz2/config.aux/depcomp -> cclive-0.9.3.tar.xz/config.aux/depcomp
Changed
@@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2011-12-04.11; # UTC +scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. # 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 @@ -28,7 +28,7 @@ case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) @@ -40,8 +40,8 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. @@ -57,6 +57,12 @@ ;; esac +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -102,6 +108,12 @@ depmode=msvc7 fi +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -156,15 +168,14 @@ ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. @@ -203,18 +214,15 @@ # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else @@ -226,10 +234,17 @@ rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` @@ -259,12 +274,11 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. + # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. + # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -275,23 +289,26 @@ ;; icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h - # which is wrong. We want: + # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... - + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : @@ -300,15 +317,21 @@ exit $stat fi rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; @@ -344,7 +367,7 @@ done
View file
cclive-0.7.9.tar.bz2/config.aux/ltmain.sh -> cclive-0.9.3.tar.xz/config.aux/ltmain.sh
Changed
@@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.1 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.2 +VERSION="2.4.2 Debian-2.4.2-1.1" TIMESTAMP="" package_revision=1.3337 @@ -6124,7 +6124,10 @@ case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then @@ -6444,19 +6447,19 @@ # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done continue fi # $pass = conv @@ -7349,6 +7352,9 @@ revision="$number_minor" lt_irix_increment=no ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; esac ;; no)
View file
cclive-0.7.9.tar.bz2/config.h.in -> cclive-0.9.3.tar.xz/config.h.in
Changed
@@ -1,11 +1,17 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* ... */ -#undef CANONICAL_HOST +/* We have build time */ +#undef BUILD_TIME -/* ... */ +/* Define to canonical target */ #undef CANONICAL_TARGET +/* Define to compiler */ +#undef CXX + +/* Define to compiler flags */ +#undef CXXFLAGS + /* Defined if the requested minimum BOOST version is satisfied */ #undef HAVE_BOOST @@ -46,14 +52,20 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H -/* We have libquvi 0.4.0+ */ -#undef HAVE_LIBQUVI_0_4_0 +/* We have libquvi 0.9 */ +#undef HAVE_LIBQUVI_0_9 /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H -/* Define to 1 if you have the `signal' function. */ -#undef HAVE_SIGNAL +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define to 1 if you have the `sigaction' function. */ +#undef HAVE_SIGACTION /* Define to 1 if you have the <signal.h> header file. */ #undef HAVE_SIGNAL_H @@ -178,6 +190,12 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + /* Define to `int' if <sys/types.h> does not define. */ #undef pid_t
View file
cclive-0.7.9.tar.bz2/configure -> cclive-0.9.3.tar.xz/configure
Changed
@@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for cclive 0.7.9. +# Generated by GNU Autoconf 2.69 for cclive 0.9.3. # -# Report bugs to <http://sourceforge.net/apps/trac/cclive>. +# Report bugs to <http://cclive.sf.net/bugs/>. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -136,6 +134,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -169,7 +192,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -222,21 +246,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -247,10 +275,10 @@ $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: http://sourceforge.net/apps/trac/cclive about your -$0: system, including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." +$0: http://cclive.sf.net/bugs/ about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." fi exit 1 fi @@ -339,6 +367,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -460,6 +496,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -494,16 +534,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -515,28 +555,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -570,10 +590,10 @@ # Identity of this package. PACKAGE_NAME='cclive' PACKAGE_TARNAME='cclive' -PACKAGE_VERSION='0.7.9' -PACKAGE_STRING='cclive 0.7.9' -PACKAGE_BUGREPORT='http://sourceforge.net/apps/trac/cclive'
View file
cclive-0.7.9.tar.bz2/configure.ac -> cclive-0.9.3.tar.xz/configure.ac
Changed
@@ -1,46 +1,70 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_PREREQ([2.68]) +AC_PREREQ([2.69]) -m4_include([m4/version.m4]) - -AC_INIT([cclive], [_CCLIVE_VERSION], - [http://sourceforge.net/apps/trac/cclive], [], - [http://cclive.sourceforge.net/]) +AC_INIT([cclive], m4_esyscmd([./gen-ver.sh -c | tr -d '\n']), + [http://cclive.sf.net/bugs/],[],[http://cclive.sf.net/]) AC_CONFIG_SRCDIR([src/cc/application.cpp]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR([config.aux]) AC_CONFIG_MACRO_DIR([m4]) -AC_CANONICAL_SYSTEM -AC_GNU_SOURCE +AC_CANONICAL_TARGET +AC_USE_SYSTEM_EXTENSIONS -AC_DEFINE_UNQUOTED([CANONICAL_TARGET], "$target", [...]) -AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [...]) +AC_DEFINE_UNQUOTED([CANONICAL_TARGET], "$target", + [Define to canonical target]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign dist-bzip2 dist-xz]) +AM_INIT_AUTOMAKE([1.11.1 -Wall -Werror dist-xz no-dist-gzip tar-ustar]) AM_SILENT_RULES([yes]) -LT_INIT() -LT_PREREQ([2.2]) +# GNU Automake 1.12 requires this macro. Earlier versions do not +# recognize this macro. Work around this. +m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) + +LT_INIT([disable-static]) +LT_PREREQ([2.2.6]) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_CPP +AC_PROG_LN_S + +AC_DEFINE_UNQUOTED([CXXFLAGS], "$CXXFLAGS", [Define to compiler flags]) +AC_DEFINE_UNQUOTED([CXX], "$CXX", [Define to compiler]) + +AC_PATH_PROG([DATE], [date], [no]) +AS_IF([test x"$DATE" != "xno"], [build_time=`$DATE +"%F %T %z"`]) +AC_DEFINE_UNQUOTED([BUILD_TIME], ["$build_time"], [We have build time]) + +AC_PATH_PROG([A2X], [a2x], [no]) +AM_CONDITIONAL([HAVE_A2X], [test x"$A2X" != "xno"]) +AC_SUBST([A2X]) + +AS_IF([test x"$A2X" = "xno" && test -d "$srcdir/.git"], + AC_MSG_ERROR([a2x is required to create man pages when building from git])]) # Checks for libraries. -PKG_CHECK_MODULES([libquvi], [libquvi >= 0.4.0], - [AC_DEFINE([HAVE_LIBQUVI_0_4_0], [1], [We have libquvi 0.4.0+])], - [PKG_CHECK_MODULES([libquvi], [libquvi >= 0.2.16.1])]) +have_libquvi_0_9= +PKG_CHECK_MODULES([libquvi], [libquvi-0.9 >= 0.9], + [ + AC_DEFINE([HAVE_LIBQUVI_0_9], [1], [We have libquvi 0.9]) + have_libquvi_0_9=yes + ], + [PKG_CHECK_MODULES([libquvi], [libquvi >= 0.4])]) +AM_CONDITIONAL([HAVE_LIBQUVI_0_9], [test x"$have_libquvi_0_9" = "xyes"]) + PKG_CHECK_MODULES([libcurl], [libcurl >= 7.18.0]) PKG_CHECK_MODULES([libpcre], [libpcre >= 8.02]) PKG_CHECK_MODULES([libpcrecpp], [libpcrecpp >= 8.02]) +PKG_CHECK_MODULES([glibmm], [glibmm-2.4 >= 2.24]) +PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24]) -BOOST_REQUIRE([1.42.0]) +BOOST_REQUIRE([1.49.0]) # Boost: Header-only libs BOOST_FOREACH BOOST_FORMAT @@ -58,15 +82,16 @@ AC_HEADER_STDBOOL AC_TYPE_SIZE_T AC_TYPE_PID_T +AC_C_INLINE # Checks for library functions. -AC_CHECK_FUNCS([strerror strstr getpid signal]) +AC_CHECK_FUNCS([strerror strstr getpid sigaction memset setlocale]) AC_FUNC_ERROR_AT_LINE AC_FUNC_STRERROR_R AC_FUNC_FORK # Version. -VN=`$srcdir/gen-ver.sh $srcdir` +VN=`$srcdir/gen-ver.sh` AC_DEFINE_UNQUOTED([VN],["$VN"], [We have version number from gen-ver.sh]) # --with-manual @@ -80,10 +105,10 @@ # --enable-ccl AC_ARG_ENABLE([ccl], [AS_HELP_STRING([--enable-ccl], - [Make a symbolic link from 'cclive' to 'ccl' @<:@default=no@:>@])], + [Symlink from 'cclive' executable to 'ccl' @<:@default=yes@:>@])], [], - [enable_ccl=no]) -AM_CONDITIONAL([ENABLE_CCL], [test x"$enable_ccl" != "xno"]) + [enable_ccl=yes]) +AM_CONDITIONAL([ENABLE_CCL], [test x"$enable_ccl" = "xyes"]) AC_CONFIG_FILES([ Makefile @@ -95,9 +120,16 @@ AC_OUTPUT AC_MSG_NOTICE([ - cclive version: ${VERSION} (${VN}) - host setup: ${host} - prefix: ${prefix} - install manual: ${with_manual}]) + version: ${VERSION} + prefix: ${prefix} + compiler: ${CXX} + flags: ${CXXFLAGS} +System types: + target ${target} + build ${build} + host ${host} +Options: + add ccl symlink: ${enable_ccl} + install manual : ${with_manual}]) # vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/doc/Makefile.am -> cclive-0.9.3.tar.xz/doc/Makefile.am
Changed
@@ -1,1 +1,2 @@ -SUBDIRS= man1 +EXTRA_DIST=asciidoc.conf +SUBDIRS=man1
View file
cclive-0.7.9.tar.bz2/doc/Makefile.in -> cclive-0.9.3.tar.xz/doc/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,6 +15,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -40,8 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/boost.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/version.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -63,6 +79,11 @@ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ @@ -97,6 +118,7 @@ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" +A2X = @A2X@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -133,6 +155,7 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DATE = @DATE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ @@ -210,6 +233,10 @@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +glib_CFLAGS = @glib_CFLAGS@ +glib_LIBS = @glib_LIBS@ +glibmm_CFLAGS = @glibmm_CFLAGS@ +glibmm_LIBS = @glibmm_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -250,6 +277,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +EXTRA_DIST = asciidoc.conf SUBDIRS = man1 all: all-recursive @@ -263,9 +291,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign doc/Makefile + $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -458,13 +486,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \
View file
cclive-0.9.3.tar.xz/doc/asciidoc.conf
Added
@@ -0,0 +1,64 @@ +## linkman: macro +# Inspired by/borrowed from the pacman source tree at doc/asciidoc.conf +# +# Usage: linkman:command[manpage-section] +# +# Note, {0} is the manpage section, while {target} is the command. +# +# Show man link as: <command>(<section>); if section is defined, else just show +# the command. + +[macros] +(?su)[\\]?(?P<name>linkman):(?P<target>\S*?)\[(?P<attrlist>.*?)\]= + +[attributes] +asterisk=* +plus=+ +caret=^ +startsb=[ +endsb=] +backslash=\ +tilde=~ +apostrophe=' +backtick=` +litdd=-- + +ifdef::backend-docbook[] +[linkman-inlinemacro] +{0%{target}} +{0#<citerefentry>} +{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>} +{0#</citerefentry>} +endif::backend-docbook[] + +ifdef::backend-docbook[] +ifndef::docbook-xsl-172[] +# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this. +# v1.72 breaks with this because it replaces dots not in roff requests. +[listingblock] +<example><title>{title}</title> +<literallayout> +| +</literallayout> +{title#}</example> +endif::docbook-xsl-172[] +endif::backend-docbook[] + +ifdef::doctype-manpage[] +ifdef::backend-docbook[] +[header] +template::[header-declarations] +<refentry> +<refmeta> +<refentrytitle>{mantitle}</refentrytitle> +<manvolnum>{manvolnum}</manvolnum> +<refmiscinfo class="source">cclive</refmiscinfo> +<refmiscinfo class="version">{cclive_version}</refmiscinfo> +<refmiscinfo class="manual">cclive Manual</refmiscinfo> +</refmeta> +<refnamediv> + <refname>{manname}</refname> + <refpurpose>{manpurpose}</refpurpose> +</refnamediv> +endif::backend-docbook[] +endif::doctype-manpage[]
View file
cclive-0.7.9.tar.bz2/doc/man1/Makefile.am -> cclive-0.9.3.tar.xz/doc/man1/Makefile.am
Changed
@@ -1,2 +1,24 @@ -EXTRA_DIST= cclive.1.pod -dist_man_MANS= cclive.1 +MAN1_TXT=cclive.1.txt +DOC_MAN1=cclive.1 + +MAN_TXT=$(MAN1_TXT) + +ASCIIDOC_OPTS=\ + -f $(top_srcdir)/doc/asciidoc.conf\ + -a cclive_version="$(VERSION)" + +if HAVE_A2X +$(DOC_MAN1): + $(AM_V_GEN)$(A2X) -f manpage --asciidoc-opts="$(ASCIIDOC_OPTS)" \ + -D $(builddir) $(srcdir)/$@.txt +doc: $(DOC_MAN1) +else +doc: + @echo configure did not find a2x +endif # HAVE_A2X + +MOSTLYCLEANFILES=$(DOC_MAN1) +dist_man_MANS=$(DOC_MAN1) +EXTRA_DIST=$(MAN_TXT) + +# vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/doc/man1/Makefile.in -> cclive-0.9.3.tar.xz/doc/man1/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,6 +15,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -41,8 +58,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/boost.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/version.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -57,6 +73,11 @@ am__v_at_0 = @ SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -89,6 +110,7 @@ NROFF = nroff MANS = $(dist_man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +A2X = @A2X@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -125,6 +147,7 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DATE = @DATE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ @@ -202,6 +225,10 @@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +glib_CFLAGS = @glib_CFLAGS@ +glib_LIBS = @glib_LIBS@ +glibmm_CFLAGS = @glibmm_CFLAGS@ +glibmm_LIBS = @glibmm_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -242,8 +269,16 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -EXTRA_DIST = cclive.1.pod -dist_man_MANS = cclive.1 +MAN1_TXT = cclive.1.txt +DOC_MAN1 = cclive.1 +MAN_TXT = $(MAN1_TXT) +ASCIIDOC_OPTS = \ + -f $(top_srcdir)/doc/asciidoc.conf\ + -a cclive_version="$(VERSION)" + +MOSTLYCLEANFILES = $(DOC_MAN1) +dist_man_MANS = $(DOC_MAN1) +EXTRA_DIST = $(MAN_TXT) all: all-am .SUFFIXES: @@ -256,9 +291,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/man1/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/man1/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign doc/man1/Makefile + $(AUTOMAKE) --gnu doc/man1/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -285,11 +320,18 @@ -rm -rf .libs _libs install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" - @list=''; test -n "$(man1dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ @@ -396,6 +438,7 @@ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: @@ -489,6 +532,15 @@ uninstall uninstall-am uninstall-man uninstall-man1 +@HAVE_A2X_TRUE@$(DOC_MAN1): +@HAVE_A2X_TRUE@ $(AM_V_GEN)$(A2X) -f manpage --asciidoc-opts="$(ASCIIDOC_OPTS)" \ +@HAVE_A2X_TRUE@ -D $(builddir) $(srcdir)/$@.txt +@HAVE_A2X_TRUE@doc: $(DOC_MAN1) +@HAVE_A2X_FALSE@doc: +@HAVE_A2X_FALSE@ @echo configure did not find a2x + +# vim: set ts=2 sw=2 tw=72 expandtab: + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
View file
cclive-0.7.9.tar.bz2/doc/man1/cclive.1 -> cclive-0.9.3.tar.xz/doc/man1/cclive.1
Changed
@@ -1,485 +1,967 @@ -.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +'\" t +.\" Title: cclive +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 11/23/2013 +.\" Manual: cclive Manual +.\" Source: cclive 0.9.3 +.\" Language: English .\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. +.TH "CCLIVE" "1" "11/23/2013" "cclive 0\&.9\&.3" "cclive Manual" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "cclive 1" -.TH cclive 1 "2011-11-26" "0.7.9" "cclive manual" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation .nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- .SH "NAME" -cclive \- media download tool +cclive \- media stream extraction tool .SH "SYNOPSIS" -.IX Header "SYNOPSIS" -cclive [options] [url | file...] +.sp +.nf +\fIcclive\fR [OPTIONS] [URL|FILE \&...] +.fi .SH "DESCRIPTION" -.IX Header "DESCRIPTION" -cclive is a tool for downloading media from YouTube and similar -websites. It has a low memory footprint compared to other existing -tools. +.sp +cclive is a command line tool for downloading media streams from YouTube and similar websites\&. +.SH "INPUT" +.sp +The command will read stdin by default\&. The input is expected to contain URLs\&. The command arguments are expected to be either URLs or file paths\&. If the input is read from either stdin or a file, the contents are read as RFC2483\&. The input may also contain URIs (file://) to local files\&. .SH "OPTIONS" -.IX Header "OPTIONS" -Unless an arg is specified in the command line, cclive reads from the -stdin. The command line args may be either URLs or files to read. -If cclive reads from either stdin or files, it expects each \s-1URL\s0 to be -separated by a newline or whitespace character. -.SS "\-\-version" -.IX Subsection "--version" -Print version and exit. -.SS "\-\-help" -.IX Subsection "--help" -Print help and exit. -.SS "\-\-license" -.IX Subsection "--license" -Print license and exit. -.SS "\-\-support" -.IX Subsection "--support" -Print supported hosts and exit. -.SS "\-\-verbose\-libcurl" -.IX Subsection "--verbose-libcurl" -Turn on libcurl verbose output. -.SS "\-q, \-\-quiet" -.IX Subsection "-q, --quiet"
View file
cclive-0.9.3.tar.xz/doc/man1/cclive.1.txt
Added
@@ -0,0 +1,496 @@ +cclive(1) +========= + +NAME +---- +cclive - media stream extraction tool + +SYNOPSIS +-------- +[verse] +'cclive' [OPTIONS] [URL|FILE ...] + +DESCRIPTION +----------- +cclive is a command line tool for downloading media streams from YouTube +and similar websites. + +INPUT +----- +The command will read stdin by default. The input is expected to contain +URLs. The command arguments are expected to be either URLs or file +paths. If the input is read from either stdin or a file, the contents +are read as RFC2483. The input may also contain URIs (file://) to local +files. + +OPTIONS +------- + +Core +~~~~ + +-b, --background:: + Go to background after startup. The output written to stdout + will be written to the file specified with --log-file. + +-F, --config-file <arg>:: + Read the program arguments from the specified file instead of the + default ~/.ccliverc file. See also <<FILES>>. + +-c, --continue:: + Resume partially downloaded media. +---- +config: + continue = {true|false} +---- + +-e, --exec <arg>:: + Invoke the specified command after each successfully finished + download. The command is also invoked if the media is fully + retrieved already. This option may be specified multiple times. + See also <<EXAMPLES>>. + + + All occurences of the following sequences will be replaced + in the 'arg': +---- + %f .. Full path to the downloaded media file + %n .. Name of the downloaded media file + %t .. Unfiltered media title + +config: + exec = arg +---- + +-n, --no-download:: + Do not download the media, print the details only. + +-s, --stream <ID>:: + Download the specified media stream. By default the program will get + the 'default' stream. The stream selection with linkman:libquvi[3] 0.4 + is basic at most, whereas linkman:libquvi[3] 0.9+ provides a more + advanced facility for this. + + + linkman:libquvi[3] 0.9+ treats the ID value as a regex PATTERN and + matches it against the linkman:libquvi-scripts[7] returned media + stream IDs. Additionally, the value of ID may be a 'comma-separated + list' of regex PATTERNs. + + + In comparison, linkman:libquvi[3] 0.4 only checks whether the strings + (the value of ID and the returned media stream ID) are equal. + + + The ID value may also contain the following reserved keywords: ++ +- 'croak' - tell linkman:libquvi[3] (0.9+) to exit with an error + when reached +- 'best' - tell linkman:libquvi[3] to choose the best quality stream + ++ +The 'best' quality is determined by linkman:libquvi-scripts[7]. The +method varies, depending on the linkman:libquvi[3] version and the +website. ++ +For example, linkman:libquvi-scripts[7] 0.9+ would typically compare the +media quality properties (e.g. the video height property). In reality, +the method will vary depending on the data provided by the media hosting +service, and the implementation of the support script that was written +for the website. ++ +See the --version output to confirm whether cclive was built with +linkman:libquvi[3] 0.9 or later. See also <<EXAMPLES>>. +---- +config: + stream = arg +---- + +-N, --timestamp:: + Try to preserve the file modification time (as returned by the server, + if any). Using this option will cause the program to change the + modification time of the file to that of returned by the server. ++ +NOTE: libcurl will parse this value from the returned "Last-Modified" + HTTP header. This header may not always be present in which case + the program will quietly ignore this option. +---- +config: + timestamp = {true|false} +---- + +Informative +~~~~~~~~~~~ + +-h, --help:: + Print help and exit. + +-S, --print-streams:: + Print the available media streams. The printed values (media stream + IDs) may be used with --stream and --prefer-format options. The + available streams are determined by linkman:libquvi[3] and + linkman:libquvi-scripts[7]. + +-D, --print-config:: + Print the value of all defined configuration options to stdout. + +-u, --support:: + Print the supported website domains and exit. + +-v, --version:: + Print the program version and exit. + +Output +~~~~~~ + +-f, --filename-format <arg>:: + Specify how the downloaded media file should be named. All occurences + of the following sequences will be replaced in the 'arg': +---- + %t .. Media title (after applying --tr) + %s .. Media file extension + %i .. Media ID +---- + The default value is "%t.%s". +---- +config: + filename-format = arg +---- + +-l, --log-file <arg>:: + Write log output to the specified file. The program will ignore this + option value unless it is being used together with --background. The + existing log file will be ovewritten. By default, the program will use + "cclive_log" as the log file name. + +-d, --output-dir <arg>:: + Write downloaded media to the specified directory. By default, the + program will write the media to the current working directory. +---- +config: + output-dir = arg +---- + +-O, --output-file <arg>:: + Write media to the specified file. Overrides --filename-format. + +-W, --overwrite:: + Overwrite existing media files. + +-R, --progressbar <arg>:: + Use the progressbar of the specified type. The program will ignore + the value of this option with --background. The arg may be one of the + following values: + * dotline (also implied by --background) + * normal (default) + * simple +---- +config: + progressbar = arg +---- + +-q, --quiet:: + Turn off all output to stdout and stderr with the exception of + --verbose-libcurl. + +-t, --tr <arg>:: + Specify to translate the characters in the media titles before they + are used in the media file names. The 'arg' is a regular expression + pattern. The default value is "/(\w|\s)/g". This option may be + specified multiple times. See also <<EXAMPLES>>. +---- +config: + tr = arg
View file
cclive-0.7.9.tar.bz2/gen-ver.sh -> cclive-0.9.3.tar.xz/gen-ver.sh
Changed
@@ -1,53 +1,70 @@ #!/bin/sh -# gen-ver.sh for cclive. +# +# cclive +# Copyright (C) 2012 Toni Gundogdu <legatvs@gmail.com> +# +# This file is part of cclive <http://cclive.sourceforge.net/>. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 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 +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with this program. If not, see +# <http://www.gnu.org/licenses/>. +# +dir=`dirname $0` +o= +# flags: +c= # strip off the 'v' prefix -from_file() +# VERSION file is part of the dist tarball. +from_VERSION_file() { - VN=`cat $1 2>/dev/null` - if test -n "$VN"; then - echo $VN - exit 0 - fi + o=`cat "$dir/VERSION" 2>/dev/null` } -gen_version() # $1=path to top source dir +from_git_describe() { - path=$1 ; [ -z $path ] && path=. - - # First check if the version file exists and use its value - versionfn="$path/VERSION" - [ -f "$versionfn" ] && from_file "$versionfn" - - # If that file is not found, or fails (e.g. empty), parse from m4/version.m4 - m4="$path/m4/version.m4" - VN=`perl -ne'/(\d+)\.(\d+)\.(\d+)/ && print "$1.$2.$3"' < "$m4"` - [ -z $VN ] && exit $? - - # Use the "git describe" instead, if .git is present - if test -d "$path/.git" -o -f "$path/.git" ; then - _VN=`git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null` - [ -n "$_VN" ] && VN=$_VN - fi + [ -d "$dir/.git" -o -f "$dir/.git" ] && { + o=`git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null` + } +} - echo $VN +dump_vn() +{ + [ -n "$c" ] && o=${o#v} # strip off the 'v' prefix. + echo $o + exit 0 } help() { - echo "Usage: $0 [-h] [top_srcdir] + echo "$0 [OPTIONS] -h Show this help and exit -Run without options to print version. Define top_srcdir if run outside -the top source directory." +-c Strip off the 'v' prefix from the output" exit 0 } while [ $# -gt 0 ] do case "$1" in + -c) c=1;; -h) help;; - *) break;; + *) break;; esac shift done -gen_version $1 +from_VERSION_file +[ -z "$o" ] && from_git_describe +[ -n "$o" ] && dump_vn +exit 1 + +# vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/m4/boost.m4 -> cclive-0.9.3.tar.xz/m4/boost.m4
Changed
@@ -22,7 +22,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. m4_define([_BOOST_SERIAL], [m4_translit([ -# serial 16 +# serial 18 ], [# ], [])]) @@ -227,7 +227,7 @@ # on the command line, static versions of the libraries will be looked up. AC_DEFUN([BOOST_STATIC], [AC_ARG_ENABLE([static-boost], - [AC_HELP_STRING([--enable-static-boost], + [AS_HELP_STRING([--enable-static-boost], [Prefer the static boost libraries over the shared ones [no]])], [enable_static_boost=yes], [enable_static_boost=no])])# BOOST_STATIC @@ -403,7 +403,25 @@ LDFLAGS=$boost_save_LDFLAGS LIBS=$boost_save_LIBS if test x"$Boost_lib" = xyes; then - Boost_lib_LDFLAGS="-L$boost_ldpath -Wl,-R$boost_ldpath" + # Check or used cached result of whether or not using -R or -rpath makes sense. + # Some implementations of ld, such as for Mac OSX, require -rpath but + # -R is the flag known to work on other systems. + # https://github.com/tsuna/boost.m4/issues/19 + AC_CACHE_VAL([boost_cv_rpath_link_ldflag], + [for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do + LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" + LIBS="$boost_save_LIBS $Boost_lib_LIBS" + _BOOST_AC_LINK_IFELSE([], + [boost_rpath_link_ldflag_found=yes + break], + [boost_rpath_link_ldflag_found=no]) + done + AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"], + [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])]) + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + ]) + Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" Boost_lib_LDPATH="$boost_ldpath" break 6 else @@ -502,8 +520,8 @@ AC_SUBST([BOOST_FILESYSTEM_LIBS], ["$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"]) fi LIBS=$boost_filesystem_save_LIBS -LDFLAGS=$boost_filesystem_save_LDFLAGS - +LDFLAGS=$boost_filesystem_save_LDFLAGS + ])# BOOST_CHRONO @@ -516,6 +534,14 @@ ])# BOOST_CONVERSION +# BOOST_CRC() +# ----------- +# Look for Boost.CRC +BOOST_DEFUN([CRC], +[BOOST_FIND_HEADER([boost/crc.hpp]) +])# BOOST_CRC + + # BOOST_DATE_TIME([PREFERRED-RT-OPT]) # ----------------------------------- # Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the @@ -580,6 +606,14 @@ [BOOST_FIND_HEADER([boost/function.hpp])]) +# BOOST_GEOMETRY() +# ---------------- +# Look for Boost.Geometry (new since 1.47.0). +BOOST_DEFUN([Geometry], +[BOOST_FIND_HEADER([boost/geometry.hpp]) +])# BOOST_GEOMETRY + + # BOOST_GRAPH([PREFERRED-RT-OPT]) # ------------------------------- # Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the @@ -775,6 +809,14 @@ ])# BOOST_SIGNALS +# BOOST_SIGNALS2() +# ---------------- +# Look for Boost.Signals2 (new since 1.39.0). +BOOST_DEFUN([Signals2], +[BOOST_FIND_HEADER([boost/signals2.hpp]) +])# BOOST_SIGNALS2 + + # BOOST_SMART_PTR() # ----------------- # Look for Boost.SmartPtr @@ -851,8 +893,23 @@ # is not turned on. Please set the correct command line options for # threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag" -BOOST_FIND_LIB([thread], [$1], - [boost/thread.hpp], [boost::thread t; boost::mutex m;]) + +# When compiling for the Windows platform, the threads library is named +# differently. +case $host_os in + (*mingw*) + BOOST_FIND_LIB([thread_win32], [$1], + [boost/thread.hpp], [boost::thread t; boost::mutex m;]) + BOOST_THREAD_LDFLAGS=$BOOST_THREAD_WIN32_LDFLAGS + BOOST_THREAD_LDPATH=$BOOST_THREAD_WIN32_LDPATH + BOOST_THREAD_LIBS=$BOOST_THREAD_WIN32_LIBS + ;; + (*) + BOOST_FIND_LIB([thread], [$1], + [boost/thread.hpp], [boost::thread t; boost::mutex m;]) + ;; +esac + BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS" BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag" @@ -907,6 +964,17 @@ [BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp]) BOOST_FIND_HEADER([boost/variant.hpp])]) +# BOOST_POINTERCONTAINER() +# ------------------------ +# Look for Boost.PointerContainer +BOOST_DEFUN([Pointer_Container], +[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp]) +BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp]) +BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp]) +BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp]) +BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp]) +BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp]) +])# BOOST_POINTERCONTAINER # BOOST_WAVE([PREFERRED-RT-OPT]) # ------------------------------ @@ -1042,6 +1110,8 @@ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines # the same defines as GCC's). for i in \ + _BOOST_gcc_test(4, 8) \ + _BOOST_gcc_test(4, 7) \ _BOOST_gcc_test(4, 6) \ _BOOST_gcc_test(4, 5) \ _BOOST_gcc_test(4, 4) \
View file
cclive-0.7.9.tar.bz2/m4/libtool.m4 -> cclive-0.9.3.tar.xz/m4/libtool.m4
Changed
@@ -2512,17 +2512,6 @@ esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -2639,7 +2628,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -2684,6 +2673,18 @@ dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -3243,10 +3244,6 @@ fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3285,11 +3282,11 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -4037,7 +4034,7 @@ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4101,7 +4098,7 @@ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4336,7 +4333,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4578,6 +4575,9 @@ ;; esac ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -4640,6 +4640,9 @@ openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -4861,7 +4864,7 @@ fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -5038,6 +5041,7 @@ if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then @@ -5342,7 +5346,7 @@ _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -6222,9 +6226,6 @@ _LT_TAGVAR(ld_shlibs, $1)=yes ;; - gnu*) - ;; - haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -6386,7 +6387,7 @@ _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler
View file
cclive-0.7.9.tar.bz2/src/Makefile.am -> cclive-0.9.3.tar.xz/src/Makefile.am
Changed
@@ -1,44 +1,67 @@ -src= \ - cc/error.cpp \ - cc/main.cpp \ - cc/log.cpp \ - cc/background.cpp \ - cc/exec.cpp \ - cc/file.cpp \ - cc/license.cpp \ - cc/wait.cpp \ - cc/progressbar.cpp \ - cc/options.cpp \ - cc/re.cpp \ - cc/get.cpp \ - cc/application.cpp \ - quvi/err.cpp \ - quvi/query.cpp \ - quvi/misc.cpp \ - quvi/url.cpp \ - quvi/opts.cpp \ - quvi/media.cpp +src=\ + cc/application.cpp\ + cc/background.cpp\ + cc/curl.cpp\ + cc/error.cpp\ + cc/exec.cpp\ + cc/file.cpp\ + cc/get.cpp\ + cc/main.cpp\ + cc/re.cpp\ + cc/wait.cpp -hdr= \ - ccoptions \ - ccinternal \ - ccapplication \ - ccquvi \ - ccprogressbar \ - cclog \ - ccutil \ - ccfile \ - ccre \ - cc/progressbar.h \ - cc/options.h \ - cc/application.h \ - cc/file.h \ - cc/util.h \ - cc/internal.h \ - cc/log.h \ - cc/re.h \ - quvi/ccquvi.h +if HAVE_LIBQUVI_0_9 +src+=\ + compat/error_pt9.cpp\ + compat/media_pt9.cpp\ + compat/query_pt9.cpp +else +src+=\ + compat/error_pt4.cpp\ + compat/media_pt4.cpp\ + compat/query_pt4.cpp +endif +src+=\ + compat/util.cpp + +hdr=\ + ccapplication\ + ccerror\ + ccfile\ + ccfstream\ + ccinput\ + ccinternal\ + cclog\ + ccoptions\ + ccprogressbar\ + ccquvi\ + ccre\ + ccsig\ + ccutil\ + ccvar + +hdr+=\ + cc/application.h\ + cc/error.h\ + cc/file.h\ + cc/fstream.h\ + cc/input.h\ + cc/internal.h\ + cc/log.h\ + cc/options.h\ + cc/progressbar.h\ + cc/re.h\ + cc/sig.h\ + cc/util.h\ + cc/var.h + +hdr+=\ + compat/error.h\ + compat/media.h\ + compat/options.h\ + compat/query.h\ + compat/util.h bin_PROGRAMS= cclive cclive_SOURCES= $(src) $(hdr) @@ -48,6 +71,8 @@ AM_CPPFLAGS+= $(libcurl_CFLAGS) AM_CPPFLAGS+= $(libpcre_CFLAGS) AM_CPPFLAGS+= $(libpcrepp_CFLAGS) +AM_CPPFLAGS+= $(glibmm_CFLAGS) +AM_CPPFLAGS+= $(glib_CFLAGS) AM_CPPFLAGS+= $(BOOST_CPPFLAGS) cclive_LDFLAGS= $(BOOST_DATE_TIME_LDFLAGS) @@ -60,6 +85,8 @@ cclive_LDADD+= $(libcurl_LIBS) cclive_LDADD+= $(libpcre_LIBS) cclive_LDADD+= $(libpcrecpp_LIBS) +cclive_LDADD+= $(glibmm_LIBS) +cclive_LDADD+= $(glib_LIBS) cclive_LDADD+= $(BOOST_DATE_TIME_LIBS) cclive_LDADD+= $(BOOST_PROGRAM_OPTIONS_LIBS) cclive_LDADD+= $(BOOST_IOSTREAMS_LIBS) @@ -68,7 +95,7 @@ install-exec-hook: if ENABLE_CCL - cd $(DESTDIR)$(bindir) && \ + cd $(DESTDIR)$(bindir) && rm -f ccl$(EXEEXT) && \ $(LN_S) cclive$(EXEEXT) ccl$(EXEEXT) endif
View file
cclive-0.7.9.tar.bz2/src/Makefile.in -> cclive-0.9.3.tar.xz/src/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -16,6 +16,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -35,6 +52,16 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ +@HAVE_LIBQUVI_0_9_TRUE@am__append_1 = \ +@HAVE_LIBQUVI_0_9_TRUE@ compat/error_pt9.cpp\ +@HAVE_LIBQUVI_0_9_TRUE@ compat/media_pt9.cpp\ +@HAVE_LIBQUVI_0_9_TRUE@ compat/query_pt9.cpp + +@HAVE_LIBQUVI_0_9_FALSE@am__append_2 = \ +@HAVE_LIBQUVI_0_9_FALSE@ compat/error_pt4.cpp\ +@HAVE_LIBQUVI_0_9_FALSE@ compat/media_pt4.cpp\ +@HAVE_LIBQUVI_0_9_FALSE@ compat/query_pt4.cpp + bin_PROGRAMS = cclive$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in @@ -42,8 +69,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/boost.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/version.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -52,20 +78,35 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) -am__objects_1 = error.$(OBJEXT) main.$(OBJEXT) log.$(OBJEXT) \ - background.$(OBJEXT) exec.$(OBJEXT) file.$(OBJEXT) \ - license.$(OBJEXT) wait.$(OBJEXT) progressbar.$(OBJEXT) \ - options.$(OBJEXT) re.$(OBJEXT) get.$(OBJEXT) \ - application.$(OBJEXT) err.$(OBJEXT) query.$(OBJEXT) \ - misc.$(OBJEXT) url.$(OBJEXT) opts.$(OBJEXT) media.$(OBJEXT) -am__objects_2 = -am_cclive_OBJECTS = $(am__objects_1) $(am__objects_2) +am__cclive_SOURCES_DIST = cc/application.cpp cc/background.cpp \ + cc/curl.cpp cc/error.cpp cc/exec.cpp cc/file.cpp cc/get.cpp \ + cc/main.cpp cc/re.cpp cc/wait.cpp compat/error_pt9.cpp \ + compat/media_pt9.cpp compat/query_pt9.cpp compat/error_pt4.cpp \ + compat/media_pt4.cpp compat/query_pt4.cpp compat/util.cpp \ + ccapplication ccerror ccfile ccfstream ccinput ccinternal \ + cclog ccoptions ccprogressbar ccquvi ccre ccsig ccutil ccvar \ + cc/application.h cc/error.h cc/file.h cc/fstream.h cc/input.h \ + cc/internal.h cc/log.h cc/options.h cc/progressbar.h cc/re.h \ + cc/sig.h cc/util.h cc/var.h compat/error.h compat/media.h \ + compat/options.h compat/query.h compat/util.h +@HAVE_LIBQUVI_0_9_TRUE@am__objects_1 = error_pt9.$(OBJEXT) \ +@HAVE_LIBQUVI_0_9_TRUE@ media_pt9.$(OBJEXT) query_pt9.$(OBJEXT) +@HAVE_LIBQUVI_0_9_FALSE@am__objects_2 = error_pt4.$(OBJEXT) \ +@HAVE_LIBQUVI_0_9_FALSE@ media_pt4.$(OBJEXT) \ +@HAVE_LIBQUVI_0_9_FALSE@ query_pt4.$(OBJEXT) +am__objects_3 = application.$(OBJEXT) background.$(OBJEXT) \ + curl.$(OBJEXT) error.$(OBJEXT) exec.$(OBJEXT) file.$(OBJEXT) \ + get.$(OBJEXT) main.$(OBJEXT) re.$(OBJEXT) wait.$(OBJEXT) \ + $(am__objects_1) $(am__objects_2) util.$(OBJEXT) +am__objects_4 = +am_cclive_OBJECTS = $(am__objects_3) $(am__objects_4) cclive_OBJECTS = $(am_cclive_OBJECTS) am__DEPENDENCIES_1 = cclive_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -116,10 +157,16 @@ am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(cclive_SOURCES) -DIST_SOURCES = $(cclive_SOURCES) +DIST_SOURCES = $(am__cclive_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +A2X = @A2X@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -156,6 +203,7 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DATE = @DATE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ @@ -233,6 +281,10 @@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +glib_CFLAGS = @glib_CFLAGS@ +glib_LIBS = @glib_LIBS@ +glibmm_CFLAGS = @glibmm_CFLAGS@ +glibmm_LIBS = @glibmm_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -273,57 +325,27 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -src = \ - cc/error.cpp \ - cc/main.cpp \ - cc/log.cpp \ - cc/background.cpp \ - cc/exec.cpp \ - cc/file.cpp \ - cc/license.cpp \ - cc/wait.cpp \ - cc/progressbar.cpp \ - cc/options.cpp \ - cc/re.cpp \ - cc/get.cpp \ - cc/application.cpp \ - quvi/err.cpp \ - quvi/query.cpp \ - quvi/misc.cpp \ - quvi/url.cpp \ - quvi/opts.cpp \ - quvi/media.cpp - -hdr = \ - ccoptions \ - ccinternal \ - ccapplication \ - ccquvi \ - ccprogressbar \ - cclog \ - ccutil \ - ccfile \ - ccre \ - cc/progressbar.h \ - cc/options.h \ - cc/application.h \ - cc/file.h \ - cc/util.h \ - cc/internal.h \ - cc/log.h \ - cc/re.h \ - quvi/ccquvi.h - +src = cc/application.cpp cc/background.cpp cc/curl.cpp cc/error.cpp \ + cc/exec.cpp cc/file.cpp cc/get.cpp cc/main.cpp cc/re.cpp \ + cc/wait.cpp $(am__append_1) $(am__append_2) compat/util.cpp +hdr = ccapplication ccerror ccfile ccfstream ccinput ccinternal cclog \ + ccoptions ccprogressbar ccquvi ccre ccsig ccutil ccvar \ + cc/application.h cc/error.h cc/file.h cc/fstream.h cc/input.h \ + cc/internal.h cc/log.h cc/options.h cc/progressbar.h cc/re.h \ + cc/sig.h cc/util.h cc/var.h compat/error.h compat/media.h \ + compat/options.h compat/query.h compat/util.h cclive_SOURCES = $(src) $(hdr) AM_CPPFLAGS = -I$(top_srcdir)/src $(libquvi_CFLAGS) $(libcurl_CFLAGS) \ - $(libpcre_CFLAGS) $(libpcrepp_CFLAGS) $(BOOST_CPPFLAGS) + $(libpcre_CFLAGS) $(libpcrepp_CFLAGS) $(glibmm_CFLAGS) \ + $(glib_CFLAGS) $(BOOST_CPPFLAGS) cclive_LDFLAGS = $(BOOST_DATE_TIME_LDFLAGS) \ $(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(BOOST_IOSTREAMS_LDFLAGS) \ $(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS)
View file
cclive-0.7.9.tar.bz2/src/cc/application.cpp -> cclive-0.9.3.tar.xz/src/cc/application.cpp
Changed
@@ -1,18 +1,21 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2010-2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ #include <ccinternal> @@ -23,39 +26,29 @@ #include <boost/algorithm/string/classification.hpp> // is_any_of #include <boost/algorithm/string/split.hpp> +#include <boost/scoped_ptr.hpp> #include <boost/foreach.hpp> -#include <boost/random.hpp> - -#include <curl/curl.h> - -#ifndef foreach -#define foreach BOOST_FOREACH -#endif +#include <boost/format.hpp> -#include <ccapplication> #include <ccquvi> +#include <ccapplication> +#include <ccoptions> +#include <ccinput> #include <ccutil> #include <cclog> +#include <ccsig> #include <ccre> namespace cc { -static boost::mt19937 _rng; - -static void rand_decor() -{ - boost::uniform_int<> r(2,5); - boost::variate_generator<boost::mt19937&, boost::uniform_int<> > v(_rng,r); - - const int n = v(); - for (int i=0; i<n; ++i) cc::log << "."; -} - static void handle_fetch(const quvi_word type, void*) { - rand_decor(); +#ifdef HAVE_LIBQUVI_0_9 + if (type == QUVI_CALLBACK_STATUS_DONE) +#else if (type == QUVISTATUSTYPE_DONE) +#endif cc::log << " "; } @@ -66,27 +59,51 @@ static void handle_verify(const quvi_word type) { - rand_decor(); +#ifdef HAVE_LIBQUVI_0_9 + if (type == QUVI_CALLBACK_STATUS_DONE) +#else if (type == QUVISTATUSTYPE_DONE) +#endif print_done(); } static void handle_resolve(const quvi_word type) { - rand_decor(); +#ifdef HAVE_LIBQUVI_0_9 + if (type == QUVI_CALLBACK_STATUS_DONE) +#else if (type == QUVISTATUSTYPE_DONE) +#endif cc::log << " "; } -static int status_callback(long param, void *ptr) +#ifdef HAVE_LIBQUVI_0_9 +static void status_callback_pt9(const quvi_word status, const quvi_word type, + void *data, void *userdata) { - const quvi_word status = quvi_loword(param); - const quvi_word type = quvi_hiword(param); - + cc::log << "."; switch (status) { - case QUVISTATUS_FETCH : - handle_fetch(type,ptr); + case QUVI_CALLBACK_STATUS_FETCH: + handle_fetch(type, data); + break; + case QUVI_CALLBACK_STATUS_HTTP_QUERY_METAINFO: + handle_verify(type); + break; + case QUVI_CALLBACK_STATUS_RESOLVE: + handle_resolve(type); + break; + } +} +#else +static void status_callback_pt4(const quvi_word status, const quvi_word type, + void *data) +{ + cc::log << "."; + switch (status) + { + case QUVISTATUS_FETCH: + handle_fetch(type, data); break; case QUVISTATUS_VERIFY: handle_verify(type); @@ -95,24 +112,28 @@ handle_resolve(type); break; } +} +#endif + +#ifdef HAVE_LIBQUVI_0_9 +static int status_callback(long status_type, void *data, void *userdata) +#else +static int status_callback(long status_type, void *data) +#endif +{ + const quvi_word status = quvi_loword(status_type); + const quvi_word type = quvi_hiword(status_type); +#ifdef HAVE_LIBQUVI_0_9 + status_callback_pt9(status, type, data, userdata); +#else + status_callback_pt4(status, type, data); +#endif cc::log << std::flush; return QUVI_OK; } -template<class Iterator> -static Iterator make_unique(Iterator first, Iterator last) -{ - while (first != last) - { - Iterator next(first); - last = std::remove(++next, last, *first); - first = next; - } - return last; -} - static void print_retrying(const int retry, const int max_retries, const int retry_wait) @@ -142,314 +163,136 @@ cc::log << "libquvi: error: " << e.what() << std::endl; } -static void check_quvi_error(const quvi::error& e) -{ - const long resp_code = e.response_code(); - - if (resp_code >= 400 && resp_code <= 500) - throw e; - - else - { - switch (e.quvi_code()) - { - case QUVI_CALLBACK: - print_quvi_error(e);
View file
cclive-0.7.9.tar.bz2/src/cc/application.h -> cclive-0.9.3.tar.xz/src/cc/application.h
Changed
@@ -1,30 +1,27 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2010-2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ #ifndef cclive_application_h #define cclive_application_h -#include <ccoptions> - -namespace quvi -{ -class options; -class query; -} +#include <cstdlib> namespace cc { @@ -32,17 +29,14 @@ class application { public: - typedef enum { ok=0, invalid_option, system } exit_status; + typedef enum {ok=EXIT_SUCCESS, error=EXIT_FAILURE} exit_status; public: - exit_status exec(int,char **); -private: - void _tweak_curl_opts(const quvi::query&, - const boost::program_options::variables_map&); - void _set_format_string(const std::string&, - quvi::options&, - const boost::program_options::variables_map&); + inline application():_curl(NULL) { } + inline virtual ~application() { } +public: + exit_status exec(int const, char const**); private: - cc::options _opts; + void *_curl; }; } // namespace cc
View file
cclive-0.7.9.tar.bz2/src/cc/background.cpp -> cclive-0.9.3.tar.xz/src/cc/background.cpp
Changed
@@ -1,18 +1,21 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2010-2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ #include <ccinternal> @@ -27,6 +30,7 @@ #include <boost/iostreams/tee.hpp> +#include <ccquvi> #include <ccutil> #include <ccapplication> #include <cclog> @@ -36,15 +40,15 @@ namespace io = boost::iostreams; +#if defined(HAVE_WORKING_FORK) || defined(HAVE_WORKING_VFORK) void go_background(const std::string& log_file, bool& omit) { -#ifdef HAVE_FORK const pid_t pid = fork(); if (pid < 0) { cc::perror("fork"); - exit(application::system); + exit(application::error); } else if (pid != 0) { @@ -70,11 +74,12 @@ freopen("/dev/null", "r", stdin); // Redirect output to log file. - cc::log.push(io::tee(cc::flushable_file_sink(log_file))); + cc::log.push(io::tee(cc::sink::flushable_file(log_file))); + // Omit output to stderr (using cc::log). omit = true; -#endif // HAVE_FORK } +#endif // HAVE_WORKING_(V)FORK } // namespace cc
View file
cclive-0.9.3.tar.xz/src/cc/curl.cpp
Added
@@ -0,0 +1,75 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#include <ccinternal> + +#include <curl/curl.h> + +#include <ccquvi> +#include <ccoptions> +#include <ccutil> + +namespace cc +{ + +namespace po = boost::program_options; + +static void _set_proxy(CURL *c, const po::variables_map& vm) +{ + if (vm.count(OPT__PROXY)) + { + curl_easy_setopt(c, CURLOPT_PROXY, + vm[OPT__PROXY].as<std::string>().c_str()); + } + if_optsw_given(vm, OPT__NO_PROXY) + curl_easy_setopt(c, CURLOPT_PROXY, ""); +} + +void curl_setup(CURL *c, const po::variables_map& vm) +{ + const int n = vm[OPT__THROTTLE].as<throttle>().value() * 1024; + const curl_off_t t = static_cast<curl_off_t>(n); + + curl_easy_setopt(c, CURLOPT_MAX_RECV_SPEED_LARGE, t); + curl_easy_setopt(c, CURLOPT_FOLLOWLOCATION, 1L); + + if_optsw_given(vm, OPT__VERBOSE_LIBCURL) + curl_easy_setopt(c, CURLOPT_VERBOSE, 1L); + +#ifndef HAVE_LIBQUVI_0_9 + curl_easy_setopt(c, CURLOPT_USERAGENT, + vm[OPT__AGENT].as<std::string>().c_str()); +#endif + + curl_easy_setopt(c, CURLOPT_DNS_CACHE_TIMEOUT, + vm[OPT__DNS_CACHE_TIMEOUT].as<dns_cache_timeout>().value()); + + curl_easy_setopt(c, CURLOPT_CONNECTTIMEOUT, + vm[OPT__CONNECT_TIMEOUT].as<connect_timeout>().value()); + + curl_easy_setopt(c, CURLOPT_TIMEOUT, + vm[OPT__TRANSFER_TIMEOUT].as<transfer_timeout>().value()); + + _set_proxy(c, vm); +} + +} // namespace cc + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/cc/error.cpp -> cclive-0.9.3.tar.xz/src/cc/error.cpp
Changed
@@ -1,18 +1,21 @@ /* cclive * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ #include <ccinternal>
View file
cclive-0.9.3.tar.xz/src/cc/error.h
Added
@@ -0,0 +1,104 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef cc__error_h +#define cc__error_h + +#include <ccinternal> + +#include <boost/exception/diagnostic_information.hpp> +#include <boost/exception/errinfo_file_name.hpp> +#include <boost/exception/get_error_info.hpp> +#include <boost/exception/errinfo_errno.hpp> +#include <boost/tuple/tuple.hpp> +#include <cerrno> + +namespace cc +{ + +namespace error +{ + +static inline std::string strerror(const int ec) +{ + char buf[256]; + return strerror_r(ec, buf, sizeof(buf)); +} + +static inline std::string strerror() { return strerror(errno); } + +typedef boost::tuple<std::string,std::string> type_tuple; +typedef boost::error_info<struct tag_tuple,type_tuple> errinfo_tuple; + +static inline int print(const boost::exception& x) +{ + std::clog << "error: "; + + if (std::string const *s = + boost::get_error_info<boost::errinfo_file_name>(x)) + { + std::clog << *s << ": "; + } + + bool print_what = true; + if (int const *n = + boost::get_error_info<boost::errinfo_errno>(x)) + { + std::clog << cc::error::strerror(*n) << " (" << *n << ")"; + print_what = false; + } + + if (type_tuple const *t = boost::get_error_info<errinfo_tuple>(x)) + { + std::clog << boost::get<0>(*t) << ": " << boost::get<1>(*t); + print_what = false; + } + + try + { + throw; + } + catch (const std::exception& x) + { + if (print_what) + std::clog << x.what(); + } + catch (...) + { + std::clog << boost::diagnostic_information(x); + } + std::clog << std::endl; + return EXIT_FAILURE; +} + +struct no_input : virtual std::exception, virtual boost::exception { }; +struct fstream : virtual std::exception, virtual boost::exception { }; +struct config : virtual std::exception, virtual boost::exception { }; +struct tuple : virtual std::exception, virtual boost::exception { }; + +} // namespace error + +struct exit_program : virtual std::exception, virtual boost::exception { }; +struct nothing_todo : virtual std::exception, virtual boost::exception { }; + +} // namespace cc +#endif // cc__error_h + +/* vim: set ts=2 sw=2 tw=72 expandtab: */
View file
cclive-0.7.9.tar.bz2/src/cc/exec.cpp -> cclive-0.9.3.tar.xz/src/cc/exec.cpp
Changed
@@ -1,20 +1,25 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2010-2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ +#include <ccinternal> + #include <stdexcept> #include <sstream> #include <cstdio> @@ -26,11 +31,8 @@ #include <boost/foreach.hpp> #include <pcrecpp.h> -#ifndef foreach -#define foreach BOOST_FOREACH -#endif - #include <ccquvi> +#include <ccoptions> #include <ccfile> #include <ccre> #include <ccutil> @@ -39,9 +41,9 @@ namespace cc { -typedef std::vector<std::string> vst; +typedef std::vector<std::string> vs; -static int invoke_exec(const vst& args) +static int invoke_exec(const vs& args) { const size_t sz = args.size(); const char **argv = new const char* [sz+2]; @@ -99,7 +101,7 @@ static void tokenize(const std::string& r, const std::string& s, - vst& dst) + vs& dst) { pcrecpp::StringPiece sp(s); pcrecpp::RE rx(r); @@ -114,16 +116,16 @@ namespace po = boost::program_options; -void exec(const file& file, const po::variables_map& map) +void exec(const file& file, const po::variables_map& vm) { - const vst m = map["exec"].as<vst>(); - foreach (std::string e, m) + const vs& m = vm[OPT__EXEC].as<vs>(); + BOOST_FOREACH(std::string e, m) { pcrecpp::RE("%f").GlobalReplace(file.path(), &e); pcrecpp::RE("%n").GlobalReplace(file.name(), &e); pcrecpp::RE("%t").GlobalReplace(file.title(), &e); - vst args; + vs args; tokenize("([\"'](.*?)[\"']|\\S+)", e, args); invoke_exec(args); }
View file
cclive-0.7.9.tar.bz2/src/cc/file.cpp -> cclive-0.9.3.tar.xz/src/cc/file.cpp
Changed
@@ -1,52 +1,43 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2010-2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ #include <ccinternal> #include <stdexcept> #include <fstream> -#include <sstream> #include <iomanip> #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef HAVE_SIGNAL_H -#include <signal.h> -#endif - -#if defined (HAVE_SIGNAL_H) && defined (HAVE_SIGNAL) -#define WITH_SIGNAL -#endif - #include <boost/program_options/variables_map.hpp> #include <boost/filesystem.hpp> #include <boost/foreach.hpp> #include <boost/format.hpp> -#ifndef foreach -#define foreach BOOST_FOREACH -#endif - #include <curl/curl.h> #include <pcrecpp.h> #include <ccquvi> +#include <ccoptions> #include <ccprogressbar> #include <ccre> #include <ccutil> @@ -56,50 +47,21 @@ namespace cc { -file::file() - : _initial_length(0), _nothing_todo(false) -{ -} - namespace po = boost::program_options; -file::file(const quvi::media& media, - const quvi::url& url, - const int n, - const po::variables_map& map) +file::file(const quvi::media& media, const po::variables_map& vm) : _initial_length(0), _nothing_todo(false) { try { - _init(media, url, n, map); + _init(media, vm); } - catch (const cc::nothing_todo_error&) + catch (const cc::nothing_todo&) { _nothing_todo = true; } } -file::file(const file& f) - : _initial_length(0), _nothing_todo(false) -{ - _swap(f); -} - -file& file::operator=(const file& f) -{ - if (this != &f) _swap(f); - return *this; -} - -void file::_swap(const file& f) -{ - _title = f._title; - _name = f._name; - _path = f._path; - _initial_length = f._initial_length; - _nothing_todo = f._nothing_todo; -} - #define E "server response code %ld, expected 200 or 206 (conn_code=%ld)" static std::string format_unexpected_http_error( @@ -123,128 +85,151 @@ #undef E -static size_t write_cb(void *data, size_t size, size_t nmemb, void *ptr) +static std::string io_error(const std::string& fpath) { - std::ofstream *o = reinterpret_cast<std::ofstream*>(ptr); - const size_t rsize = size*nmemb; - o->write(static_cast<char*>(data), rsize); - o->flush(); - return rsize; + std::string s = fpath + ": "; + if (errno) + s += cc::perror(); + else + s += "unknown i/o error"; + return (s); } -#ifdef WITH_SIGNAL -static volatile sig_atomic_t recv_usr1; - -static void handle_usr1(int s) +static std::string io_error(const cc::file& f) { - if (s == SIGUSR1) - recv_usr1 = 1; + return io_error(f.path()); } -#endif -static int progress_cb(void *ptr, double, double now, double, double) +class write_data { -#ifdef WITH_SIGNAL - if (recv_usr1) - { - recv_usr1 = 0; - return 1; // Return a non-zero value to abort this transfer. - } -#endif - reinterpret_cast<progressbar*>(ptr)->update(now); - return 0; -} +public: + inline write_data(cc::file *f, const po::variables_map& vm) + : vm(vm), o(NULL), f(f) { } + inline ~write_data() + { + if (o == NULL) + return; + + o->flush(); + o->close(); + + delete o; + o = NULL; + } + inline void open_file() + { + std::ios_base::openmode mode = std::ofstream::binary; + + if_optsw_given(vm, OPT__OVERWRITE) + mode |= std::ofstream::trunc; + else + { + if (f->should_continue()) + mode |= std::ofstream::app; + } -bool file::write(const quvi::query& q, - const quvi::url& u, - const po::variables_map& map) const + o = new std::ofstream(f->path().c_str(), mode); + if (o->fail()) + throw std::runtime_error(io_error(*f)); + } +public:
View file
cclive-0.7.9.tar.bz2/src/cc/file.h -> cclive-0.9.3.tar.xz/src/cc/file.h
Changed
@@ -1,30 +1,27 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2010-2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ #ifndef cclive_file_h #define cclive_file_h -namespace boost -{ -namespace program_options -{ -class variables_map; -} -} +namespace fs = boost::filesystem; namespace cc { @@ -32,35 +29,56 @@ class file { public: - file(); - file(const quvi::media&, - const quvi::url&, - const int, - const boost::program_options::variables_map&); - file(const file&); - file& operator=(const file&); -public: - bool write(const quvi::query&, - const quvi::url&, - const boost::program_options::variables_map&) const; + file(const quvi::media&, const po::variables_map&); + + inline file(): _initial_length(0), _nothing_todo(false) { } + + inline file(const file& f): _initial_length(0), _nothing_todo(false) + { + _swap(f); + } + + inline file& operator=(const file& f) + { + if (this != &f) _swap(f); + return *this; + } public: - std::string to_s(const quvi::url&) const; - const std::string& title() const; - const std::string& path() const; - const std::string& name() const; - const bool nothing_todo() const; - double initial_length() const; + bool write(const quvi::media&, void*, const po::variables_map&) const; public: - static double exists(const std::string&); + std::string to_s(const quvi::media&) const; + inline const std::string& title() const { return _title; } + inline const std::string& path() const { return _path; } + inline const std::string& name() const { return _name; } + inline const bool nothing_todo() const { return _nothing_todo; } + inline double initial_length() const { return _initial_length; } + inline bool should_continue() const { return _initial_length >0; } + inline int set_errmsg(const std::string& e) { _errmsg = e; return 0; } private: - void _init(const quvi::media&, - const quvi::url&, - const int, - const boost::program_options::variables_map&); - bool _should_continue() const; - void _swap(const file&); + void _init(const quvi::media&, const po::variables_map&); + + inline void _swap(const file& f) + { + _title = f._title; + _name = f._name; + _path = f._path; + _initial_length = f._initial_length; + _nothing_todo = f._nothing_todo; + } + inline void store_path(const fs::path& p) + { + _name = p.filename().string(); + _path = p.string(); + } + static inline double exists(const std::string& fpath) + { + if (fs::exists(fpath)) + return static_cast<double>(fs::file_size(fpath)); + return 0; + } private: double _initial_length; + std::string _errmsg; bool _nothing_todo; std::string _title; std::string _name;
View file
cclive-0.9.3.tar.xz/src/cc/fstream.h
Added
@@ -0,0 +1,141 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef cc__fstream_h +#define cc__fstream_h + +#include <ccinternal> + +#include <boost/exception/errinfo_errno.hpp> +#include <boost/filesystem.hpp> +#include <boost/shared_ptr.hpp> +#include <algorithm> +#include <fstream> + +namespace cc +{ + +struct fstream; +typedef boost::shared_ptr<fstream> fstream_shptr; + +struct fstream : boost::noncopyable +{ + inline fstream(const std::string& fpath, + const std::ios_base::openmode& m=std::ofstream::binary) + { + _o = boost::shared_ptr<std::ofstream>(new std::ofstream(fpath.c_str(),m)); + if (_o->fail()) + { + BOOST_THROW_EXCEPTION(cc::error::fstream() + << boost::errinfo_file_name(fpath) + << boost::errinfo_errno(errno)); + } + _fpath = fpath; + } + + static inline fstream_shptr create(const std::string& fpath) + { + return fstream_shptr(new fstream(fpath, std::ofstream::trunc)); + } + + static inline fstream_shptr append(const std::string& fpath) + { + return fstream_shptr(new fstream(fpath, std::ofstream::app)); + } + + static inline fstream_shptr determine_mode(const std::string& fpath, + uintmax_t& n) + { + boost::system::error_code ec; // Throw nothing. + n = boost::filesystem::file_size(fpath, ec); + return (n >0) ? append(fpath) : create(fpath); + } + + static inline std::string read_ignore_errors(const std::string& fpath) + { + return read_contents(fpath, false); + } + + static inline std::string read(const std::string& fpath) + { + return read_contents(fpath); + } + + inline size_t write(const char *data, const size_t size) + { + _o->write(data, size); + if (_o->fail()) + { + BOOST_THROW_EXCEPTION(cc::error::fstream() + << boost::errinfo_file_name(_fpath) + << boost::errinfo_errno(errno)); + } + _o->flush(); + if (_o->fail()) + { + BOOST_THROW_EXCEPTION(cc::error::fstream() + << boost::errinfo_file_name(_fpath) + << boost::errinfo_errno(errno)); + } + return size; + } + +private: + static inline std::string read_contents(const std::string& fpath, + const bool throws_if_fails=true) + { + const fs::path p = fs::system_complete(fpath); + + boost::system::error_code ec; + if (fs::is_directory(p, ec)) + { + BOOST_THROW_EXCEPTION(cc::error::tuple() + << cc::error::errinfo_tuple( + boost::make_tuple(p.string(), "is a directory"))); + } + + std::ifstream f(p.string().c_str()); + std::string r; + if (!f) + { + if (throws_if_fails) + { + BOOST_THROW_EXCEPTION(cc::error::fstream() + << boost::errinfo_file_name(fpath) + << boost::errinfo_errno(errno)); + } + return r; + } + std::copy(std::istreambuf_iterator<char>(f), + std::istreambuf_iterator<char>(), + std::back_inserter(r)); + return r; + } + +private: + boost::shared_ptr<std::ofstream> _o; + std::string _fpath; +}; + +} // namespace cc + +#endif // cc__fstream_h + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/cc/get.cpp -> cclive-0.9.3.tar.xz/src/cc/get.cpp
Changed
@@ -1,25 +1,30 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2010-2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ -#include <iostream> +#include <ccinternal> +#include <iostream> #include <boost/program_options/variables_map.hpp> #include <ccquvi> +#include <ccoptions> #include <cclog> #include <ccfile> #include <ccutil> @@ -29,70 +34,57 @@ namespace po = boost::program_options; -void get(const quvi::query& query, - quvi::media& media, - const po::variables_map& map) +void get(quvi::media& media, void *curl, const po::variables_map& vm) { - const bool no_download = map.count("no-download"); - const bool exec = map.count("exec"); - - const int max_retries = map["max-retries"].as<int>(); - const int retry_wait = map["retry-wait"].as<int>(); + const int max_retries = vm[OPT__MAX_RETRIES].as<cc::max_retries>().value(); + const int retry_wait = vm[OPT__RETRY_WAIT].as<cc::retry_wait>().value(); - int n = 0; + const bool no_download = vm[OPT__NO_DOWNLOAD].as<bool>(); + const bool exec = vm.count(OPT__EXEC); - quvi::url url; + int retry = 0; - while ((url = media.next_url()).ok()) + while (retry <= max_retries) { - ++n; + cc::file file(media, vm); - int retry = 0; - - while (retry <= max_retries) + if (file.nothing_todo()) { - cc::file file(media, url, n, map); - - if (file.nothing_todo()) - { - if (exec) - cc::exec(file, map); - + if (exec) + cc::exec(file, vm); #define E_NOTHING_TODO "media retrieved completely already" - throw std::runtime_error(E_NOTHING_TODO); + throw std::runtime_error(E_NOTHING_TODO); #undef E_NOTHING_TODO - } - - // Download media. - - if (retry > 0) - { - cc::log - << "Retrying " - << retry - << " of " - << max_retries - << " ... " - << std::flush; - - cc::wait(retry_wait); - } + } - ++retry; + // Download media. - cc::log << file.to_s(url) << std::endl; + if (retry > 0) + { + cc::log + << "Retrying " + << retry + << " of " + << max_retries + << " ... " + << std::flush; + + cc::wait(retry_wait); + } - if (!no_download) - { - if (!file.write(query, url, map)) - continue; // Retry. + cc::log << file.to_s(media) << std::endl; + ++retry; - if (exec) - cc::exec(file, map); - } + if (!no_download) + { + if (!file.write(media, curl, vm)) + continue; // Retry. - break; // Stop retrying. + if (exec) + cc::exec(file, vm); } + + break; // Stop retrying. } }
View file
cclive-0.9.3.tar.xz/src/cc/input.h
Added
@@ -0,0 +1,152 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef cc__input_h +#define cc__input_h + +#include <ccinternal> + +#include <istream> +#include <sstream> + +#include <boost/noncopyable.hpp> +#include <glibmm.h> + +#include <ccoptions> +#include <ccfstream> +#include <ccerror> + +namespace cc +{ + +namespace po = boost::program_options; + +struct input : boost::noncopyable +{ + typedef std::vector<std::string> vs; + + static inline vs parse(const po::variables_map& vm) + { + vs r; + (vm.count("url") ==0) + ? parse_without_rargs(vm,r) + : parse_with_rargs(vm,r); + return remove_duplicates(r); + } + +private: + template<class T> static T duplicates(T first, T last) + { + while (first != last) + { + T next(first); + last = std::remove(++next, last, *first); + first = next; + } + return last; + } + + static inline const vs& remove_duplicates(vs& r) + { + r.erase(duplicates(r.begin(), r.end()), r.end()); + if (r.size() ==0) + BOOST_THROW_EXCEPTION(cc::error::no_input()); + return r; + } + + static inline const vs& parse_without_rargs(const po::variables_map& vm, + vs& dst) + { + return extract_uris(dst, read_stdin()); + } + + static inline const vs& parse_with_rargs(const po::variables_map& vm, + vs& dst) + { + BOOST_FOREACH(const std::string& s, vm["url"].as<vs>()) + determine_input(dst, s, true, "neither a valid URI or a local file"); + return dst; + } + + static inline const vs& extract_uris(vs& dst, const std::string& s) + { + gchar **r = g_uri_list_extract_uris(s.c_str()); + for (int i=0; r[i] != NULL; ++i) + { + try + { determine_input(dst, r[i], false, "an invalid URI"); } + catch (...) + { + g_strfreev(r); + throw; + } + } + g_strfreev(r); + return dst; + } + + static inline const vs& read_from_uri(vs& dst, const std::string& s) + { + try + { + const std::string r = Glib::filename_from_uri(s); + extract_uris(dst, cc::fstream::read(r)); + } + catch (const Glib::ConvertError& x) + { + BOOST_THROW_EXCEPTION(cc::error::tuple() + << cc::error::errinfo_tuple(boost::make_tuple(s, x.what()))); + } + return dst; + } + + static inline void determine_input(vs& dst, const std::string& s, + const bool try_read_as_file, + const std::string& emsg) + { + const std::string& c = Glib::uri_parse_scheme(s); + if (c.length() ==0 && try_read_as_file) + extract_uris(dst, cc::fstream::read(s)); + else if (c == "http" || c == "https") + dst.push_back(s); + else if (c == "file") + read_from_uri(dst, s); + else + { + BOOST_THROW_EXCEPTION(cc::error::tuple() + << cc::error::errinfo_tuple(boost::make_tuple(s, emsg))); + } + } + + static inline std::string read_stdin() + { + std::stringstream s; + char c; + while (std::cin.get(c)) + s << c; + return s.str(); + } +}; + +} // namespace cc + +#endif // cc__input_h + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/cc/internal.h -> cclive-0.9.3.tar.xz/src/cc/internal.h
Changed
@@ -1,38 +1,69 @@ /* cclive - * Copyright (C) 2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2011,2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ -// Include this header instead of 'config.h'. +// NOTE: Include this header instead of 'config.h' -#ifndef cclive_internal_h -#define cclive_internal_h +#ifndef cc__internal_h +#define cc__internal_h #include <boost/version.hpp> - #include "config.h" +// Boost.Program_Options + +#if (BOOST_VERSION <= 104900) + // There is a bug in Boost.Program_Options (1.49 at least, possibly + // earlier) that causes the library to provide an incomplete error + // message when an option is given multiple times (and this isn't + // acceptable). 1.53+ appears to work OK, 1.50-1.52 unconfirmed. + #ifndef HAVE_BUG__BOOST_PO__MULTIPLE_OCCURRENCES + #define HAVE_BUG__BOOST_PO__MULTIPLE_OCCURRENCES + #endif +#endif + +// Boost.Filesystem + #define BOOST_FILESYSTEM_NO_DEPRECATED -// Boost 1.44+ -#if (BOOST_VERSION >= 104400) -#ifndef BOOST_FILESYSTEM_VERSION -#define BOOST_FILESYSTEM_VERSION 3 // Default in 1.46.0 +#if (BOOST_VERSION >= 104400) // Boost 1.44+ + #ifndef BOOST_FILESYSTEM_VERSION + #define BOOST_FILESYSTEM_VERSION 3 // Default in 1.46.0 + #endif #endif + +#ifndef if_optsw_given + #define if_optsw_given(__varmap,__varname)\ + if (__varmap[__varname].as<bool>()) +#endif + +#ifndef ifn_optsw_given + #define ifn_optsw_given(__varmap,__varname)\ + if (! __varmap[__varname].as<bool>()) +#endif + +#if defined(HAVE_WORKING_FORK) || defined(HAVE_WORKING_VFORK) + #ifdef HAVE_VFORK + #define vfork fork + #endif #endif -#endif // cclive_internal_h +#endif // cc__internal_h /* vim: set ts=2 sw=2 tw=72 expandtab: */
View file
cclive-0.7.9.tar.bz2/src/cc/log.h -> cclive-0.9.3.tar.xz/src/cc/log.h
Changed
@@ -1,76 +1,149 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ -#ifndef cclive_log_h -#define cclive_log_h +#ifndef cc__log_h +#define cc__log_h -#include <iostream> -#include <fstream> +#include <ccinternal> #include <boost/iostreams/filtering_stream.hpp> +#include <boost/filesystem.hpp> +#include <fstream> + +#include <ccerror> namespace cc { extern boost::iostreams::filtering_ostream log; -struct omit_sink : public boost::iostreams::sink +namespace sink { - std::streamsize write(const char *s, std::streamsize n); - explicit omit_sink(bool b=false); + +struct omit : boost::iostreams::sink +{ + inline std::streamsize write(const char *s, std::streamsize n) + { + if (!_omit) std::clog.write(s, n); + return n; + } + + inline explicit omit(bool omit=false): _omit(omit) { } + private: bool _omit; }; -struct flushable_file_sink +namespace fs = boost::filesystem; + +struct flushable_file : boost::noncopyable { typedef char char_type; - struct category : + struct category : boost::noncopyable, boost::iostreams::output_seekable, - boost::iostreams::device_tag, + boost::iostreams::flushable_tag, boost::iostreams::closable_tag, - boost::iostreams::flushable_tag {}; + boost::iostreams::device_tag { }; - flushable_file_sink( - const std::string&, - const std::ios_base::openmode mode = std::ios::trunc|std::ios::out); +#define DEFAULT_MODE std::ios::trunc|std::ios::out + inline flushable_file(const std::string& fpath, + const std::ios_base::openmode m = DEFAULT_MODE) + : _mode(m), _fpath(fpath) + { + _open(); + } +#undef DEFAULT_MODE - flushable_file_sink& operator=(const flushable_file_sink&); - flushable_file_sink(const flushable_file_sink&); + inline flushable_file(const flushable_file& o) { _copy(o); } - std::streampos seek(std::streamoff, std::ios_base::seekdir); - std::streamsize write(const char *, std::streamsize); - std::streamsize read(char_type *, std::streamsize); + inline flushable_file& operator=(const flushable_file& o) + { + if (this != &o) _copy(o); + return *this; + } + + inline std::streampos seek(std::streamoff n, std::ios_base::seekdir s) + { + _s.seekp(n, s); + _s.seekg(n, s); + return n; + } + + inline std::streamsize write(const char *s, std::streamsize n) + { + _s.write(s, n); + return n; + } + + inline std::streamsize read(char_type *t, std::streamsize n) + { + _s.read(t, n); + return n; + } + + inline bool is_open() const { return _s.is_open(); } + + inline bool flush() + { + _s.flush(); + return true; + } + + inline void close() + { + flush(); + _s.close(); + } - bool is_open() const; - bool flush(); - void close(); private: - void _swap(const flushable_file_sink&); - void _open(); + inline void _copy(const flushable_file& o) + { + close(); + _fpath = o._fpath; + _mode = o._mode; + _open(); + } + + inline void _open() + { + _fpath = fs::system_complete(fs::path(_fpath)).string(); + _s.open(_fpath.c_str(), _mode); + if (_s.fail()) + { + BOOST_THROW_EXCEPTION(cc::error::fstream() + << boost::errinfo_file_name(_fpath) + << boost::errinfo_errno(errno)); + } + } + private: std::ios_base::openmode _mode; - mutable std::fstream _f; std::string _fpath; + std::fstream _s; }; +} // namespace log + } // namespace cc -#endif // cclive_log_h +#endif // vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/cc/main.cpp -> cclive-0.9.3.tar.xz/src/cc/main.cpp
Changed
@@ -1,50 +1,79 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2010-2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ +#include <ccinternal> + +#include <boost/exception/diagnostic_information.hpp> +#include <boost/exception/errinfo_file_name.hpp> +#include <boost/exception/get_error_info.hpp> +#include <boost/exception/errinfo_errno.hpp> + +#include <stdexcept> #include <iostream> +#include <clocale> #include <ccapplication> #include <ccquvi> +#include <ccoptions> +#include <ccutil> +#include <ccvar> using namespace cc; -int main(int argc, char *argv[]) +int main(int const argc, char const **argv) { - application app; - int rc = 0; // OK. - + setlocale(LC_ALL, ""); + application::exit_status es = application::ok; try { - rc = app.exec(argc,argv); + application app; + es = app.exec(argc, argv); } - - // Thrown by quvi::query constructor (e.g. quvi_init failure). + // --version, --help, etc. + catch (const cc::exit_program&) + { + // Fall through. + } + catch (const cc::error::no_input&) + { + std::clog << "error: no input URL" << std::endl; + es = application::error; + } + // Thrown by quvi::query constructor (e.g. quvi_init, quvi_new). catch (const quvi::error& e) { std::clog << "libquvi: error: " << e.what() << std::endl; + es = application::error; } - // Thrown by boost (e.g. cc::go_background failure). catch (const std::runtime_error& e) { std::clog << "error: " << e.what() << std::endl; + es = application::error; } - - return rc; + // Thrown by boost::program_options (cc::options). + catch (const boost::exception& x) + { + es = static_cast<application::exit_status>(cc::error::print(x)); + } + return es; } // vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/cc/options.h -> cclive-0.9.3.tar.xz/src/cc/options.h
Changed
@@ -1,43 +1,792 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ -#ifndef cclive_options_h -#define cclive_options_h +#ifndef cc__options_h +#define cc__options_h + +#include <ccinternal> + +#include <boost/program_options/options_description.hpp> +#include <boost/program_options/positional_options.hpp> +#include <boost/program_options/variables_map.hpp> +#include <boost/program_options/parsers.hpp> +#include <boost/exception/diagnostic_information.hpp> +#include <boost/exception/errinfo_file_name.hpp> +#include <boost/exception/errinfo_errno.hpp> +#include <boost/exception/info.hpp> +#include <boost/algorithm/string/join.hpp> +#include <boost/noncopyable.hpp> +#include <boost/tuple/tuple.hpp> +#include <boost/filesystem.hpp> +#include <boost/foreach.hpp> +#include <boost/format.hpp> +#include <fstream> + +#include <ccerror> +#include <ccre> + +// Core + +#define OPT__CONFIG_FILE "config-file" +#define OPT__NO_DOWNLOAD "no-download" +#define OPT__BACKGROUND "background" + +// Core -- configurable + +#define OPT__TIMESTAMP "timestamp" +#define OPT__CONTINUE "continue" +#define OPT__STREAM "stream" +#define OPT__EXEC "exec" + +// Informative + +#define OPT__PRINT_STREAMS "print-streams" +#define OPT__PRINT_CONFIG "print-config" +#define OPT__SUPPORT "support" +#define OPT__VERSION "version" +#define OPT__HELP "help" + +// Output + +#define OPT__VERBOSE_LIBCURL "verbose-libcurl" +#define OPT__OUTPUT_FILE "output-file" +#define OPT__OVERWRITE "overwrite" +#define OPT__LOG_FILE "log-file" +#define OPT__QUIET "quiet" + +// Output -- configurable + +#define OPT__FILENAME_FORMAT "filename-format" +#define OPT__UPDATE_INTERVAL "update-interval" +#define OPT__PROGRESSBAR "progressbar" +#define OPT__OUTPUT_DIR "output-dir" +#define OPT__TR "tr" + +// Network + +#define OPT__NO_PROXY "no-proxy" + +// Network -- configurable + +#define OPT__DNS_CACHE_TIMEOUT "dns-cache-timeout" +#define OPT__TRANSFER_TIMEOUT "transfer-timeout" +#define OPT__CONNECT_TIMEOUT "connect-timeout" +#define OPT__MAX_RETRIES "max-retries" +#define OPT__RETRY_WAIT "retry-wait" +#define OPT__NO_RESOLVE "no-resolve" +#define OPT__THROTTLE "throttle" +#define OPT__AGENT "agent" +#define OPT__PROXY "proxy" -#include <boost/program_options.hpp> +// Deprecated -- configurable + +#define OPT__PREFER_FORMAT "prefer-format" + +// Hidden (positional) + +#define OPT__URL "url" namespace cc { -class options +namespace po = boost::program_options; +namespace fs = boost::filesystem; + +typedef std::vector<std::string> vs; +typedef std::ostream ostr; + +struct tr +{ + inline friend ostr& operator<<(ostr& o, const tr& r) { return o<<r.str(); } + explicit inline tr(const std::string& s) + { + try + { + std::string empty; + re::tr(s, empty); + } + catch (const cc::error::tuple& x) + { + cc::error::type_tuple const *t = + boost::get_error_info<cc::error::errinfo_tuple>(x); + + const std::string& w = boost::get<1>(*t); + + const std::string& m = + (boost::format("invalid option value: %1%: %2%") % s % w).str(); + + BOOST_THROW_EXCEPTION(cc::error::tuple() + << cc::error::errinfo_tuple(boost::make_tuple(OPT__TR, m))); + } + _str = s; + } + inline const std::string& str() const { return _str; } +private: + std::string _str; +}; + +typedef std::vector<tr> vtr; + +inline static void validate(boost::any& v, + const std::vector<std::string>& values, + tr*, int) +{ + po::validators::check_first_occurrence(v); + const std::string& s = po::validators::get_single_string(values); + v = boost::any(tr(s)); +} + +struct progressbar_mode +{ + typedef enum {normal, simple, dotline} mode_type; + + inline friend ostr& operator<<(ostr& o, const progressbar_mode& r) + { return o << r.str(); } + explicit inline progressbar_mode(const std::string& s) + : _mode(normal) + { + if (s == "normal") + _mode = normal; + else if (s == "dotline") + _mode = dotline; + else if (s == "simple") + _mode = simple; + else + { + const std::string& m = + (boost::format("invalid option value (`%1%')") % s).str(); + + BOOST_THROW_EXCEPTION(cc::error::tuple() + << cc::error::errinfo_tuple(boost::make_tuple(OPT__PROGRESSBAR,m))); + } + _str = s; + } + inline const std::string& str() const { return _str; } + inline mode_type value() const { return _mode; } +private: + std::string _str; + mode_type _mode;
View file
cclive-0.7.9.tar.bz2/src/cc/progressbar.h -> cclive-0.9.3.tar.xz/src/cc/progressbar.h
Changed
@@ -1,74 +1,362 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ -#ifndef cclive_progressbar_h -#define cclive_progressbar_h +#ifndef cc__progressbar_h +#define cc__progressbar_h + +#include <ccinternal> + +#include <boost/date_time/posix_time/posix_time.hpp> +#include <boost/format.hpp> -#include <ccfile> +#include <ccsig> +#include <cclog> namespace cc { -class progressbar +static inline std::string ieee_1541_symbol(double& n) +{ + typedef enum {Ki=1024, Mi=1048576, Gi=1073741824} ieee_1541; + int i = 0; + if (n >=Gi) + { + n /= Gi; + i = 2; + } + else if (n >=Mi) + { + n /= Mi; + i = 1; + } + else + n /= Ki; +#define _s(n) #n + static const char *r[] = {_s(Ki), _s(Mi), _s(Gi), NULL}; +#undef _s + return r[i]; +} + +namespace po = boost::program_options; +namespace pt = boost::posix_time; + +struct progressbar : boost::noncopyable { - enum { default_term_width=80 }; -public: - enum mode { normal = 0, dotline, simple }; -public: - progressbar(const file&, - const quvi::url&, - const boost::program_options::variables_map&); - void update(double); - void finish(); + progressbar(const po::variables_map& vm, const quvi::media& qm, + const double initial_length) + { + _length_bytes.content = qm.content_length(); + _length_bytes.initial = initial_length; + + _cntrs.time_started = pt::microsec_clock::universal_time(); + _cntrs.bytes_received = 0; + _cntrs.num_dots = 0; + + _flags.failed = false; + _flags.done = false; + + _opts.update_interval = + vm[OPT__UPDATE_INTERVAL].as<update_interval>().value(); + + ifn_optsw_given(vm, OPT__BACKGROUND) + _opts.mode = vm[OPT__PROGRESSBAR].as<cc::progressbar_mode>().value(); + else + _opts.mode = cc::progressbar_mode::dotline; + } + + inline virtual ~progressbar() { finish(); } + + inline int update(double dlnow) + { + if (dlnow ==0 || _flags.failed) + return 0; + + const pt::time_duration& td = + pt::microsec_clock::universal_time() - _cntrs.time_started; + + if (_flags.done) + dlnow = _length_bytes.content; + else + { + const double diff = + td.total_microseconds() - _cntrs.last_update.total_microseconds(); + + if (diff < (_opts.update_interval*1e+6)) + return 0; + } + + double elapsed = td.total_seconds(); + if (elapsed ==0) + elapsed = 1e+4; + + const bool inactive = (dlnow ==0); + double rate = (elapsed >0) ? (dlnow/elapsed):0; + + std::string eta, rate_symbol; + if (! inactive) + { + if (! _flags.done) + { + const double left = + (_length_bytes.content - (dlnow + _length_bytes.initial)) /rate; + eta = eta_from_seconds(left+.5); + } + else + { + rate = (_length_bytes.content - _length_bytes.initial) / elapsed; + eta = eta_from_seconds(elapsed); + } + rate_symbol = ieee_1541_symbol(rate); + } + else + { + rate_symbol = "--.-"; + eta = "--:--"; + } + + double size = dlnow; + if (! _flags.done) + size += _length_bytes.initial; + + int percent = 0; + if (_length_bytes.content >0) + { + percent = (100.0 * size / _length_bytes.content); + if (percent >= 100) + percent = 100; + } + + _cntrs.bytes_received = dlnow; + _cntrs.last_update = td; + + switch (_opts.mode) + { + case cc::progressbar_mode::dotline: + return render_dotline(rate_symbol, eta, percent, rate, size); + case cc::progressbar_mode::simple: + return render_simple(percent, size); + case cc::progressbar_mode::normal: + default: + return render_normal(rate_symbol, eta, percent, rate, size); + } + } + + inline bool print_error(const long resp_code, const CURLcode rc, + std::string& errmsg) + { + _flags.failed = true; + + // Do not retry if this is an "unrecoverable" error. + if (resp_code >= 400 && resp_code <= 500) + { + clear_line(errmsg); + BOOST_THROW_EXCEPTION(std::runtime_error(errmsg)); + } + + bool r = false; // Retry by default. + if (rc == 42) // 42=Operation aborted by callback (libcurl). + { + errmsg = "sigusr1 received: interrupt current download";
View file
cclive-0.7.9.tar.bz2/src/cc/re.cpp -> cclive-0.9.3.tar.xz/src/cc/re.cpp
Changed
@@ -1,32 +1,47 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2010,2011,2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ -#include <sstream> +#include <ccinternal> #include <boost/format.hpp> #include <pcrecpp.h> +#include <ccerror> #include <ccre> namespace cc { + namespace re { +static void chk_err(const pcrecpp::RE& re) +{ + if (re.error().length() >0) + { + BOOST_THROW_EXCEPTION(cc::error::tuple() + << cc::error::errinfo_tuple( + boost::make_tuple(re.pattern(), re.error()))); + } +} + static pcrecpp::RE_Options _init_re_opts(const std::string& flags) { pcrecpp::RE_Options opts; @@ -55,6 +70,7 @@ pcrecpp::RE_Options opts = _init_re_opts(flags); pcrecpp::RE subs(pat, opts); + chk_err(subs); (strstr(flags.c_str(), "g")) ? subs.GlobalReplace(sub, &src) @@ -78,8 +94,10 @@ pcrecpp::RE_Options opts = _init_re_opts(flags); if (strstr(flags.c_str(), "g") != 0) { - pcrecpp::StringPiece sp(src); + std::string orig(src); + pcrecpp::StringPiece sp(orig); pcrecpp::RE re(pat, opts); + chk_err(re); src.clear(); std::string s; @@ -90,7 +108,9 @@ { std::string tmp = src; src.clear(); - pcrecpp::RE(pat, opts).PartialMatch(tmp, &src); + pcrecpp::RE re(pat, opts); + chk_err(re); + re.PartialMatch(tmp, &src); } return true; } @@ -99,19 +119,25 @@ bool grep(const std::string& r, const std::string& s) { - return pcrecpp::RE(r, pcrecpp::UTF8()).PartialMatch(s); + pcrecpp::RE re(r, pcrecpp::UTF8()); + chk_err(re); + return re.PartialMatch(s); } static void tr_subst(const std::string& r, std::string& s) { - pcrecpp::RE rx("^s\\/(.*)\\/(.*)\\/(.*)$", pcrecpp::UTF8()); + static const char pattern[] = "^s\\/(.*)\\/(.*)\\/(.*)$"; + + pcrecpp::RE rx(pattern, pcrecpp::UTF8()); std::string pat, sub, flags; - if (!rx.PartialMatch(r, &pat, &sub, &flags)) + if (! rx.PartialMatch(r, &pat, &sub, &flags)) { - std::stringstream b; - b << "--tr: " << "no idea what to do with `" << r << "'"; - throw std::runtime_error(b.str()); + const std::string& m = + (boost::format("nothing matched `%1%'") % pattern).str(); + + BOOST_THROW_EXCEPTION(cc::error::tuple() + << cc::error::errinfo_tuple(boost::make_tuple(r, m))); } if (s.empty()) // Validate regexp only. @@ -119,6 +145,7 @@ pcrecpp::RE_Options o = _init_re_opts(flags); pcrecpp::RE subs(pat, o); + chk_err(subs); (strstr(flags.c_str(), "g")) ? subs.GlobalReplace(sub, &s) @@ -127,14 +154,18 @@ static void tr_filter(const std::string& r, std::string& s) { - pcrecpp::RE rx("^\\/(.*)\\/(.*)$", pcrecpp::UTF8()); + static const char pattern[] = "^\\/(.*)\\/(.*)$"; + + pcrecpp::RE rx(pattern, pcrecpp::UTF8()); std::string pat, flags; - if (!rx.PartialMatch(r, &pat, &flags)) + if (! rx.PartialMatch(r, &pat, &flags)) { - std::stringstream b; - b << "--tr: " << "no idea what to do with `" << r << "'"; - throw std::runtime_error(b.str()); + const std::string& m = + (boost::format("nothing matched `%1%'") % pattern).str(); + + BOOST_THROW_EXCEPTION(cc::error::tuple() + << cc::error::errinfo_tuple(boost::make_tuple(r, m))); } if (s.empty()) // Validate regexp only. @@ -144,20 +175,24 @@ if (strstr(flags.c_str(), "g") != 0) { - pcrecpp::StringPiece sp(s); + std::string orig(s); + pcrecpp::StringPiece sp(orig); s.clear(); - rx = pcrecpp::RE(pat, o); + pcrecpp::RE re(pat, o); + chk_err(re); std::string tmp; - while (rx.FindAndConsume(&sp, &tmp)) + while (re.FindAndConsume(&sp, &tmp)) s += tmp; } else { std::string tmp = s; s.clear(); - pcrecpp::RE(pat, o).PartialMatch(tmp, &s); + pcrecpp::RE re(pat, o); + chk_err(re); + re.PartialMatch(tmp, &s); } }
View file
cclive-0.7.9.tar.bz2/src/cc/re.h -> cclive-0.9.3.tar.xz/src/cc/re.h
Changed
@@ -1,18 +1,21 @@ /* cclive * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ #ifndef cclive_re_h
View file
cclive-0.9.3.tar.xz/src/cc/sig.h
Added
@@ -0,0 +1,129 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef cc__sig_h +#define cc__sig_h + +#include <boost/noncopyable.hpp> +#include <boost/scoped_ptr.hpp> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <unistd.h> +#include <csignal> +#include <cstdio> + +namespace cc +{ + +namespace var +{ +extern volatile sig_atomic_t recv_sigwinch; +extern volatile sig_atomic_t recv_sigusr1; +extern size_t max_width; +} + +namespace sig +{ + +namespace cv = cc::var; + +static inline void default_handler(int n) +{ + switch (n) + { + case SIGWINCH: + cv::recv_sigwinch = 1; + break; + case SIGUSR1: + cv::recv_sigusr1 = 1; + break; + default: + std::clog << __PRETTY_FUNCTION__ << ": warning: unhandled signal `" + << n << "'" << std::endl; + } +} + +static inline size_t query_term_width() +{ + struct winsize w; + if (ioctl(fileno(stderr), TIOCGWINSZ, &w) <0) + return 0; + return w.ws_col; +} + +static inline size_t calc_term_spaceleft(const size_t len, size_t& curr_width) +{ + static const size_t default_term_width = 80; + if (cv::max_width ==0 || cv::recv_sigwinch ==1) + { + cv::max_width = query_term_width(); + if (cv::max_width ==0) + cv::max_width = default_term_width; + } + curr_width = cv::max_width; + return (cv::max_width-len-1); +} + +static inline size_t calc_term_spaceleft(const size_t len) +{ + size_t curr; + return calc_term_spaceleft(len, curr); +} + +} // namespace sig + +template<int T> +struct sighandler : boost::noncopyable +{ + inline virtual ~sighandler() { reset(); } + inline sighandler() { setup(); } +private: + inline void setup() + { + ours.sa_handler = cc::sig::default_handler; + sigemptyset(&ours.sa_mask); + ours.sa_flags = 0; + + sigaction(T, NULL, &theirs); + + if (theirs.sa_handler != SIG_IGN) + sigaction(T, &ours, NULL); + } + inline void reset() const + { + if (theirs.sa_handler != SIG_IGN) + sigaction(T, &theirs, NULL); + } +private: + struct sigaction theirs; + struct sigaction ours; +}; + +typedef struct sighandler<SIGWINCH> type_sigwinch; +typedef struct sighandler<SIGUSR1> type_sigusr1; + +typedef boost::scoped_ptr<type_sigwinch> sigwinch_handler_scptr; +typedef boost::scoped_ptr<type_sigusr1> sigusr1_handler_scptr; + +} // namespace cc + +#endif // cc__sigwinch_h + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/cc/util.h -> cclive-0.9.3.tar.xz/src/cc/util.h
Changed
@@ -1,18 +1,21 @@ /* cclive - * Copyright (C) 2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2011-2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ #ifndef cclive_util_h @@ -20,33 +23,22 @@ namespace boost { -namespace program_options -{ -class variables_map; -} + namespace program_options + { + class variables_map; + } } -namespace quvi -{ -class query; -class media; -class url; -} // namespace quvi - namespace cc { -class nothing_todo_error { -public: - nothing_todo_error() { } -}; - +namespace po = boost::program_options; class file; -void exec(const file&, const boost::program_options::variables_map& map); -void get(const quvi::query&, - quvi::media&, - const boost::program_options::variables_map& map); +void get(quvi::media&, void*, const po::variables_map&); +void exec(const file&, const po::variables_map&); +void curl_setup(void*, const po::variables_map&); + void go_background(const std::string&, bool&); std::string perror(const std::string& p=""); void wait(const int);
View file
cclive-0.9.3.tar.xz/src/cc/var.h
Added
@@ -0,0 +1,40 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef cc__var_h +#define cc__var_h + +#include <boost/iostreams/filtering_stream.hpp> +#include <csignal> + +namespace cc +{ + boost::iostreams::filtering_ostream log; + namespace var + { + volatile sig_atomic_t recv_sigwinch = 0; + volatile sig_atomic_t recv_sigusr1 = 0; + size_t max_width = 0; + } // namespace sig +} // namespace cc + +#endif // cc__var_h + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.7.9.tar.bz2/src/cc/wait.cpp -> cclive-0.9.3.tar.xz/src/cc/wait.cpp
Changed
@@ -1,18 +1,21 @@ /* cclive - * Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> + * Copyright (C) 2010-2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. * * 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 3 of the License, or - * (at your option) any later version. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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. + * 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 + * Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. */ #include <ccinternal> @@ -28,8 +31,9 @@ #define sleep(n) Sleep(n*1000) #endif -#include <cclog> +#include <ccquvi> #include <ccutil> +#include <cclog> namespace cc {
View file
cclive-0.9.3.tar.xz/src/ccerror
Added
@@ -0,0 +1,1 @@ +#include "cc/error.h"
View file
cclive-0.9.3.tar.xz/src/ccfstream
Added
@@ -0,0 +1,1 @@ +#include "cc/fstream.h"
View file
cclive-0.9.3.tar.xz/src/ccinput
Added
@@ -0,0 +1,1 @@ +#include "cc/input.h"
View file
cclive-0.7.9.tar.bz2/src/ccquvi -> cclive-0.9.3.tar.xz/src/ccquvi
Changed
@@ -1,1 +1,43 @@ -#include "quvi/ccquvi.h" +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef ccquvi +#define ccquvi + +#include "config.h" + +#include <vector> +#include <string> +#include <map> + +#ifdef HAVE_LIBQUVI_0_9 +#include <quvi.h> +#else +#include <quvi/quvi.h> +#endif + +#include <compat/options.h> +#include <compat/media.h> +#include <compat/error.h> +#include <compat/query.h> +#include <compat/util.h> +#endif // ccquvi + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/src/ccsig
Added
@@ -0,0 +1,1 @@ +#include "cc/sig.h"
View file
cclive-0.9.3.tar.xz/src/ccvar
Added
@@ -0,0 +1,1 @@ +#include "cc/var.h"
View file
cclive-0.9.3.tar.xz/src/compat
Added
+(directory)
View file
cclive-0.9.3.tar.xz/src/compat/error.h
Added
@@ -0,0 +1,136 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef compat_error_h +#define compat_error_h + +namespace quvi +{ + +class error_base +{ + virtual void _init(quvi_t) = 0; +public: + virtual bool cannot_retry() const = 0; + virtual std::string to_s() const = 0; +protected: + inline virtual ~error_base() { } +}; + +class error_impl : error_base +{ +protected: + inline error_impl(const error_impl& a): _resp_code(0), _quvi_code(0) + { + _copy(a); + } + inline error_impl(): _resp_code(0), _quvi_code(0) { } + inline virtual ~error_impl() { } + inline error_impl& operator=(const error_impl& a) + { + if (this != &a) + _copy(a); + return *this; + } + inline void _copy(const error_impl& a) + { + _resp_code = a._resp_code; + _quvi_code = a._quvi_code; + _what = a._what; + } +public: + inline const std::string& what() const + { + return _what; + } + inline long response_code() const + { + return _resp_code; + } + inline long quvi_code() const + { + return _quvi_code; + } +protected: + std::string _what; + long _resp_code; + long _quvi_code; +}; + +class error_pt4 : public error_impl +{ + void _init(quvi_t); +public: + inline error_pt4(): error_impl() { } + inline error_pt4(const error_pt4& a): error_impl(a) { } + inline ~error_pt4() { } + inline error_pt4(quvi_t q, const long qc): error_impl() + { + _quvi_code = qc; + _init(q); + } + inline error_pt4& operator=(const error_pt4& a) + { + if (this != &a) + _copy(a); + return *this; + } + inline bool cannot_retry() const + { + return (_resp_code >= 400 || _quvi_code != QUVI_OK); + } + std::string to_s() const; +}; + +class error_pt9 : public error_impl +{ + void _init(quvi_t); +public: + inline error_pt9(): error_impl() { } + inline error_pt9(const error_pt9& a): error_impl(a) { } + inline ~error_pt9() { } + inline error_pt9(quvi_t q, const long qc=-1): error_impl() + { + _init(q); // Sets _quvi_code + } + inline error_pt9& operator=(const error_pt9& a) + { + if (this != &a) + _copy(a); + return *this; + } + inline bool cannot_retry() const + { + return (_resp_code >= 400 || _quvi_code != QUVI_OK); + } + std::string to_s() const; +}; + +#ifdef HAVE_LIBQUVI_0_9 +typedef class error_pt9 error; +#else +typedef class error_pt4 error; +#endif + +} // namespace quvi + +#endif // compat_error_h + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/src/compat/error_pt4.cpp
Added
@@ -0,0 +1,43 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#include <boost/format.hpp> +#include <ccquvi> + +namespace quvi +{ + +void error_pt4::_init(quvi_t q) +{ + _what = quvi_strerror(q, static_cast<QUVIcode>(_quvi_code)); + quvi_getinfo(q, QUVIINFO_RESPONSECODE, &_resp_code); +} + +std::string error_pt4::to_s() const +{ + return (boost::format("what=%s, resp_code=%ld, quvi_code=%ld") + % _what.c_str() + % _resp_code + % _quvi_code).str(); +} + +} // namespace quvi + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/src/compat/error_pt9.cpp
Added
@@ -0,0 +1,44 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#include <boost/format.hpp> +#include <ccquvi> + +namespace quvi +{ + +void error_pt9::_init(quvi_t q) +{ + _what = quvi_errmsg(q); + quvi_get(q, QUVI_INFO_RESPONSE_CODE, &_resp_code); + _quvi_code = quvi_errcode(q); +} + +std::string error_pt9::to_s() const +{ + return (boost::format("what=%s, resp_code=%ld, quvi_code=%ld") + % _what.c_str() + % _resp_code + % _quvi_code).str(); +} + +} // namespace quvi + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/src/compat/media.h
Added
@@ -0,0 +1,113 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef compat_media_h +#define compat_media_h + +namespace quvi { + +class media_base +{ + virtual void _init(quvi_t, quvi_media_t) = 0; +protected: + inline virtual ~media_base() { } +}; + +class media_impl : media_base +{ +protected: + std::string _content_type; + std::string _stream_url; + std::string _file_ext; + std::string _title; + std::string _id; + double _content_length; +protected: + inline media_impl(const media_impl& a): _content_length(0) { _copy(a); } + inline media_impl(): _content_length(0) { } + inline virtual ~media_impl() { } + inline media_impl& operator=(const media_impl& a) + { + if (this != &a) + _copy(a); + return *this; + } + inline void _copy(const media_impl& a) + { + _content_type = a._content_type; + _stream_url = a._stream_url; + _file_ext = a._file_ext; + _title = a._title; + _id = a._id; + + _content_length = a._content_length; + } +public: + inline const std::string& content_type() const { return _content_type; } + inline const std::string& stream_url() const { return _stream_url; } + inline const std::string& file_ext() const { return _file_ext; } + inline const std::string& title() const { return _title; } + inline const std::string& id() const { return _id; } + inline double content_length() const { return _content_length; } +}; + +class media_pt4 : public media_impl +{ + void _init(quvi_t, quvi_media_t); +public: + inline media_pt4(const media_pt4& a): media_impl(a) { } + inline media_pt4(quvi_t q, quvi_media_t qm): media_impl() { _init(q, qm); } + inline media_pt4(): media_impl() { } + inline virtual ~media_pt4() { } + inline media_pt4& operator=(const media_pt4& a) + { + if (this != &a) + _copy(a); + return *this; + } +}; + +class media_pt9 : public media_impl +{ + void _init(quvi_t, quvi_media_t); +public: + inline media_pt9(const media_pt9& a): media_impl(a) { } + inline media_pt9(quvi_t q, quvi_media_t qm): media_impl() { _init(q, qm); } + inline media_pt9(): media_impl() { } + inline virtual ~media_pt9() { } + inline media_pt9& operator=(const media_pt9& a) + { + if (this != &a) + _copy(a); + return *this; + } +}; + +#ifdef HAVE_LIBQUVI_0_9 +typedef class media_pt9 media; +#else +typedef class media_pt4 media; +#endif + +} // namespace quvi + +#endif // compat_media_h + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/src/compat/media_pt4.cpp
Added
@@ -0,0 +1,50 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#include <cstring> +#include <ccquvi> + +namespace quvi +{ + +static void _get_s(quvi_media_t qm, QUVIproperty qp, std::string& dst) +{ + char *s; + + dst.clear(); + quvi_getprop(qm, qp, &s); + + if (strlen(s) >0) + dst = s; +} + +void media_pt4::_init(quvi_t, quvi_media_t qm) +{ + quvi_getprop(qm, QUVIPROP_MEDIACONTENTLENGTH, &_content_length); + _get_s(qm, QUVIPROP_MEDIACONTENTTYPE, _content_type); + _get_s(qm, QUVIPROP_FILESUFFIX, _file_ext); + _get_s(qm, QUVIPROP_MEDIAURL, _stream_url); + _get_s(qm, QUVIPROP_PAGETITLE, _title); + _get_s(qm, QUVIPROP_MEDIAID, _id); +} + +} // namespace quvi + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/src/compat/media_pt9.cpp
Added
@@ -0,0 +1,75 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#include <cstring> +#include <ccquvi> + +namespace quvi +{ + +static void _get_s(quvi_media_t qm, QuviMediaProperty qmp, std::string& dst) +{ + char *s = NULL; + + dst.clear(); + quvi_media_get(qm, qmp, &s); + + if (s != NULL && strlen(s) >0) + dst = s; +} + +static void _qmi_s(quvi_http_metainfo_t qmi, + const QuviHTTPMetaInfoProperty qmip, + std::string& dst) +{ + char *s = NULL; + + dst.clear(); + quvi_http_metainfo_get(qmi, qmip, &s); + + if (s != NULL && strlen(s) >0) + dst = s; +} + +void media_pt9::_init(quvi_t q, quvi_media_t qm) +{ + _get_s(qm, QUVI_MEDIA_STREAM_PROPERTY_URL, _stream_url); + _get_s(qm, QUVI_MEDIA_PROPERTY_TITLE, _title); + _get_s(qm, QUVI_MEDIA_PROPERTY_ID, _id); + + quvi_http_metainfo_t qmi = quvi_http_metainfo_new(q, _stream_url.c_str()); + if (quvi_ok(q) == QUVI_FALSE) + { + quvi_http_metainfo_free(qmi); + throw error(q); + } + + quvi_http_metainfo_get(qmi, QUVI_HTTP_METAINFO_PROPERTY_LENGTH_BYTES, + &_content_length); + + _qmi_s(qmi, QUVI_HTTP_METAINFO_PROPERTY_CONTENT_TYPE, _content_type); + _qmi_s(qmi, QUVI_HTTP_METAINFO_PROPERTY_FILE_EXTENSION, _file_ext); + + quvi_http_metainfo_free(qmi); +} + +} // namespace quvi + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/src/compat/options.h
Added
@@ -0,0 +1,56 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef compat_options_h +#define compat_options_h + +namespace quvi { + +class options +{ + inline void _copy(const options& a) + { + statusfunc = a.statusfunc; + useragent = a.useragent; + resolve = a.resolve; + stream = a.stream; + } +public: + inline options(const options& a):statusfunc(NULL), resolve(true) { _copy(a); } + inline options():statusfunc(NULL), resolve(true) { } + inline options& operator=(const options& a) + { + if (this != &a) + _copy(a); + return *this; + } + inline virtual ~options() { statusfunc=NULL; } +public: + quvi_callback_status statusfunc; + std::string useragent; + std::string stream; + bool resolve; +}; + +} // namespace quvi + +#endif // compat_options_h + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/src/compat/query.h
Added
@@ -0,0 +1,120 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef compat_query_h +#define compat_query_h + +namespace boost +{ + namespace program_options + { + class variables_map; + } +} + +namespace po = boost::program_options; + +namespace quvi { + +class query_base +{ + virtual std::string streams(const std::string&, const quvi::options&) const = 0; + virtual media parse(const std::string&, const quvi::options&) const = 0; + virtual std::map<std::string,std::string> support() const = 0; + virtual void _configure(const quvi::options&) const = 0; + virtual void *setup_curl(const po::variables_map&) const = 0; + virtual void _close() = 0; + virtual void _init() = 0; +protected: + inline virtual ~query_base() { } +}; + +class query_impl : query_base +{ +protected: + inline query_impl(const query_impl&): _quvi(0) {} + inline query_impl(): _quvi(0) {} + inline query_impl& operator=(const query_impl&) { return *this; } + inline virtual ~query_impl() {} +protected: + quvi_t _quvi; +}; + +class query_pt4 : public query_impl +{ + void _configure(const quvi::options&) const; + void _close(); + void _init(); +public: + inline query_pt4(const query_pt4& a): query_impl(a) { _init(); } + inline query_pt4(): query_impl() { _init(); } + inline virtual ~query_pt4() { _close(); } + inline query_pt4& operator=(const query_pt4& a) + { + if (this != &a) + { + _close(); + _init(); + } + return *this; + } +public: + std::string streams(const std::string&, const quvi::options&) const; + media parse(const std::string&, const quvi::options&) const; + std::map<std::string,std::string> support() const; + void *setup_curl(const po::variables_map&) const; +}; + +class query_pt9 : public query_impl +{ + void _configure(const quvi::options&) const; + void _close(); + void _init(); +public: + inline query_pt9(const query_pt9& a): query_impl(a) { _init(); } + inline query_pt9(): query_impl() { _init(); } + inline virtual ~query_pt9() { _close(); } + inline query_pt9& operator=(const query_pt9& a) + { + if (this != &a) + { + _close(); + _init(); + } + return *this; + } +public: + std::string streams(const std::string&, const quvi::options&) const; + media parse(const std::string&, const quvi::options&) const; + std::map<std::string,std::string> support() const; + void *setup_curl(const po::variables_map&) const; +}; + +#ifdef HAVE_LIBQUVI_0_9 +typedef class query_pt9 query; +#else +typedef class query_pt4 query; +#endif + +} // namespace quvi + +#endif // compat_query_h + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/src/compat/query_pt4.cpp
Added
@@ -0,0 +1,116 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#include <curl/curl.h> + +#include <ccquvi> +#include <ccutil> + +namespace quvi +{ + +void query_pt4::_init() +{ + const QUVIcode qc = quvi_init(&_quvi); + if (qc != QUVI_OK) + throw error(_quvi, qc); +} + +void query_pt4::_close() +{ + if (_quvi != NULL) + { + quvi_close(&_quvi); + _quvi = NULL; + } +} + +void query_pt4::_configure(const quvi::options& opts) const +{ + if (! opts.stream.empty()) + quvi_setopt(_quvi, QUVIOPT_FORMAT, opts.stream.c_str()); + + quvi_setopt(_quvi, QUVIOPT_STATUSFUNCTION, opts.statusfunc); + quvi_setopt(_quvi, QUVIOPT_NORESOLVE, opts.resolve ? 0L:1L); + quvi_setopt(_quvi, QUVIOPT_CATEGORY, QUVIPROTO_HTTP); +} + +void *query_pt4::setup_curl(const po::variables_map& vm) const +{ + CURL *c; + quvi_getinfo(_quvi, QUVIINFO_CURL, &c); + cc::curl_setup(c, vm); + return c; +} + +std::string query_pt4::streams(const std::string& url, + const quvi::options& opts) const +{ + _configure(opts); + + char *fmts; + + const QUVIcode qc = + quvi_query_formats(_quvi, const_cast<char*>(url.c_str()), &fmts); + + if (qc != QUVI_OK) + throw error(_quvi, qc); + + std::string r = fmts; + quvi_free(fmts); + + return r; +} + +media query_pt4::parse(const std::string& url, const options& opts) const +{ + _configure(opts); + + quvi_media_t qm; + QUVIcode qc = quvi_parse(_quvi, const_cast<char*>(url.c_str()), &qm); + + if (qc != QUVI_OK) + throw error(_quvi, qc); + + media r(_quvi, qm); + quvi_parse_close(&qm); + + return r; +} + +std::map<std::string,std::string> query_pt4::support() const +{ + quvi_setopt(_quvi, QUVIOPT_CATEGORY, QUVIPROTO_HTTP); + + std::map<std::string,std::string> r; + char *a, *b; + + while (quvi_next_supported_website(_quvi, &a, &b) == QUVI_OK) + { + r[a] = b; + quvi_free(a); + quvi_free(b); + } + return r; +} + +} // namespace quvi + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/src/compat/query_pt9.cpp
Added
@@ -0,0 +1,122 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#include <curl/curl.h> + +#include <cstring> +#include <sstream> + +#include <ccquvi> +#include <ccutil> + +namespace quvi +{ + +void query_pt9::_init() +{ + _quvi = quvi_new(); + if (quvi_ok(_quvi) == QUVI_FALSE) + throw error(_quvi); +} + +void query_pt9::_close() +{ + quvi_free(_quvi); + _quvi = NULL; +} + +void query_pt9::_configure(const quvi::options& qopts) const +{ + quvi_set(_quvi, QUVI_OPTION_USER_AGENT, qopts.useragent.c_str()); + quvi_set(_quvi, QUVI_OPTION_CALLBACK_STATUS, qopts.statusfunc); +} + +void *query_pt9::setup_curl(const po::variables_map& vm) const +{ + CURL *c; + quvi_get(_quvi, QUVI_INFO_CURL_HANDLE, &c); + cc::curl_setup(c, vm); + return c; +} + +std::string query_pt9::streams(const std::string& url, + const quvi::options& opts) const +{ + _configure(opts); + + quvi_media_t qm = quvi_media_new(_quvi, url.c_str()); + if (quvi_ok(_quvi) == QUVI_FALSE) + { + quvi_media_free(qm); + throw error(_quvi); + } + + std::stringstream ss; + char *id; + + while (quvi_media_stream_next(qm) == QUVI_TRUE) + { + quvi_media_get(qm, QUVI_MEDIA_STREAM_PROPERTY_ID, &id); + if (strlen(id) >0) + { + if (ss.str().length() >0) + ss << ","; + ss << id; + } + } + quvi_media_free(qm); + return ss.str(); +} + +media query_pt9::parse(const std::string& url, + const quvi::options& opts) const +{ + _configure(opts); + + quvi_media_t qm = quvi_media_new(_quvi, url.c_str()); + if (quvi_ok(_quvi) == QUVI_FALSE) + throw error(_quvi); + + if (! opts.stream.empty()) + quvi_media_stream_select(qm, opts.stream.c_str()); + + media r(_quvi, qm); + quvi_media_free(qm); + + return r; +} + +std::map<std::string,std::string> query_pt9::support() const +{ + std::map<std::string,std::string> r; + char *v; + + while (quvi_script_next(_quvi, QUVI_SCRIPT_TYPE_MEDIA) == QUVI_TRUE) + { + quvi_script_get(_quvi, QUVI_SCRIPT_TYPE_MEDIA, + QUVI_SCRIPT_PROPERTY_DOMAINS, &v); + r[v] = ""; + } + return r; +} + +} // namespace quvi + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/src/compat/util.cpp
Added
@@ -0,0 +1,70 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#include <pcrecpp.h> +#include <sstream> + +#include <ccquvi> + +namespace quvi +{ + +// Version. + +std::string version() +{ +#ifdef HAVE_LIBQUVI_0_9 + std::stringstream s; + s << quvi_version(QUVI_VERSION) << "\n " + << " built on " << quvi_version(QUVI_VERSION_BUILD_TIME) << " " + << "for " << quvi_version(QUVI_VERSION_BUILD_TARGET) << "\n " + << " with " << quvi_version(QUVI_VERSION_BUILD_CC_CFLAGS) << "\n " + << "configuration: " << quvi_version(QUVI_VERSION_CONFIGURATION); + return s.str(); +#else + return quvi_version(QUVI_VERSION_LONG); +#endif +} + +typedef std::map<std::string,std::string>::const_iterator smci; + +static const std::string _domain_patt_to_s(smci i) +{ + std::string d = (*i).first; +#ifndef HAVE_LIBQUVI_0_9 /* Only libquvi 0.4 needs this. */ + pcrecpp::RE("%w\\+").GlobalReplace("com", &d); + pcrecpp::RE("%").GlobalReplace("", &d); +#endif + return d; +} + +std::string support_to_s(const std::map<std::string,std::string>& map) +{ + std::stringstream b; + + for (smci iter = map.begin(); iter != map.end(); ++iter) + b << _domain_patt_to_s(iter) << "\n"; + + return b.str(); +} + +} // namespace quvi + +// vim: set ts=2 sw=2 tw=72 expandtab:
View file
cclive-0.9.3.tar.xz/src/compat/util.h
Added
@@ -0,0 +1,32 @@ +/* cclive + * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com> + * + * This file is part of cclive <http://cclive.sourceforge.net/>. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef compat_util_h +#define compat_util_h + +namespace quvi +{ +std::string support_to_s(const std::map<std::string,std::string>&); +std::string version(); +} // namespace quvi + +#endif // compat_util_h + +// vim: set ts=2 sw=2 tw=72 expandtab:
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.