# DCC MultiGet # by Kaveh Moini # # Description: # * A small and rather resilient script for fetching a list of single packs # and ranges of packs from an XDCC bot # * Can handle abrupt closing of DCC connection, check whether transfer # started, and restart incomplete transfers # * Avoids flooding bots and getting banned by using configurable delays # (with sane defaults) # * Configurable message prefix # # Requires: # * Written on IRSSI 0.8.13 (20090331), can't be guaranteed to work on # previous versions but testing won't hurt # (don't forget to change 'use Irssi [version];' line) # * dcc_autoget = on # * dcc_autoresume = on # # Note: # * For security reasons MultiGet does NOT automatically set dcc_autoget # and dcc_autoresume you have to do so manually # # Usage: # mg # Fetches specified packs from specified bot # is a list of numbers, or ranges denoted by '-' # Example: mg BotX 38 1 12-14 82 23-43 # Fetches, in order given, packs 38, 1, 12 to 14, 82, and 23 to 43 # When a range m-n is specified m and n will be fetched too # ---------------------------------------------------------------------- # mg_cancel # Cancels mg fetching, will NOT close any running transfers # ---------------------------------------------------------------------- # mg_reset # Resets all mg configuration to defaults # # Configuration: # NOTE: all delays are in seconds # * mg_next_delay: how much to wait before requesting next pack after # successful transfer, default 5 # * mg_no_transfer_delay: how much to wait before re-requesting same pack # if transfer fails, default 60 # * mg_dcc_closed_retry_delay: how much to wait before re-requesting same # pack if DCC connection is closed for whatever reason, default 10 # * mg_transfer_confirmation_delay: how much to wait before checking if # requested transfer started, will result in re-requesting the pack if no # offer is received from the bot after set time, default 30 # * mg_message_prefix: what to tell the bot to request a pack, should # include everything before the pack number including the last # whitespace, default "xdcc send " use strict; use Irssi 20090331; use vars qw($VERSION %IRSSI); $VERSION = 20090813; %IRSSI = ( name => "mg", description => "DCC MultiGet, for fetching from XDCC bots", license => "ccBSD, http://creativecommons.org/licenses/BSD/", changed => "$VERSION", authors => "Kaveh Moini", contact => "campanastra\@gmail.com", ); my ($server, $botname, $pncounter, $pact); my @totags = (); my @packs = (); my $nexdelay = 5; my $dcrdelay = 10; my $ntrdelay = 60; my $trcdelay = 30; my $msgprefix = "xdcc send "; sub mg { @packs = (); my @args = split(/ +/, @_[0]); if ($#args < 1) { Irssi::print "MG | too few arguments"; Irssi::print "MG | usage: mg "; return; } $server = @_[1]; my $witem = @_[2]; $botname = shift(@args); my ($prh, $prl, $pn); foreach my $ps (@args) { if ($ps =~ /^\d+-\d+$/) { ($prl, $prh) = ($ps =~ /(\d+)-(\d+)/); Irssi::print "MG | pack range: " . $prl . " through " . $prh; for ($pn = $prl; $pn <= $prh; $pn += 1) { push(@packs, $pn); } } elsif ($ps =~ /^\d+$/) { ($pn) = ($ps =~ /(\d+)/); Irssi::print "MG | pack number: " . $pn; push(@packs, $pn); } else { Irssi::print "MG | invalid pack specification: " . $ps; } } if ($#packs < 0) { Irssi::print "MG | no valid packs specifications"; return; } Irssi::print "MG | bot name: " . $botname; Irssi::print "MG | message prefix: " . "\"" . $msgprefix . "\""; $pncounter = 0; $pact = 0; Irssi::signal_add("dcc closed", "mghandler"); Irssi::signal_add("dcc get receive", "dcchandler"); Irssi::print "MG | beginning with: " . $packs[$pncounter]; &reqpack; } sub mghandler { my ($dcc) = @_; if ($dcc->{'nick'} eq $botname) { Irssi::print "MG | pack " . $packs[$pncounter] . " size was: " . $dcc->{'size'}; Irssi::print "MG | transferred: " . $dcc->{'transfd'}; Irssi::print "MG | skipped: " . $dcc->{'skipped'}; $pact = 0; foreach my $to (@totags) { Irssi::timeout_remove($to); } @totags = (); if ($dcc->{'transfd'} == $dcc->{'size'}) { Irssi::print "MG | transfer successful"; if ($pncounter < $#packs) { Irssi::print "MG | waiting " . $nexdelay . " seconds"; Irssi::timeout_add_once($nexdelay * 1000, sub { $pncounter += 1; Irssi::print "MG | getting next: " . $packs[$pncounter]; &reqpack; } , []); } else { Irssi::print "MG | ending at: " . $packs[$pncounter]; Irssi::signal_remove("dcc closed", "mghandler"); Irssi::signal_remove("dcc get receive", "dcchandler"); @packs = (); } } else { Irssi::print "MG | transfer failed"; Irssi::print "MG | waiting " . $dcrdelay . " seconds"; Irssi::timeout_add_once($dcrdel
require 'formula'

class Cgal < Formula
  homepage 'http://www.cgal.org/'
  url 'https://gforge.inria.fr/frs/download.php/33525/CGAL-4.4.tar.gz'
  sha1 '5e82193808817ba5144a0c8a57fa5d0c2498cb0d'

  option :cxx11

  option 'imaging', "Build ImageIO and QT compoments of CGAL"
  option 'with-eigen3', "Build with Eigen3 support"
  option 'with-lapack', "Build with LAPACK support"

  depends_on 'cmake' => :build
  if build.cxx11?
    depends_on 'boost' => 'c++11'
    depends_on 'gmp'   => 'c++11'
  else
    depends_on 'boost'
    depends_on 'gmp'
  end
  depends_on 'mpfr'

  depends_on 'qt' if build.include? 'imaging'
  depends_on 'eigen' if build.with? "eigen3"

  # Allows to compile with clang 425: http://goo.gl/y9Dg2y
  patch :DATA

  def install
    ENV.cxx11 if build.cxx11?
    args = ["-DCMAKE_INSTALL_PREFIX=#{prefix}",
            "-DCMAKE_BUILD_TYPE=Release",
            "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON",
            "-DCMAKE_INSTALL_NAME_DIR=#{HOMEBREW_PREFIX}/lib"]
    unless build.include? 'imaging'
      args << "-DWITH_CGAL_Qt3=OFF" << "-DWITH_CGAL_Qt4=OFF" << "-DWITH_CGAL_ImageIO=OFF"
    end
    if build.with? "eigen3"
      args << "-DWITH_Eigen3=ON"
    end
    if build.with? "lapack"
      args << "-DWITH_LAPACK=ON"
    end
    args << '.'
    system "cmake", *args
    system "make install"
  end
end

__END__
diff --git a/src/CGAL/File_header_extended_OFF.cpp b/src/CGAL/File_header_extended_OFF.cpp
index 3f709ff..f0e5bd3 100644
--- a/src/CGAL/File_header_extended_OFF.cpp
+++ b/src/CGAL/File_header_extended_OFF.cpp
@@ -186,7 +186,8 @@ std::istream& operator>>( std::istream& in, File_header_extended_OFF& h) {
         }
         in >> keyword;
     }
-    in >> skip_until_EOL >> skip_comment_OFF;
+    skip_until_EOL(in);
+    skip_comment_OFF(in);
     return in;
 }
 #undef CGAL_IN