wwine 0.1.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/wwine +50 -14
  2. data/wwine.1 +3 -4
  3. metadata +10 -5
data/wwine CHANGED
@@ -20,7 +20,7 @@ require 'getoptlong'
20
20
  # To read info for --debuginfo
21
21
  require 'open3'
22
22
  # Application version
23
- $version = '0.1.1'
23
+ $version = '0.1.2'
24
24
  # The wine flavour to use
25
25
  $wine = nil
26
26
  # The bottle to use
@@ -66,6 +66,13 @@ def killWine (dryRun = false, signal = 15)
66
66
  end
67
67
  # Go through each line in the 'ps' output
68
68
  wines.each do |line|
69
+ # True if we *require* /proc to be read for this process.
70
+ # This is for cases where, judging by the process name we shouldn't
71
+ # kill that process, but it's close enough to something we could kill
72
+ # that we want to check if /proc can provide a more definitive answer.
73
+ # (helps kill defunct processes)
74
+ requireProc = false
75
+
69
76
  line.chomp!
70
77
  # Ignore the header
71
78
  if line =~ /USER\s*PID/
@@ -83,12 +90,12 @@ def killWine (dryRun = false, signal = 15)
83
90
  next
84
91
  end
85
92
  # Ignore processes that are not wine-related
86
- if name =~ /(wine|windows|[a-z]:\\|\.(exe|dll))/i
93
+ if name =~ /(wine|windows|[A-Za-z]:\\|\.(exe|dll))/i
87
94
  # If wine is not a part of the process name, check if the
88
- # name either includes a \ (which most likely means it is a windows
95
+ # name either includes a *:\ (which most likely means it is a windows
89
96
  # path because it has already matched one of the above) or exe/dll.
90
- if name !~ /wine/i && (name !~ /\// || name !~ /\.(exe|dll)/i)
91
- next
97
+ if name !~ /wine/i && (name !~ /[A-Za-z]:\\/ || name !~ /\.(exe|dll)/i)
98
+ requireProc = true
92
99
  end
93
100
  else
94
101
  next
@@ -106,9 +113,11 @@ def killWine (dryRun = false, signal = 15)
106
113
  elsif File.readable?('/proc/'+pid+'/cmdline')
107
114
  cmdline = IO.read('/proc/'+pid+'/cmdline')
108
115
  cmdline.sub!(/\0.*/,'');
109
- if cmdline !~ /\/[^\/]*wine[^\/]*$/i && cmdline !~ /^[A-Z]:\\[^\\]+\\/
116
+ if cmdline !~ /\/[^\/]*wine[^\/]*$/i && cmdline !~ /^[A-Za-z]:\\[^\\]+\\/
110
117
  next
111
118
  end
119
+ elsif requireProc
120
+ next
112
121
  end
113
122
  # Clean up the name
114
123
  name.sub!(/\s*$/,'')
@@ -309,10 +318,23 @@ end
309
318
  # Purpose: Load wwine data from a wrapper script
310
319
  def loadWwineDataFromFile (file,dryRun = false)
311
320
  begin
321
+ if !File.exists?(file)
322
+ puts file+': does not exist'
323
+ exit(1)
324
+ elsif ! File.readable?(file)
325
+ puts file+': is not readable'
326
+ exit(1)
327
+ end
312
328
  puts 'Loading settings from '+file+':'
313
329
  outFormat = '%-20s: %s'+"\n"
314
330
  source = File.open(file)
315
331
 
332
+ if $wrapperPath
333
+ outMessage = ''
334
+ else
335
+ outMessage = 'Using '
336
+ end
337
+
316
338
  wwineInfo = ''
317
339
  wwineCmd = ''
318
340
 
@@ -352,10 +374,19 @@ def loadWwineDataFromFile (file,dryRun = false)
352
374
  exit(0)
353
375
  end
354
376
 
355
- if info[1] != 'nil'
356
- printf(outFormat,'Switching to directory',info[1])
377
+ if info[1] != 'nil' && !$wrapperCwd
378
+ if $wrapperPath
379
+ switchMessage = '--wrapdir'
380
+ else
381
+ switchMessage = 'Switching to directory'
382
+ end
383
+ printf(outFormat,switchMessage,info[1])
357
384
  if File.exists?(info[1])
358
- Dir.chdir(info[1])
385
+ if $wrapperPath
386
+ $wrapperCwd = info[1]
387
+ else
388
+ Dir.chdir(info[1])
389
+ end
359
390
  else
360
391
  puts info[1]+': does not exist, giving up.'
361
392
  exit(0)
@@ -364,21 +395,26 @@ def loadWwineDataFromFile (file,dryRun = false)
364
395
 
365
396
  if $wine == nil && info[2] != 'nil'
366
397
  $wine = info[2]
367
- printf(outFormat,'Using --wine',$wine)
398
+ printf(outFormat,outMessage+'--wine',$wine)
368
399
  end
369
400
 
370
401
  if $bottle == nil && info[3] != 'nil'
371
402
  $bottle = info[3]
372
- printf(outFormat,'Using --bottle',$bottle)
403
+ printf(outFormat,outMessage+'--bottle',$bottle)
373
404
  end
374
405
 
375
406
  if $cxPath == nil && info[4] != 'nil'
376
407
  $cxPath = info[4]
377
- printf(outFormat,'Using --cxinstalldir',$cxPath)
408
+ printf(outFormat,outMessage+'--cxinstalldir',$cxPath)
378
409
  end
379
410
 
380
411
  if ! dryRun
381
- printf(outFormat,'Will now run',cmd.join(' '))
412
+ if $wrapperPath
413
+ out = 'Program command'
414
+ else
415
+ out = 'Will now run'
416
+ end
417
+ printf(outFormat,out,cmd.join(' '))
382
418
  ARGV.unshift(*cmd)
383
419
  end
384
420
  rescue => ex
@@ -792,7 +828,7 @@ def getCXwithParams (wine,bottle, missingIsFatal = true)
792
828
  # Create the bottle if it does not exist
793
829
  if bottle != nil and ! File.exists?(ENV['HOME']+'/.'+wine+'/'+bottle)
794
830
  puts 'The bottle '+bottle+' did not exist, creating...'
795
- runcmd([ cxdir+'/bin/cxbottle', '--bottle',bottle,'--create'],'system')
831
+ runcmd([ cxdir+'/bin/cxbottle', '--bottle',bottle,'--create','--template','winxp'],'system')
796
832
  if ! File.exists?(ENV['HOME']+'/.'+wine+'/'+bottle)
797
833
  puts 'Bottle creation failed.'
798
834
  exit 1
data/wwine.1 CHANGED
@@ -1,5 +1,5 @@
1
1
  .IX Title "WWINE 1"
2
- .TH WWINE 1 "2010-04-14" "wwine 0.1" ""
2
+ .TH WWINE 1 "2010-07-07" "wwine 0.1.2" ""
3
3
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
4
4
  .\" way too many mistakes in technical documents.
5
5
  .if n .ad l
@@ -92,7 +92,7 @@ were in at the time the wrapper script was created.
92
92
  Load parameters from the wwine wrapper script (as created by \fI\-\-wrap\fR)
93
93
  located at \fI\s-1PATH\s0\fR. wwine will act as though the wrapper script had been
94
94
  run, with one important difference, any additional command-line arguments
95
- supplied to wwine wil override settings from the wrapper script.
95
+ supplied to wwine will override settings from the wrapper script.
96
96
 
97
97
  This can be useful if you have a wrapper script set up to use cxgames,
98
98
  but want to give a one off attempt at using wine. In such a case you could
@@ -113,8 +113,7 @@ directly on the wwine.1 file (and thus work even when 'man wwine'
113
113
  does not).
114
114
  .IP "\fB\-\-debuginfo\fR" 4
115
115
  .IX Item "--debuginfo"
116
- Output information that is useful for bug reports and to provide if you
117
- need support.
116
+ Output information that is useful in bug reports, or when requesting support.
118
117
  .SH "EXAMPLES"
119
118
  .IX Header "EXAMPLES"
120
119
  .IP "\fIwwine file.exe\fR" 4
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wwine
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 31
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 1
9
- - 1
10
- version: 0.1.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eskild Hustvedt
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: .
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-12 00:00:00 +02:00
18
+ date: 2010-08-22 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -32,6 +32,7 @@ files:
32
32
  - README
33
33
  - COPYING
34
34
  - wwine.1
35
+ - ./wwine
35
36
  has_rdoc: true
36
37
  homepage: http://random.zerodogg.org/wwine
37
38
  licenses: []
@@ -42,23 +43,27 @@ rdoc_options: []
42
43
  require_paths:
43
44
  - lib
44
45
  required_ruby_version: !ruby/object:Gem::Requirement
46
+ none: false
45
47
  requirements:
46
48
  - - ">="
47
49
  - !ruby/object:Gem::Version
50
+ hash: 3
48
51
  segments:
49
52
  - 0
50
53
  version: "0"
51
54
  required_rubygems_version: !ruby/object:Gem::Requirement
55
+ none: false
52
56
  requirements:
53
57
  - - ">="
54
58
  - !ruby/object:Gem::Version
59
+ hash: 3
55
60
  segments:
56
61
  - 0
57
62
  version: "0"
58
63
  requirements: []
59
64
 
60
65
  rubyforge_project:
61
- rubygems_version: 1.3.6
66
+ rubygems_version: 1.3.7
62
67
  signing_key:
63
68
  specification_version: 3
64
69
  summary: wwine is a simple wine wrapper.