portvcs 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -18,7 +18,7 @@ At the time of writing FreeBSD uses CVS (jeez) for its ports collection,
18
18
  so portvcs (with default configuration) connects to well-known French
19
19
  CVS server via TCP port 2401 and reads the logs of a particular port.
20
20
  By default the utility constrains the history to 1 year but that's easy
21
- changeable via +-d+ CL (command line) option.
21
+ changeable via <tt>-d</tt> CL (command line) option.
22
22
 
23
23
  portvcs isn't restricted to FreeBSD ports--it can read logs from
24
24
  (probably) any CVS server but in that case its usefulness is very
@@ -33,13 +33,13 @@ The options are as follows:
33
33
  configuration file. The first found wins.
34
34
 
35
35
  --config NAME:: The name of the configuration file. If
36
- it contains +/+ in it, the list from
37
- <tt>\--config-dirs</tt> is ignored.
36
+ it contains <tt>/</tt> in it, the list from
37
+ <tt>--config-dirs</tt> is ignored.
38
38
 
39
39
  -d EXP:: Passes the EXP to VCS server to set limits
40
40
  for the logs. Usually it's something like
41
41
  '2 months ago<'. For all possible values,
42
- read the help for the option +-d+ in cvs
42
+ read the help for the option <tt>-d</tt> in cvs
43
43
  help for its log command, e.g, type:
44
44
 
45
45
  % info -n '(cvs)log options'
@@ -58,8 +58,9 @@ The options are as follows:
58
58
 
59
59
  --ports-tree DIR:: A directory that follows CVSROOT and serves
60
60
  as a ports tree. For example, CVSROOT can
61
- be +/home/ncvs+ and the ports directory can
62
- be +ports+ or may be empty at all.
61
+ be <tt>/home/ncvs</tt> and the ports
62
+ directory can be <tt>ports</tt> or may be
63
+ empty at all.
63
64
 
64
65
  --vcs-version:: Just get version of a remote VCS server and
65
66
  exit.
@@ -70,7 +71,8 @@ The options are as follows:
70
71
  -V:: Show portvcs version and exit.
71
72
 
72
73
  -v:: Be more verbose. You can supply it several
73
- times, viz. +-vv+ dumps even more debug info.
74
+ times, viz. <tt>-vv</tt> dumps even more
75
+ debug info.
74
76
 
75
77
  ==Configuration
76
78
 
@@ -79,9 +81,9 @@ portvcs looks for its configuration at 3 places at start up.
79
81
  1. At <tt>PORTVCS_CONF</tt> env variable. (Its format is exactly similar
80
82
  to CL options.)
81
83
 
82
- 2. At configuration file. Its default name is <tt>portvcs.yaml</tt> and
83
- it can be stored in several system directories which are observable
84
- by <tt>--config--dirs</tt> CL option.
84
+ 2. At the configuration file. Its default name is <tt>portvcs.yaml</tt>
85
+ and it can be stored in several system directories which are
86
+ observable by <tt>--config--dirs</tt> CL option.
85
87
 
86
88
  3. At command line.
87
89
 
@@ -91,6 +93,12 @@ The configuration file must be in YAML format. Look into <tt>`gem env
91
93
  gemdir`/gems/portvcs-x.y.z/etc/</tt> directory for samples.
92
94
 
93
95
 
96
+ ==Environment
97
+
98
+ PAGER:: Output from the VCS server goes here.
99
+
100
+ PORTVCS_CONF:: See Configuration.
101
+
94
102
  ==Examples
95
103
 
96
104
  % portvcs www/firefox
data/bin/portvcs CHANGED
@@ -44,6 +44,10 @@ def errx(ec, t)
44
44
  exit ec if ec > 0
45
45
  end
46
46
 
47
+ def warnx(t)
48
+ STDERR.puts File.basename($0) + ' warning: ' + t.to_s
49
+ end
50
+
47
51
  def cl_parse(myargs, times = 1)
48
52
  o = OptionParser.new()
49
53
  o.banner = $conf[:banner]
@@ -133,6 +137,7 @@ end
133
137
 
134
138
  # 4. connect to remote VCS
135
139
  v = VCS.new($conf[:vcs])
140
+ out = STDOUT
136
141
  begin
137
142
  v.open(debug: ($conf[:verbose] >= 2 ? true : false), host: $conf[:host], cvsroot: $conf[:cvsroot],
138
143
  port: $conf[:port], user: $conf[:user], pass: $conf[:pass],
@@ -147,18 +152,27 @@ begin
147
152
  end
148
153
  p[1] = 'Makefile' if !p[1]
149
154
 
155
+ try2retry = true
150
156
  out = pager_setup() || STDOUT # get output stream
151
157
  vp.log(p[0], p[1], $conf[:date_cond]) {|i|
152
158
  begin
153
159
  out.puts i
154
- rescue Errno::EPIPE
160
+ rescue Errno::EPIPE # problem with pager
161
+ out.close unless out == STDOUT
155
162
  out = STDOUT
156
- retry
163
+ if try2retry
164
+ try2retry = false
165
+ warnx('cannot popen with pager, retrying with stdout')
166
+ retry
167
+ else
168
+ raise
169
+ end
157
170
  end
158
171
  }
159
- out.close unless out == STDOUT
160
172
  end
161
173
  }
162
174
  rescue
163
175
  errx(1, $!)
176
+ ensure
177
+ out.close unless out == STDOUT
164
178
  end
data/doc/NEWS ADDED
@@ -0,0 +1,3 @@
1
+ === 0.0.2
2
+
3
+ - Fixed a bug with PAGER env.
data/doc/README.rdoc CHANGED
@@ -18,7 +18,7 @@ At the time of writing FreeBSD uses CVS (jeez) for its ports collection,
18
18
  so portvcs (with default configuration) connects to well-known French
19
19
  CVS server via TCP port 2401 and reads the logs of a particular port.
20
20
  By default the utility constrains the history to 1 year but that's easy
21
- changeable via +-d+ CL (command line) option.
21
+ changeable via <tt>-d</tt> CL (command line) option.
22
22
 
23
23
  portvcs isn't restricted to FreeBSD ports--it can read logs from
24
24
  (probably) any CVS server but in that case its usefulness is very
@@ -33,13 +33,13 @@ The options are as follows:
33
33
  configuration file. The first found wins.
34
34
 
35
35
  --config NAME:: The name of the configuration file. If
36
- it contains +/+ in it, the list from
37
- <tt>\--config-dirs</tt> is ignored.
36
+ it contains <tt>/</tt> in it, the list from
37
+ <tt>--config-dirs</tt> is ignored.
38
38
 
39
39
  -d EXP:: Passes the EXP to VCS server to set limits
40
40
  for the logs. Usually it's something like
41
41
  '2 months ago<'. For all possible values,
42
- read the help for the option +-d+ in cvs
42
+ read the help for the option <tt>-d</tt> in cvs
43
43
  help for its log command, e.g, type:
44
44
 
45
45
  % info -n '(cvs)log options'
@@ -58,8 +58,9 @@ The options are as follows:
58
58
 
59
59
  --ports-tree DIR:: A directory that follows CVSROOT and serves
60
60
  as a ports tree. For example, CVSROOT can
61
- be +/home/ncvs+ and the ports directory can
62
- be +ports+ or may be empty at all.
61
+ be <tt>/home/ncvs</tt> and the ports
62
+ directory can be <tt>ports</tt> or may be
63
+ empty at all.
63
64
 
64
65
  --vcs-version:: Just get version of a remote VCS server and
65
66
  exit.
@@ -70,7 +71,8 @@ The options are as follows:
70
71
  -V:: Show portvcs version and exit.
71
72
 
72
73
  -v:: Be more verbose. You can supply it several
73
- times, viz. +-vv+ dumps even more debug info.
74
+ times, viz. <tt>-vv</tt> dumps even more
75
+ debug info.
74
76
 
75
77
  ==Configuration
76
78
 
@@ -79,9 +81,9 @@ portvcs looks for its configuration at 3 places at start up.
79
81
  1. At <tt>PORTVCS_CONF</tt> env variable. (Its format is exactly similar
80
82
  to CL options.)
81
83
 
82
- 2. At configuration file. Its default name is <tt>portvcs.yaml</tt> and
83
- it can be stored in several system directories which are observable
84
- by <tt>--config--dirs</tt> CL option.
84
+ 2. At the configuration file. Its default name is <tt>portvcs.yaml</tt>
85
+ and it can be stored in several system directories which are
86
+ observable by <tt>--config--dirs</tt> CL option.
85
87
 
86
88
  3. At command line.
87
89
 
@@ -91,6 +93,12 @@ The configuration file must be in YAML format. Look into <tt>`gem env
91
93
  gemdir`/gems/portvcs-x.y.z/etc/</tt> directory for samples.
92
94
 
93
95
 
96
+ ==Environment
97
+
98
+ PAGER:: Output from the VCS server goes here.
99
+
100
+ PORTVCS_CONF:: See Configuration.
101
+
94
102
  ==Examples
95
103
 
96
104
  % portvcs www/firefox
data/lib/portvcs/meta.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module PortVCS
2
2
  module Meta
3
3
  NAME = 'portvcs'
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
6
6
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alexander Gromnitsky
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-13 00:00:00 +02:00
17
+ date: 2010-12-15 00:00:00 +02:00
18
18
  default_executable: portvcs
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -42,6 +42,7 @@ extra_rdoc_files:
42
42
  - doc/TODO
43
43
  - doc/README.rdoc
44
44
  - doc/LICENSE
45
+ - doc/NEWS
45
46
  files:
46
47
  - lib/portvcs/portvcs.rb
47
48
  - lib/portvcs/utils.rb
@@ -50,6 +51,7 @@ files:
50
51
  - doc/TODO
51
52
  - doc/README.rdoc
52
53
  - doc/LICENSE
54
+ - doc/NEWS
53
55
  - etc/portvcs.yaml
54
56
  - etc/fr.FreeBSD.org.yaml
55
57
  - README.rdoc