Annotation of ports/japanese/gjiten/patches/patch-dicfiles_getdics_pl, Revision 1.1
1.1 ! nbrk 1: $OpenBSD$
! 2: --- dicfiles/getdics.pl.orig Fri Jan 30 02:45:04 2009
! 3: +++ dicfiles/getdics.pl Fri Jan 30 03:05:17 2009
! 4: @@ -15,10 +15,10 @@ my $SYSTEMWIDE = ($< == 0) ? 1 : 0; # if we run as roo
! 5:
! 6: my $UTFDICDIR;
! 7: if ($SYSTEMWIDE == 1) {
! 8: - $UTFDICDIR = "/usr/share/gjiten/dics";
! 9: + $UTFDICDIR = "/usr/local/share/gjiten/dics";
! 10: }
! 11: else {
! 12: - $UTFDICDIR = "$ENV{HOME}/gjiten";
! 13: + $UTFDICDIR = "$ENV{HOME}/.gjiten";
! 14: die "couldn't get home directory!\n" if "$ENV{HOME}" eq "";
! 15: }
! 16:
! 17: @@ -50,8 +50,8 @@ sub printhelp {
! 18: them all (this requires ~60Mb of disk space!).
! 19:
! 20: If you run this script as a user, the dictionary files will be
! 21: - installed in \$HOME/gjiten.
! 22: - If you run it as root, they will be placed under /usr/share/gjiten/dics
! 23: + installed in \$HOME/.gjiten.
! 24: + If you run it as root, they will be placed under /usr/local/share/gjiten/dics
! 25: and they will be set up system-wide in gconf to make them automatically
! 26: available to all users without any setup.
! 27:
! 28: @@ -64,15 +64,15 @@ _HELP_
! 29: }
! 30:
! 31: # binaries
! 32: -my $WGET = "/usr/bin/wget";
! 33: -my $GUNZIP = "/bin/gunzip";
! 34: -my $UNZIP = "/usr/bin/unzip";
! 35: -my $ICONV = "/usr/bin/iconv";
! 36: -my $GCONFTOOL = "/usr/bin/gconftool-2";
! 37: +my $FTP = "/usr/bin/ftp";
! 38: +my $GUNZIP = "/usr/bin/gunzip";
! 39: +my $UNZIP = "/usr/local/bin/unzip";
! 40: +my $ICONV = "/usr/local/bin/iconv";
! 41: +my $GCONFTOOL = "/usr/local/bin/gconftool-2";
! 42:
! 43: #my $DELETETMP = 0; # clean up after finishing?
! 44:
! 45: -foreach my $bin ($WGET, $GUNZIP, $ICONV, $GCONFTOOL) {
! 46: +foreach my $bin ($FTP, $GUNZIP, $ICONV, $GCONFTOOL) {
! 47: if (! -e $bin) {
! 48: die "Couldn't find executable $bin!\n";
! 49: }
! 50: @@ -80,7 +80,7 @@ foreach my $bin ($WGET, $GUNZIP, $ICONV, $GCONFTOOL) {
! 51:
! 52: my @dics = (
! 53: {
! 54: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/edict.gz",
! 55: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/edict.gz",
! 56: "package" => "edict.gz",
! 57: "format" => "gzip",
! 58: "encoding" => "EUC-JP",
! 59: @@ -90,7 +90,7 @@ my @dics = (
! 60: "section" => "basic",
! 61: },
! 62: {
! 63: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/kanjidic.gz",
! 64: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/kanjidic.gz",
! 65: "package" => "kanjidic.gz",
! 66: "format" => "gzip",
! 67: "encoding" => "EUC-JP",
! 68: @@ -102,7 +102,7 @@ my @dics = (
! 69:
! 70: # EXTRA
! 71: {
! 72: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/enamdict.gz",
! 73: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/enamdict.gz",
! 74: "package" => "enamdict.gz",
! 75: "format" => "gzip",
! 76: "encoding" => "EUC-JP",
! 77: @@ -112,7 +112,7 @@ my @dics = (
! 78: "section" => "extra",
! 79: },
! 80: {
! 81: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/j_places.gz",
! 82: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/j_places.gz",
! 83: "package" => "j_places.gz",
! 84: "format" => "gzip",
! 85: "encoding" => "EUC-JP",
! 86: @@ -122,7 +122,7 @@ my @dics = (
! 87: "section" => "extra",
! 88: },
! 89: {
! 90: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/lifscdic.Z",
! 91: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/lifscdic.Z",
! 92: "package" => "lifscdic.Z",
! 93: "format" => "gzip",
! 94: "encoding" => "EUC-JP",
! 95: @@ -132,7 +132,7 @@ my @dics = (
! 96: "section" => "extra",
! 97: },
! 98: {
! 99: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/engscidic.gz",
! 100: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/engscidic.gz",
! 101: "package" => "engscidic.gz",
! 102: "format" => "gzip",
! 103: "encoding" => "EUC-JP",
! 104: @@ -142,7 +142,7 @@ my @dics = (
! 105: "section" => "extra",
! 106: },
! 107: {
! 108: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/compdic.gz",
! 109: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/compdic.gz",
! 110: "package" => "compdic.gz",
! 111: "format" => "gzip",
! 112: "encoding" => "EUC-JP",
! 113: @@ -152,7 +152,7 @@ my @dics = (
! 114: "section" => "extra",
! 115: },
! 116: {
! 117: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/geodic.gz",
! 118: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/geodic.gz",
! 119: "package" => "geodic.gz",
! 120: "format" => "gzip",
! 121: "encoding" => "EUC-JP",
! 122: @@ -162,7 +162,7 @@ my @dics = (
! 123: "section" => "extra",
! 124: },
! 125: {
! 126: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/compverb.gz",
! 127: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/compverb.gz",
! 128: "package" => "compverb.gz",
! 129: "format" => "gzip",
! 130: "encoding" => "EUC-JP",
! 131: @@ -172,7 +172,7 @@ my @dics = (
! 132: "section" => "extra",
! 133: },
! 134: {
! 135: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/riverwater.zip",
! 136: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/riverwater.zip",
! 137: "package" => "riverwater.zip",
! 138: "format" => "zip",
! 139: "encoding" => "EUC-JP",
! 140: @@ -182,7 +182,7 @@ my @dics = (
! 141: "section" => "extra",
! 142: },
! 143: {
! 144: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/4jword3_edict.zip",
! 145: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/4jword3_edict.zip",
! 146: "package" => "4jword3_edict.zip",
! 147: "format" => "zip",
! 148: "encoding" => "EUC-JP",
! 149: @@ -192,7 +192,7 @@ my @dics = (
! 150: "section" => "extra",
! 151: },
! 152: {
! 153: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/classical.zip",
! 154: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/classical.zip",
! 155: "package" => "classical.zip",
! 156: "format" => "zip",
! 157: "encoding" => "EUC-JP",
! 158: @@ -202,7 +202,7 @@ my @dics = (
! 159: "section" => "extra",
! 160: },
! 161: {
! 162: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/lingdic.zip",
! 163: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/lingdic.zip",
! 164: "package" => "lingdic.zip",
! 165: "format" => "zip",
! 166: "encoding" => "EUC-JP",
! 167: @@ -212,7 +212,7 @@ my @dics = (
! 168: "section" => "extra",
! 169: },
! 170: {
! 171: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/forsdic.zip",
! 172: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/forsdic.zip",
! 173: "package" => "forsdic.zip",
! 174: "format" => "zip",
! 175: "encoding" => "EUC-JP",
! 176: @@ -222,7 +222,7 @@ my @dics = (
! 177: "section" => "extra",
! 178: },
! 179: {
! 180: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/aviation.zip",
! 181: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/aviation.zip",
! 182: "package" => "aviation.zip",
! 183: "format" => "zip",
! 184: "encoding" => "EUC-JP",
! 185: @@ -232,7 +232,7 @@ my @dics = (
! 186: "section" => "extra",
! 187: },
! 188: {
! 189: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/concrete.zip",
! 190: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/concrete.zip",
! 191: "package" => "concrete.zip",
! 192: "format" => "zip",
! 193: "encoding" => "EUC-JP",
! 194: @@ -242,7 +242,7 @@ my @dics = (
! 195: "section" => "extra",
! 196: },
! 197: {
! 198: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/findic.zip",
! 199: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/findic.zip",
! 200: "package" => "findic.zip",
! 201: "format" => "zip",
! 202: "encoding" => "EUC-JP",
! 203: @@ -252,7 +252,7 @@ my @dics = (
! 204: "section" => "extra",
! 205: },
! 206: {
! 207: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/mktdic.zip",
! 208: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/mktdic.zip",
! 209: "package" => "mktdic.zip",
! 210: "format" => "zip",
! 211: "encoding" => "EUC-JP",
! 212: @@ -262,7 +262,7 @@ my @dics = (
! 213: "section" => "extra",
! 214: },
! 215: {
! 216: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/stardict.zip",
! 217: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/stardict.zip",
! 218: "package" => "stardict.zip",
! 219: "format" => "zip",
! 220: "encoding" => "EUC-JP",
! 221: @@ -272,7 +272,7 @@ my @dics = (
! 222: "section" => "extra",
! 223: },
! 224: {
! 225: - "url" => "http://ftp.cc.monash.edu.au/pub/nihongo/buddhdic.zip",
! 226: + "url" => "ftp://ftp.monash.edu.au/pub/nihongo/buddhdic.zip",
! 227: "package" => "buddhdic.zip",
! 228: "format" => "zip",
! 229: "encoding" => "UTF-8",
! 230: @@ -328,11 +328,11 @@ foreach my $dic (@dics) {
! 231: next if (($BASICSETUP == 1) && ($dic->{section} eq "extra"));
! 232:
! 233: # DOWNLOAD
! 234: -#wget -c http://ftp.cc.monash.edu.au/pub/nihongo/edict.gz -O dl/edict.gz
! 235: +#ftp -CV ftp://ftp.monash.edu.au/pub/nihongo/edict.gz -o dl/edict.gz
! 236: if (! -f "$DLDIR/$dic->{package}") {
! 237: print "Downloading \"$dic->{name}\" from $dic->{url}\n";
! 238: - my @wget = ("$WGET -q -c $dic->{url} -O $DLDIR/$dic->{package}");
! 239: - if (system(@wget) != 0) {
! 240: + my @ftp = ("$FTP -CV $dic->{url} -o $DLDIR/$dic->{package}");
! 241: + if (system(@ftp) != 0) {
! 242: $dic->{status} = "download failed";
! 243: next;
! 244: }
! 245: @@ -373,8 +373,8 @@ foreach my $dic (@dics) {
! 246: if (! -f "$UTFDICDIR/$dic->{targetfile}") {
! 247: my @iconv;
! 248: if ($dic->{encoding} ne "UTF-8") {
! 249: - #print "$ICONV -c -f $dic->{encoding} -t UTF-8 $DLDIR/$dic->{sourcefile} -o $DLDIR/$dic->{targetfile}.utf8\n";
! 250: - @iconv = ("$ICONV -c -f $dic->{encoding} -t UTF-8 $DLDIR/$dic->{sourcefile} -o $DLDIR/$dic->{targetfile}.utf8");
! 251: + #print "$ICONV -c -f $dic->{encoding} -t UTF-8 $DLDIR/$dic->{sourcefile} > $DLDIR/$dic->{targetfile}.utf8\n";
! 252: + @iconv = ("$ICONV -c -f $dic->{encoding} -t UTF-8 $DLDIR/$dic->{sourcefile} > $DLDIR/$dic->{targetfile}.utf8");
! 253: if (system(@iconv) != 0) {
! 254: $dic->{status} = "iconv failed";
! 255: next;
CVSweb