Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:mnhauke:games
ja2-stracciatella
ja2-autodetect
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ja2-autodetect of Package ja2-stracciatella
#!/usr/bin/perl -w # by Bernhard M. Wiedemann <bernhard zq1 de> # licensed under GPLv2 or later # # autodetect language of ja2 use strict; my $ini = `cat $ENV{HOME}/.ja2/ja2.ini`; my $bin = "/usr/bin/ja2.bin"; my $lang; if($ini =~ /data_dir *= *(.*)/) { my $dir = $1; my $datadir = "$dir/Data"; if(opendir(my $dirfd, $datadir)) { my @filelist = grep(/\.slf/i, sort(readdir($dirfd))); foreach my $l (qw"dutch english french german italian polish russian russian_gold") { if(grep(/^$l/i, @filelist)) { $lang = $l; } } } } if($lang) { print STDERR "detected language: $lang\n"; unshift(@ARGV, "-resversion", $lang); } else { #print STDERR "no data_dir set or language cannot be detected\n"; } exec($bin, @ARGV);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor