~ubuntu-branches/ubuntu/oneiric/irssi/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/00irssi-core.pl.h

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2008-02-05 23:17:04 UTC
  • Revision ID: james.westby@ubuntu.com-20080205231704-gl9bsdgdfweyk3ff
Tags: 0.8.12-3ubuntu1
* Merge from debian unstable, remaining changes (LP: #181641):
  - Added debian/patches/90irc-ubuntu-com.dpatch (Launchpad #52690).
    New with this merge: We now also apply this patch.
  - Modify Maintainer value to match the DebianMaintainerField spec.
  - debian/irssi.prerm: Don't remove alternative on upgrades (LP #67698).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Author: David Pashley <david@davidpashley.com>  vim:ft=diff:
 
2
Description: none
 
3
 
 
4
Index: irssi-0.8.12/src/perl/irssi-core.pl.h
 
5
===================================================================
 
6
--- /dev/null
 
7
+++ irssi-0.8.12/src/perl/irssi-core.pl.h
 
8
@@ -0,0 +1,52 @@
 
9
+const char *irssi_core_code =
 
10
+"# NOTE: this is printed through printf()-like function,\n"
 
11
+"# so no extra percent characters.\n"
 
12
+"\n"
 
13
+"# %%d : must be first - 1 if perl libraries are to be linked \n"
 
14
+"#       statically with irssi binary, 0 if not\n"
 
15
+"# %%s : must be second - use Irssi; use Irssi::Irc; etc..\n"
 
16
+"package Irssi::Core;\n"
 
17
+"\n"
 
18
+"use Symbol;\n"
 
19
+"\n"
 
20
+"sub is_static {\n"
 
21
+"  return %d;\n"
 
22
+"}\n"
 
23
+"\n"
 
24
+"sub destroy {\n"
 
25
+"  eval { $_[0]->UNLOAD() if $_[0]->can('UNLOAD'); };\n"
 
26
+"  Symbol::delete_package($_[0]);\n"
 
27
+"}\n"
 
28
+"\n"
 
29
+"sub eval_data {\n"
 
30
+"  my ($data, $id) = @_;\n"
 
31
+"  destroy(\"Irssi::Script::$id\");\n"
 
32
+"\n"
 
33
+"  my $package = \"Irssi::Script::$id\";\n"
 
34
+"  my $eval = qq{package $package; %s sub handler { $data; }};\n"
 
35
+"  {\n"
 
36
+"      # hide our variables within this block\n"
 
37
+"      my ($filename, $package, $data);\n"
 
38
+"      eval $eval;\n"
 
39
+"  }\n"
 
40
+"  die $@ if $@;\n"
 
41
+"\n"
 
42
+"  my $ret;\n"
 
43
+"  eval { $ret = $package->handler; };\n"
 
44
+"  die $@ if $@;\n"
 
45
+"  return $ret;\n"
 
46
+"}\n"
 
47
+"\n"
 
48
+"sub eval_file {\n"
 
49
+"  my ($filename, $id) = @_;\n"
 
50
+"\n"
 
51
+"  local *FH;\n"
 
52
+"  open FH, $filename or die \"File not found: $filename\";\n"
 
53
+"  local($/) = undef;\n"
 
54
+"  my $data = <FH>;\n"
 
55
+"  close FH;\n"
 
56
+"  local($/) = \"\\n\";\n"
 
57
+"\n"
 
58
+"  eval_data($data, $id);\n"
 
59
+"}\n"
 
60
+;