-
Notifications
You must be signed in to change notification settings - Fork 1
/
check-update
executable file
·4786 lines (4444 loc) · 205 KB
/
check-update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/pkg/bin/perl
use strict;
use Net::DNS; # net/p5-Net-DNS
use Getopt::Std;
use v5.16;
use POSIX qw( SIGKILL );
# global variable
# By some reason, to know master site directory listing is reliable
my($Flag_dont_check_homepage) = 0;
my(%Dont_check_homepage) = (
'ffmpeg', 1,
'ffplay', 1,
);
my($SimpleFallBackYes) = 1; # define constant;
my($SimpleFallBackNo ) = 0; # define constant;
#--------- external command fork-w3m setup ----------
my($W3MTimeout) = 60;
my($fork_w3m);
# perldoc -q path
use File::Spec::Functions qw(rel2abs);
use File::Basename qw(dirname);
my $path = rel2abs( $0 );
our $directory = dirname( $path );
$fork_w3m = $directory.'/fork-w3m';
# ----------------------------------------------------
# prototype for subroutine called very early stage :-)
sub GetSystemURL($);
# For emacs setup, see the bottom of this file (or evaluate them)
my($VERSION);
$VERSION = "2016-05-15 03:38" ; # written by emacs time-stamp
$VERSION .= ' UTC';
# issue before current directory is changed.
my ($SystemURL) = GetSystemURL($VERSION);
my ($MAXSTRINGLEN) = 30; # Max length of string to pick version
# avoid problem on devel/py-ipython-10
my ($MIN_LINES) = 5; # retry threshold less than this lines
my ($SF_SITE) = 'http://sourceforge.net/';
my (%Accept99) = qw (TeXemacs 1); # accept version with 99
# distname has no dot, math/arpack arpack96 math/newmat -> newmat11
my (%NoDot) = qw (
arpack 1
picasm 1
newmat 1
);
# PKGVERSION should include dot, say, avoid picking amavisd-new-20040701 etc
# should automatically detecated from PKGVERSION ?
my (%NeedsDot) = qw (amavisd-new);
my ($NeedsDot) = 0; # activated automatically if PKGVERSION has dot.
our(@ARGV);
# requirement:
# net/curl
# misc/rubygems.
# security/mozilla-rootcert installed and following executed.
# # mozilla-rootcerts install
#use pkgsrc::Dewey;
# dewey_cmp(lhs, op, rhs);
# dewey_match(pattern, package);
my($my_name) = $0;
$my_name =~ s#(.*)/##;
my ($pkgsrc) = '/usr/pkgsrc'; #
my ($summary); # output file name
my (%TODO); # found info in doc/TODO, $TODO{$package} = $version
my ($MaturedList) = 'MaturedList';# File name for the list of matured list category/package name format
my ($line); # SpecialPattern
# output to tmp name and rename it at the end of execution
my ($summary_tmp);
my ($summary_leaf); # only for stats output, not used now
# debugging flags, see ParseDebug
my ($DEBUG_ALTERNATIVE);
my ($DEBUG_CACHE);
my ($DEBUG_CANDIDATE);
my ($DEBUG_COUNT);
my ($DEBUG_CURL);
my ($DEBUG_CURL_CACHE);
my ($DEBUG_CURL_LISTING);
my ($DEBUG_DIGIT);
my ($DEBUG_DISTBASE);
my ($DEBUG_DISTBASE_EXTRACT);
my ($DEBUG_DIVIDE_DEVEL) = 0;
my ($DEBUG_EVAL_PATTERN);
my ($DEBUG_EDITVersion);
my ($DEBUG_FAMILY) = 0;
my ($DEBUG_FALLBACK_SIMPLE) = 0;
my ($DEBUG_FORK) = 0;
my ($DEBUG_FORK_QUIET) = 0;
my ($DEBUG_GITHUB);
my ($DEBUG_GNOME);
my ($DEBUG_HTTP_HEADER);
my ($DEBUG_MASTER_SITES_LISTING);
my ($DEBUG_MASTER_SITE); # $master_site get strange with previous version #
my ($DEBUG_NCAND); # Number of Candidate (summary)
my ($DEBUG_PYPI);
my ($DEBUG_REDIRECT);
my ($DEBUG_RUBYGEM);
my ($DEBUG_SF);
my ($DEBUG_SF_LOOKING_FOR);
my ($DEBUG_SIMPLE_PATTERN);
my ($DEBUG_SITE_HEADER);
my ($DEBUG_SPECIAL_PATTERN);
my ($DEBUG_STATS);
my ($DEBUG_URL);
my ($DEBUG_VER_PATTERN) = 0;
my ($DEBUG_VERSION_DIR);
my ($SINGLE_PACKAGE) = 0;
# Debug letters for command line, See Also ParseDebug
my(%LongName) = (
'A', 'Alternative master site',
'a', 'enable_All',
'c', 'Cache',
'C', 'Curl Command',
'd', 'Distbase Pattern',
'D', 'Master site ends with digit directory',
'e', 'Eval Special Pattern',
'E', 'Edit Version',
'f', 'Classify (find family)',
'F', 'FallBack Simple Pattern',
'g', 'Github',
'G', 'Gnome',
'h', 'HTTP Header',
'H', 'HTTP Header Summary',
'k', 'DISTBASE Extract special to SimplePatternY',
'l', 'Curl Listing',
'm', 'MASTER_SITES_LISTING',
'M', 'MASTER_SITE',
'n', 'CountNumber (not implemented yet)',
'N', 'Number of candidate',
'p', 'Special Pattern',
'P', 'Simple Pattern',
'r', 'RubyGems',
'R', 'Redirect',
's', 'SourceForge',
'S', 'Stats number',
'U', 'URL',
'V', 'Versioned Sub Directory',
'x', 'Curl Cache',
'X', 'Explode candidate',
'y', 'pypi special',
'z', 'Fork',
'Z', 'Fork quit',
);
# Skip the guide saying "Looking for the latest version ?"
my (%SkipLookingForGuide) = qw(
hamlibq 1
upx 1
);
my ($curl_head) = 'curl -k -I --location --insecure';
my ($curl_head_secure) = 'curl -k -I --location --insecure -s';
my ($curl_list) = 'curl -k -l --location --insecure --user-agent FireFox';
my ($curl_list_secure) = 'curl -k -l --location --insecure --user-agent FireFox -s';
# $curl_head = 'w3m -dump_head';
# $curl_head_secure = 'w3m -dump_head';
# $curl_list = 'w3m -dump_source';
# $curl_list_secure = 'w3m -dump_source';
# w3m has a problem on archiver/unalz
## modena@makoto 22:35:59/150120(~)% w3m -dump_head http://www.kipple.pe.kr/win/unalz/
## unable to get local issuer certificate: accept? (y/n)
# stats numbers
my ($Found) = 0;
my ($OK) = 0;
my ($NotFound) = 0;
my ($Forbidden) = 0;
my ($Moved) = 0;
my ($NotListed) = 0;
my ($TODO_LIST) = 0;
my ($DNSProblem) = 0;
my ($Reverse) = 0; # for stats
my ($MetaPackage) = 0;
my ($TotalChecked) = 0;
my ($NotAvailable) = 0;
my ($NoMasterSites) = 0;
my ($NoMasterSitesStats)= 0;
my ($NoHost) = 0; # DNS query failed
my ($SkipTooOld) = 0; # count
my ($StatTEXLIVE) = 0;
#my ($MasterSite404); # by package status
my ($SkippedEndingDigit) = 0; # (Stats): Skip flag: Packagename ending with digit;
my ($SkippedEndingDigitStats) = 0; # (Stats): Skip count: Packagename ending with digit;
my ($StatsMasterSite404) = 0; # for count
my ($PackageStatus) = 0; # (http_code) Each package has only one status, and the collect for stats.
my ($MasterSiteStat); # by package status
my ($HomePageStat); # by package status
my ($StatsHomePageStat) = 0; # for count
#my ($PKGNAME, $PKGVERSION, $MASTER_SITES);
my ($CVSweb) = 'http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/';
my (@SUFIX) = qw(.tar.gz tar.bz2 tar.xz .zip);
# opts, option related variables
my ($option_batch) = 0;
my ($category); # (c) ... global variable
my ($verbose) = 0;
my ($selected) = ''; # (P) Check this package only
my ($DISTNAME);
my ($skip_until_match) = 0; # (s)
my ($starting) = 0;
my ($partial) = 0; # not whole execution, don't write to normal summary file
my ($include_wip) = 0; # whether includes wip(1) or not(0)
my ($update_wip) = 0; # cvs update before execution
my ($include_reverse) = 0; # (r) whether includes confusing entry (default no)
my ($skip_rubygems_check) = 0; # (R) skip time consuming check (default -> always check)
my ($output_leaf) = 'pkgsrc/check-update';
my ($output_URL) = 'http://www.ki.nu/~makoto/';
my ($output_directory) = $ENV{'HOME'}.'/public_html/'. $output_leaf;
my ($update_pkgsrc) = 0; # (u) cvs update prior to execution
my ($full_list) = 0; # (f)
my ($disable_digit_ending_package) = 0; # Change logic and name
my ($MeasureTime) = 0;
my ($FindDepends) = 0;
my (@TimeTopTen);
my ($LimitedList);
my ($merge_mode) = 0;
my ($maintainer) = 0; # output for the maintainer
my ($divide_devel) = ''; # execute divided manner on devel category
my (@CurlCache); # keep the last time listing results;
my (@LOCAL_PORTS);
my ($local_ports_string) = 'netbsd.org/pub/NetBSD/packages/distfiles/LOCAL_PORTS/';
my ($LastCurl); # The curl command when above cache stored
my ($start_time) = time();
our(%opts);
# ----------------------------------------
# N O D E V E L O P M E N T
my (@SkipTooOld)
= qw(xview-lib estic zenicb tex2rtf gkermit kermit gturing bridge-hands ccxstream weewm Cg-compiler p5-File-FlockDir autoconf213);
# ----------------------------------------
# S i m p l e P a t t e r n
# Simple means $distbase-([0-9.]+)-(extran string not necessary)..
my ($SimplePattern); # dynamically set to 1 if @SimplePattern equivalent
my (@SimplePattern) = qw(
webalizer
ddd
cmocka
libsodium
john
Regina-REXX
CRF++
Coin
Event
IO-Socket-Multicast
Math-Pari
Net-IPv4Addr
Net-IPv6Addr
Net-Libdnet
Net-XMPP
SOPE
Text-Diff
WWW-Shorten
aspell
auctex
audacious-plugins
autotrace
bash-doc
cabextract
celt
clamav
clisp
cmph
crack-attack
crimson
dcsharp
db
docbook-xsl
flags
gamin
gens
gmpc
hal
hands
hfsutils
html2wml
inform
iperf
klayout
lame
lftp
lout
lzo
macholib
mercury-srcdist
modulegraph
ntp
ocaml
parchive
pcre++
pen
proj
py2app
renpy
ruby
sign
simulavr
zlib
cflib-CVS
gemlib-CVS
ldg-SVN
mintbin-CVS
mintlib-CVS
pml-CVS
);
# DISTBASE to pattern
my (%SEARCH_STRINGS) = (
'txt2man', '$_ =~ m|$distbase-([0-9.]+).*|; $version = $1;', # no .tar.gz etc suffix
'dotfile', '$_ =~ m| - version ([0-9.]+).*|; $version = $1;', # no .tar.gz etc suffix
);
# Net-Libdnet is listed to avoid not to pick Net-Libdnet6-0.27 -as 6-0.27
#my (@Debian) = qw(signing-party);
my ($SpecialPatternY); # variable to hold by-package pattern
# --- HARDCODE TABLES --- ( to ease accessing tables )
# key is DISTBASE (but please note DISTBASE itself is extracted by this script)
my (%SpecialPattern) = (
'cairo', '$line =~ s/.*$distbase(-5c){0,}-([0-9.]+[0-9]).*/$2/ ;', # games/crimsonfields
'potrace', '$line =~ m|.*$distbase[_-]([0-9.]+)[.-].[a-z].*|; my($rrr) = $1 ;',
# Next line is SimplePattern equivalent
# 'crack-attack', '$line =~ s/.*$distbase-([0-9.]+).*/$1/ ;',
'amavisd', '$line =~ s/.*$distbase-([0-9.]+\.[0-9]+\.[0-9]+)/$1/ ;',
'audacious', '$line =~ s/.*$distbase-([0-9.]+)\.tar\.bz2.*/$1/ ;',
# '$distbase' here doesn't make it
# v
'Cython', '{$line =~ m|.*$distbase-([0-9]\.[0-9]+\.[0-9])|; $line = $1 ;}',
# 'NovaWM', '$line =~ s/.*$distbase-([0-9.]+).*/$1/ ;', # -0.8.1_alpha.tar.bz2 (716.3 kB)
# 'sign', '$line =~ s/The latest version is ([0-9.]+),/$1/ ;', # security/sign 1-bit ui</a><br -->
'lzop', '$line =~ s/.*lzop-([0-9.]+)\..*/$1/;',
'synce', '$line =~ s/.*synce-gvfs-([0-9.]+)\..*/$1/;',
'iozone', '$line =~ s/.*iozone([0-9_.]+)\.tar.*/$1/;',
'CPAN', '$line =~ s/.*CPAN-([0-9_.]+)\.tar.*/$1/;',
'pyproj', '$line =~ s/.*v([0-9_.]+)rel/$1/;',
'picprg', '$line =~ s/.*picprg([0-9.]+)\.tgz/$1/;',
'IPC-Run', '$line =~ s/.*IPC-Run-([0-9.]+)\.tar.gz/$1/;',
'Term-ReadLine-Perl','$line =~ s/.*Term-ReadLine-Perl5-([0-9.]+)\.tar.gz/$1/;',#
'acmesrc', '$line =~ s/.*acme([0-9.]+)src\.tar\.gz.*/$1/;',
'gr-fcdproplus', '$line =~ s/.*gr-fcdproplus_([0-9.]+)\.orig\.tar.*/$1/;',
'apache-ivy-bin', '$line =~ s|.*/([0-9.]+)/.*|$1|;',
'pl', '$line =~ s/.*pl-([0-9.]+)\.tar\..*/$1/;',
'Par', '$line =~ s|.*Par([0-9]+)\.tar.*|$1|;',
'umefont_', '$line =~ s|.*umefont_([0-9]+)\.tar.*|$1|;',
'makeself', '$line =~ s|.*makeself-([0-9.]+)\.run.*|$1|;',
'rar', '$line =~ s|.*rarbsd-([0-9.]+)\.tar.*|$1|;',
'archive', '$line =~ s|.*archive-([0-9.]+)\.tar.*|$1|;',
'SOGo', '$line =~ s|.*SOGo-([0-9]\.[0-9.]+)\.tar.*|$1|;', # not to pick 2007.. version
'electric', '$line =~ s|.*electric-([0-9.]+)\.jar.*|$1|;',
'apache-apollo-unix-distro', '$line =~ s|.*apache-apollo-([0-9.]+)-unix-distro.tar.*|$1|;',
'hping', '$line =~ s|.*hping([0-9.]+)-rc([0-9])\.tar.*|$1.$2|;',
'flodo-v', '$line =~ s|.*flodo-v([0-9.]+)\.tar.*|$1.0|;',
# 'CRF++', '$line =~ s|.*CRF.2B.2B-([0-9.]+)\.tar.*|$1|;', # .%2B.%2B
'FlightCrew-Code', '$line =~ s|.*FlightCrew-([0-9.]+)-Code\..*|$1|;',
'icu4c', '$line =~ s|.*icu4c-src-([0-9._]+).*|$1|;',
# 'Text-Diff', '$line =~ s|.*Text-Diff-([0-9._]+).*|$1|;',
'krb5', '$line =~ s|.*krb5-([0-9.]+[0-9])-(signed)\..*|$1|;',
'perl', '$line =~ s|.*perl-([0-9]+\.[0-9]*[02468]\.[0-9]+)\.tar.*|$1|;',
'Botan', '$line =~ s|.*Botan-([0-9]+\.[0-9]*[02468]\.[0-9]+)\.t.*|$1|;',
'dbus', '$line =~ s|.*dbus-([0-9]+\.[0-9]*[02468]\.[0-9]+)\.tar.*|$1|;',
'cairo', '$line =~ s|.*cairo-([0-9]+\.[0-9]*[02468]\.[0-9]+)\.tar.*|$1|;',
# caff
'signing-party', '$line =~ s|.*signing-party_([0-9.]+)\.orig.*|$1|;',
'gst-plugins-ugly', '$line =~ s|.*gst-plugins-ugly-([0-9]+\.[0-9]*[02468]\.[0-9]+)\.tar.*|$1|;',
'gst-plugins-base', '$line =~ s|.*gst-plugins-base-([0-9]+\.[0-9]*[02468]\.[0-9]+)\.tar.*|$1|;',
'gst-plugins-bad', '$line =~ s|.*gst-plugins-bad-([0-9]+\.[0-9]*[02468]\.[0-9]+)\.tar.*|$1|;',
'gst-plugins-good', '$line =~ s|.*gst-plugins-good-([0-9]+\.[0-9]*[02468]\.[0-9]+)\.tar.*|$1|;',
# avoid to include underscore(_)
'Event-RPC', '$line =~ s|.*Event-RPC-([0-9.]+)([0-9_]*)\.tar.*|$1|;',
# following line doesn't work yet, github ignores this line ?
'liferea', '$line =~ s|.*liferea-([0-9]+\.[0-9]*[02468]\.[0-9]+)\.tar.*|$1|;',
'gnu-crypto-bin', '$line =~ s|.*gnu-crypto-([0-9.]+)-bin\.tar.*|$1|;',
'apache-ant-bin', '$line =~ s|.*apache-ant-([0-9.]+)-bin.*|$1|;',
'shinonome-src', '$line =~ s|.*shinonome-([0-9.]+)-src.*|$1|;',
'IPAfont', '$line =~ s|.*IPAfont([0-9.]+)\.zip.*|$1|;',
'SGMLspm', '$line =~ s|.*SGMLspm-([0-9.iv]+)\..*|$1|;',
'easigit', '$line =~ s|.*([0-9.]+)/eg.*|$1|;',
'Text-Tabs+Wrap', '$line =~ s|.*Text-Tabs.*-([0-9.]+).*|$1|;',
# 'CRF++', '$line =~ s|.*CRF\+\+-([0-9.]+[0-9]).*|$1|;',
'eagle-lin32', '$line =~ s|.*eagle-lin32-([0-9.]+)\.run.*|$1|;',
'bonnie.+', '$line =~ s|.*bonnie\+\+-([0-9.a-z]+)\.tgz.*|$1|;',
#bonnie++-1.03e.tgz
'iozone_430', '$line =~ s|.*iozone([0-9])_([0-9]+).*|$1.$2|;',
'cherokee', '$line =~ s|.*Download Cherokee ([0-9.]+).*|$1|;',
'gsasl', '$line =~ s|.*\bgsasl-([0-9.]+)\.tar.*|$1|;',
'Apache-Gallery', '$line =~ s|.*Apache-Gallery-([0-9.]+)-.*|$1|;',
'bind', '$line =~ s|.*bind-([0-9.Ppl]+).*|$1|;',
'wmii', '$line =~ s|.*wmii-([0-9]\.[0-9]+)\.tar.*|$1|;', # force having period in pattern
'xz', '$line =~ s|.*xz-([0-9]\.[0-9.]+)\.tar.*|$1|;', # force having period in pattern
# 'dact', '$line =~ s|.*dact-([0-9]\.[0-9.]+)\.tar\.gz|$1|;', # force having period in pattern
'multitail', '$line =~ s|.* stable version .*>([0-9.]+)</A.*|$1|;',
'xcdroast', '$line =~ s|.*xcdroast/([0-9.a]+)lpha([0-9]+).*|$1$2|;',
'nut', '$line =~ s|.*NUT ([0-9.]+) released.*|$1|;',
'fldigi', '$line =~ s|.*fldigi-([0-9]+\.[0-9]+\.[0-9]+)\.tar.*|$1|;',
'biblook', '$line =~ s|.*Version ([0-9.]+),.*|$1|;',
# 0.043_01 -> 0.043.01
'Exporter-Tiny', '$line =~ s|.*Exporter-Tiny-([0-9.]+)([_.]*[0-9]*).*|$1$2|;',
'appdata_tools', '$line =~ s|.*appdata_tools_([0-9_]+).*|$1|;',
'fann', '$line =~ s|.*FANN-([0-9.]*)-Source.zip.*|$1|;',
# 'hackrf', '$line =~ s|^([0-9.]*)-.*|$1|;',
# 'mame', '$line =~ s|.*mame([0-9.]*).*|$1|;',
# 'pyobjc-framework-WebKit', '$line =~ s|.*Version ([0-9]\.[0-9.]+).*|$1|;',
'Mako', '$line =~ s|.*<p>Current version is <b>([0-9.]+)</b>|$1|;',
'tnt', '$line =~ s|.*tnt-[0-9]\.[0-9]+)\.tar*|$1|;',
'visualvm_', '$line =~ s|.*visualvm_([0-9]+)-src\..*|$1|;',
# pixmap_0.4-11.tar.gz
# 'pixmap', '$line =~ s|.*pixmap_([0-9._]+)\.tar\..*|$1|; $line =~ s|_||;',
'aalib', '$line =~ s|.*aalib-([0-9._rc]+)\.tar\..*|$1|; $line =~ s|rc|.0.|;',
# not to pick alpha version
'pdns', '$line =~ s|.*pdns-([0-9.]+)\.tar\..*|$1|;',
'upx', '$line =~ s|.*upx-([0-9.]+)-src\.tar\..*|$1|;',
'ragel', '$line =~ s|.*ragel-([0-9]\.[0-9.]+[0-9]+)\.tar\..*|$1|;',
'tk', '$line =~ s|.*tk([0-9]\.[0-9.]+)-src\.tar\..*|$1|;', # don't pick tk866-src.zip
'lha', '$line =~ s|.*lha-([0-9]).([0-9])([0-9])+([a-z]).*|$1$2$3.$4|; $line =~ y|a-i|1-9|;',
'nagi_src', '$line =~ s|.*nagi_src_-_([0-9]+)-([0-9]+)-([0-9]+)\.tar.*|$1$2$3|;',
'mp3asm', '$line =~ s|.*mp3asm-([0-9.-]+)\.tar\..*|$1|; $line =~ s/-/\./;',
'Level', '$line =~ s|.*Level9_([0-9.]+)_Source.*|$1|;',
'psjoin', '$line =~ s|.*\# version ([0-9.]+), .*|$1|;',
'openscad', '$line =~ s|.*openscad-([0-9.-]+)\.src\..*|$1|; $line =~ s/-/p/;',
'liblinear', '$line =~ s|.*Version ([0-9.]+) released.*|$1|;',
'libshorttext', '$line =~ s|.*Version ([0-9.]+) released.*|$1|;',
'libsvm', '$line =~ s|.*Version ([0-9.]+) released.*|$1|;',
'plib', '$line =~ s|The latest stable version of PLIB is ([0-9.]+) .*|$1|;',
'mad_fcl', '$line =~ s|.*MAD-FCL \(v_([0-9.]+)\).*|$1|;',
'sgb', '$line =~ s|.*sgb-([0-9]+)-([0-9]+)-([0-9]+)\.tar\.gz.*|$1$2$3|;',
'libedit', '$line =~ s|.*libedit-([0-9]+)-([0-9.]+)\.tar\.gz.*|$2.$1|;',
'egenix-mx-base', '$line =~ s|.*Version: ([0-9.]+).*|$1|;',
);
# sgb does not work yet
#http://prdownloads.sourceforge.jp/lha/11617/lha-1.14i-ac20040929.tar.gz
## nagi (=_src_-_2002-11-14) (3853 ) Now: 20021114 -> 0.0 Todo:
my(%SourceForgeAlternative) = qw (
acidrip http://sourceforge.net/projects/acidrip/files/acidrip/0.14%20-%20Your%20two-wheeled%20knife/
dirac http://sourceforge.net/projects/dirac/files/dirac-codec/Dirac-1.0.2/
pcmanfm https://sourceforge.net/projects/pcmanfm/files/PCManFM%20%2B%20Libfm%20%28tarball%20release%29/PCManFM/
FreeImage http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
gsoap http://sourceforge.net/projects/gsoap2/files/gSOAP/
OdfConverter http://sourceforge.net/projects/odf-converter/files/ODF%20Add-in%20for%20Office/Release%204.0/
libhtmlobject-perl http://sourceforge.net/projects/htmlobject/files/htmlobject/
tk https://sourceforge.net/projects/tcl/files/Tcl/
plib http://plib.sourceforge.net/download.html
docbook-xsl https://sourceforge.net/projects/docbook/files/docbook-xsl/
PyQt-x11-gpl https://sourceforge.net/projects/pyqt/files/PyQt4/
); #'
# --- HARDCODE TABLES --- ( to ease accessing tables )
# PKGBASE to $DISTBASE association Special (ending digit is main customer)
my(%DISTBASE) = qw (
tidy tidy-html5
editline libedit
imp imp-h3
awhois awhois.sh
mad-flute mad_fcl
gplcver gplcver
rexx-regina Regina-REXX
openscad openscad
nethack-lib nethack
nethack-qt nethack
nethack-tty nethack
nethack-x11 nethack
level9 Level
mp3asm mp3asm
basic256 basic256
nhc98 nhc98src
ntfsprogs ntfs-3g_ntfsprogs
primer3 primer3-src
appdata-tools appdata_tools
p5-OLE-Storage_Lite OLE-Storage_Lite
p5-IPC-Run IPC-Run
p5-App-Prove-Plugin-ProgressBar App-Prove-Plugin-ProgressBar
p5-Term-ReadLine-Perl Term-ReadLine-Perl
p5-GitLab-API-v3 GitLab-API-v3
fixesproto4 fixesproto4
gr-fcdproplus gr-fcdproplus
swi-prolog pl
static-ast-ksh ast-ksh
ast-ksh ast-ksh
p5-Net-IPv4Addr Net-IPv4Addr
p5-Net-IPv6Addr Net-IPv6Addr
p5-Mojo-IOLoop-ForkCall Mojo-IOLoop-ForkCall
nulib2 nulib
rar rar
rox-archive archive
Geomyidae geomyidae
hping hping
hping3 hping3
flodo flodo-v
xdg-utils xdg-utils
icu icu4c
p5-mecab mecab
mit-krb5 krb5
eagle eagle-lin32
bind bind
p7zip p7zip
boa-constructor boa-constructor
caff signing-party
nagi nagi_src
);
my(%DownLoadAlternative) = qw (
egenix-mx-base http://www.egenix.com/products/python/mxBase/mxDateTime/
libprelude https://www.prelude-siem.org/projects/prelude/files
libpreludedb https://www.prelude-siem.org/projects/prelude/files
dcsharp https://code.google.com/archive/p/dcsharp/downloads
dante http://www.inet.no/dante/download.html
moneyguru https://download.hardcoded.net/
yabause https://yabause.org/download/
mad-fcl http://mad.cs.tut.fi/download.html
gallery http://codex.galleryproject.org/Downloads
john http://www.openwall.com/john/
aKode https://www.linux-apps.com/p/1126584/
agg http://www.antigrain.com/download/index.html
Ngraph http://www2e.biglobe.ne.jp/~isizaka/download.htm
openbox http://openbox.org/wiki/Openbox:Download
oroborus http://ftp.debian.org/debian/pool/main/o/oroborus/
3proxy http://3proxy.ru/download/
arp-scan http://www.nta-monitor.com/tools-resources/security-tools/arp-scan
skampi http://liinwww.ira.uka.de/~skampi/download.html
abcMIDI http://ifdo.pugmarks.com/~seymour/runabc/top.html
xmms-crossfade http://www.eisenlohr.org/xmms-crossfade/download.html
ast-ksh http://www2.research.att.com/sw/download/
Event-ExecFlow http://www.exit1.org/download/event-execflow
Event-RPC http://www.exit1.org/download/event-rpc
pyproj https://github.com/jswhit/pyproj/releases/
mercury-srcdist http://dl.mercurylang.org/index.html
LuaJit http://luajit.org/download.html
LuaJit2 http://luajit.org/download.html
basic256 http://sourceforge.net/projects/kidbasic/
nhc98src https://www.haskell.org/nhc98/download.html
connect https://bitbucket.org/gotoh/connect/downloads
pcre++ http://www.daemon.de/PcreDownload
boolean http://boolean.klaasholwerda.nl/download/download.html
dinotrace http://www.veripool.org/projects/dinotrace/wiki/Installing
qcad http://www.qcad.org/archives/qcad/
frozen-bubble http://www.frozen-bubble.org/downloads/
gmfsk http://gmfsk.connect.fi/download.html
dpbox http://home.snafu.de/wahlm/dl8hbs/download.html
lzma http://www.7-zip.org/sdk.html
makeself http://www.megastep.org/makeself/
nulib2 http://nulib.com/downloads/index.htm
rar http://www.rarlabs.com/download.htm
archive http://rox.sourceforge.net/2005/interfaces/Archive
CGI-SpeedyCGI http://daemoninc.com/SpeedyCGI/download.html
djbdns http://cr.yp.to/djbdns/install.html
geomyidae http://git.r-36.net/geomyidae/
apache-apollo-unix-distro
http://activemq.apache.org/apollo/download.html
BitTornado http://www.bittornado.com/download.html
hping http://www.hping.org/download.html
iana-etc http://sethwklein.net/iana-etc
lftp http://lftp.yar.ru/get.html
libdmapsharing https://git.gnome.org/browse/libdmapsharing
libdnet http://code.google.com/p/libdnet/downloads/list
FlightCrew http://code.google.com/p/flightcrew/downloads/list
highlight http://www.andre-simon.de/zip/download.php
krb5 http://web.mit.edu/kerberos/dist
IPAfont http://ipafont.ipa.go.jp/ipafont/download.html
xscreensaver http://www.jwz.org/xscreensaver/download.html
distcc http://code.google.com/p/distcc/downloads/list
cabocha https://drive.google.com/folderview?id=0B4y35FiV1wh7cGRCUUJHVTNJRnM&usp=sharing#list
GutenMark http://www.sandroid.org/GutenMark/download.html
dbus-sharp https://github.com/mono/dbus-sharp/downloads
dbus-sharp-glib https://github.com/mono/dbus-sharp/downloads
eagle-lin32 http://www.cadsoft.de/download-eagle/
libol https://my.balabit.com/downloads/libol/0.3
WordNet http://wordnet.princeton.edu/wordnet/download/current-version/
aspell5-ga http://borel.slu.edu/~kps/ispell/sios.html
agg http://www.antigrain.com/https://bitbucket.org/izi/polib/downloadsdownload/index.html
mechanize http://wwwsearch.sourceforge.net/mechanize/download.html
klayout http://www.klayout.de/build.html
ming https://sourceforge.net/projects/ming/files/Releases/
fann http://leenissen.dk/fann/wp/download/
Mako http://www.makotemplates.org/download.html
macholib https://bitbucket.org/ronaldoussoren/macholib/downloads#tag
modulegraph https://bitbucket.org/ronaldoussoren/modulegraph/downloads#tag
py2app https://bitbucket.org/ronaldoussoren/py2app/downloads#tag
polib https://bitbucket.org/izi/polib/downloads
db http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index-082944.html
txt2man http://mvertes.free.fr/txt2man/Changelog
dotfile http://www.blackie.dk/dotfile/index.html
clamav http://www.clamav.net/downloads
libssh https://red.libssh.org/projects/libssh/files
Renaissance http://www.gnustep.it/Renaissance/Download.html
pingus http://pingus.seul.org/download.html
poppler https://poppler.freedesktop.org/releases.html
psjoin http://t-sato.in.coocan.jp/tools/psjoin
); ##
# dact http://www.rkeene.org/devel/dact/
# for print/xpdf-arabic etc
my (%MonthToDigit) = qw (
-jan- 01 -apr- 04 -jul- 07 -oct- 10
-feb- 02 -may- 05 -aug- 08 -nov- 11
-mar- 03 -jun- 06 -sep- 09 -dec- 12
);
# arp-scan is the same as HOMEPAGE (strange)
# Now global variables in Makefile
my ($MAINTAINER, $HOMEPAGE, $GEM_PACKAGE, $PEAR_PACKAGE, $HS_PACKAGE,
$R_Package, $SFProject, $TEXLIVE, $EGG_PACKAGE) ;
my ($PKGBASE, $PKGNAME, $DISTBASE, $MASTER_SITE, $META_PACKAGE);
my (@MASTER_SITES);
my ($available, $http_code);
my ($URL); # global variable
my ($output_record); # string to output HTML
my ($PKGVERSION);
my ($max_version);
my ($returnCode, @candidate);
# -------- S U B R O U T I N E S -------
sub warnTimeout($$$$){
my ($pid) = shift;
my ($TIMEOUT) = shift;
# just for information
my ($url) = shift;
my ($caller) = shift;
my $timeout = 0;
eval {
local $SIG{ALRM} = sub { $timeout = 1; alarm 0;};
alarm($TIMEOUT);
while(!$timeout) {
last if waitpid($pid, POSIX::WNOHANG);
sleep(1); } };
if ($@) {warn "Error:".$@;}
if ($timeout) {
kill(SIGKILL, $pid);
warn " ***** TIMEOUT : $caller : $url";
}
alarm 0;
}
# eval SpecialPattern, only called once
sub SpecialPattern($$){
my($distbase) = shift;
my($line) = shift;
print STDERR sprintf("%4d ", __LINE__ ), ' ', $line, ' --> Pattern --> ', $SpecialPattern{$distbase}, "\n" if $DEBUG_EVAL_PATTERN ;
eval $SpecialPattern{$distbase} ;
print STDERR sprintf("%4d ", __LINE__ ), ' === >', ' (', $line,")\n" if $DEBUG_EVAL_PATTERN ;
# not to return garbage
if ( !($line =~ m|^[0-9._-]+$| ) ){ $line = '';}
$line =~ y|_|.|;
print STDERR sprintf("%4d ", __LINE__ ), ' === >', ' (', $line,")\n" if $DEBUG_EVAL_PATTERN ;
return $line;
}
my (@CANDIDATE); # collecting candidate of the version
my (%DISTBASE_CACHE); # push(@DISTBASE_CACHE, \[$distbase, $version, $timestamp, $refcount]);
my (@DontSkipEndingDigit) = qw (eric4 fltk2);
# 100 -> 1.0.0 type
my (@THREE) = qw(gtkglarea falcons-eye quakedata abcde binkd bwwtex cryptopp dirb sr-examples pscpug DatLib DatUtil ROMbuild xzip libdsk libgeotiff ploticus-examples shapelib proj vs mlvwm lwm biew proxytunnel visualvm_);
# vs <- lang/sr-exaples
my(@THREECDHIT) = qw (cdhit) ;
# 179w2 -> 1.7.9
#my (@THREEW) = qw(john); see ThreeSingle
# 300 -> 3.0 unzip
# 600 -> 6.0 zip
my (@ZIP) = qw (zip unzip fMSX);
# qkcc100 -> qkc-1.0
my (@qkcc) = qw (qkcc);
my (@Arabian) = qw(SGMLSpm);
# 100 -> 1.00 type
my (@VER32) = qw(
gigbase gku bunzip wxRemind qkc atasm bicom bww2tex cgic
PDF par jpilot-syncmail asterisk-perl pyserial datlib dutil
mdiff rbuild rinfo zident adodb lzma lzop upx piewm sawfish
wmctrl wmakerconf mesch gigabase plnode uno Par sgrep acmesrc netio
mame telepathy-mission-control quake tscp
);
# 31 -> 3.1 # 3370 -> 3.370 devel/cfitsio
my (@VER22) = qw(doc2html cfitsio lcc ctags elisau html gbdfed);
# Device-Gsm Device-Modem Device-SerialPort
# 0.46 -> 0.4.6, 1.38 -> 1.3.8
my (@DOT2) = qw(HTTP-Lite XML-Elemental yencode xworm gambatte_src Class-Std icecastq clex TiffIO
TakaoExFonts_ TakaoFonts_ XML-Catalog Linux-Inotify2
pixmap
gnuchess
visualvm
pscpug
mlvwm
);
# 004 -> 0.4
my (@DOT20) = qw (rc5-mlg);
# 1.1103 -> 1.11.03
# IO-CaptureOutput
# p5-sybperl 2.16 -> 2.171 2.18
# dot is inserted after 3rd digit
my (@DOT3) = qw (
BSD-Resource
CatalystX-CRUD-Model-RDBO
Data-AMF
DateTime-Calendar-Mayan
ExtUtils-ModuleMaker
File-Temp
FreezeThaw
IO-CaptureOutput
Module-CPANTS-Analyse
Net-DHCP
Role-Basic
SQL-Abstract-Limit
SWF-File
Template-Plugin-DateTime
Time-Local
XML-Clean
gdal-lib
sybperl
util-linux
xsane
flow-tools
Mojo-IOLoop-ForkCall
Test-File
Test-Output
MooseX-App
Text-Diff-Parser
Log-Any
Text-Autoformat
File-HomeDir
);
# 633 -> 6.33.0 InsertDot
# util-linux <- (libuuid)
# devel/p5-ExtUtils-CBuilder) 0.280220 --> 0.28.02.20
my (@DOT32) = qw (ExtUtils-CBuilder);
# ham/dpbox 60000 -> 6.00.00
my (@DOT13) = qw (dpbox);
# audio/hydrogen hydrogen 0.9.6.1 -> 0.9.61
my (@DOT1111) = qw (hydrogen);
# 0.004007 -> 0.004.007 devel/p5-Contextual-Return
my (@DOT4) = qw (
Class-Inner Contextual-Return Data-Section
Return-Value Software-License Test-MinimumVersion
PPIx-Utilities Return-Value Mixin-ExtraFields MooX-Cmd hydrogen
Pod-Eventual
Dancer-Plugin-Auth-RBAC
);
# 2.01080900 -> 2.010809.00
my (@DOT7) = qw(Math-Pari);
# 20131217 -> 2013.12.17
my (@DELDOT422) = qw (sqtop ast-ksh);
# 2.1.3 -> 2.13
my (@DELETEDOT) = qw (nkf libssh zidrav4unix);
# devel/p5-OOTools p5-OOTools 2.30 <- 2.3
my (@ADDZERO) = qw(XML-AutoWriter Nmap-Parser xmahjongg Hash-Case Module-Starter OOTools Convert-UUlib JSON-XS IO-Util Module-Build Catalyst-Plugin-Authentication Curses-UI-POE);
my (@ADDZERO2) = qw(Convert-BER Spreadsheet-ParseExcel Test-Reporter Curses-UI-POE DateTime DateTime-Format-Builder DateTime-Format-Strptime CGI-FormBuilder DBIx-Abstract CPAN Devel-Symdump Test-Differences );
# 1.001000 -> 1.0010 Class-C3-Componentised);
my (@DELETE02) = qw(Class-C3-Componentised);
# 325 -> 3.2.5
my (@ThreeSingle) = qw(nulib nethack);
# 1.001002 -> 1.1.2
my (@DOT133) = qw (DBIx-Class-Cursor-Cached IO-Pipeline Smart-Comments Parse-RecDescent);
# gdal-lib-1111 -> 1.11.1
my (@DOT121) = qw (gdal FreeImage);
# 0.997003 -> 0.99.7.003
my (@DOT845);# = qw (IO-Prompt);
# devel/p5-Devel-FindRef p5-Devel-FindRef 1.422 -> 1.44
my(@LeftJustify1_3) = qw(Devel-FindRef DateTime-Format-Mail Class-MakeMethods enum);
# time/p5-DateTime-Format-Mail 0.402 -> 0.4020
my(@LeftJustify1_4) = qw(DateTime-Format-Mail);
# 0.603 -> 0.6.3 VerSprintf($version, 0,1, '', 2,1, '', 3,2 )
my (@NetINET6Glue) = qw (Net-INET6Glue);
# 1.000031 -> 1.0.31 VerSprintf($version, 0, 1, '', 2,3, '', 5,3 )
my (@TextMarkdown) = qw (Text-Markdown );
# 4.3.30 -> 4.3.030 VerSprintf($version, 0, 1, '', 2,3,'0', 5,3 )
my (@bash) = qw (bash);
# 003_009_003 -> 3.9.3
my (@uhd) = qw (uhd);
# 0.002005 -> 0.2.5 www/p5-Reaction p5-Reaction
my (@SPRINTF) = qw (Reaction);
# devel/p5-enum 1.016 -> 1.016, 1.10 -> 1.100
my (@V1000) = qw (enum);
# p5-HTTP-Request-Form (HTTP-Request-Form) (1513 ) Now: 0.9.5.2 -> 0.952 Todo:
my (@SingleDigit) = qw(HTTP-Request-Form);
# archivers/hpack 79 -> 0.79
my (@ZeroDot) = qw (hpack umefont_);
# hyperestraier Add 1.0.0
my (@hyperestraier) = qw (hyperestraier);
# converters/bib2xml 10162002 -> 20021016
my (@swap4) = qw (bib2xml);
# Term-ReadLine-Perl5
my (@DIGIT_IN_NAME) = qw(cal3d emacs-w3m x2x w3m nec2c xnec2c asn1c py34-unittest2py3k p5-GD-Graph3d popa3d tex-algorithm2e sqlalchemy-i18n hdf5-c++ );
#
#y (@DISTBASE_DIGIT) = qw(perl5 hdf5 libosip2 xfwm4 Catalyst-View-Mason2);
# 8089 -> 0.8089
my (@xtimer) = qw(xtimer);
# 1.61.0 -> 1.61
#y (@euler) = qw(euler);
my (@RmLeadingZero) = qw (remind);
## -------------------------
## P R O T O T Y P E S
## -------------------------
sub Usage($$);
sub CheckHeader($);
sub CheckDNS($);
sub ColorUrlDigit($);
sub CompareVersion($$);
sub CountPeriod($);
sub DistbaseCacheUpdate($$$);
sub DistbaseCacheQuery($$);
sub GetDistBase($$$$$);
sub GetMasterSiteCandidate($$$);
sub GetMasterSiteSub($$$$);
sub GetVariableValue($$$);
sub GetTODOinfo($$);
sub GetWipInfo($);
sub GreyDigitIf00($$);
sub Http301core($$);
sub ParseDirectory($$$$$$);
sub PrintHeader($);
sub ReadMakefile($$);
sub ReadTodo($);
sub RecordMaxElapsed($);
sub Stats($$);
sub StripLeaf($);
## -------------------------
## S U B R O U T I N E S
## -------------------------
sub Usage($$) {
my($summary) = shift;
my($output_directory) = shift;
$summary =~ s,$output_directory/,,;
my($home) = $ENV{'HOME'};
$output_directory =~ s,$home/,~/,;
print <<HELP;
Check the version is current
Synopsis:
check-update [-D] [-f] [-h] [-i] [-r] [-R] [-t] [-u] [-v] [-V] [-w] [-W]
[ -c category]
[ -d directory-to-output ]
[ -p pkgsrc-directory ]
[ -P package-only ]
[ -s pattern-to-start]
[ -S summary-output]
[ -T limited-list-name ]
[ -x debug_items ]
[ -y [123]]
Where:
-c : category (implies -f)
-d : output directory (default $output_directory)
-D : Skip ending digit package (default: don't skip) #'
-f : (full) output Recent-version-unavailable too.
(default: output that part to different file)
-h : (help) show this message (putting after options may show default value)
-i : inform to update info (maintainer, or id\@domain, not implemented yet)
-P : check particular package
-p : pkgsrc directory (default /usr/pkgsrc)
-r : Include Reverse results in listing
-R : Skip RubyGems check (in case you are sure you have)
-s : skip until match
-S : summary output file (default $summary)
-t : Measure time (not implemented yet)
-T : Accepts Limited List filenamel (not implemented yet)
-u : cvs update before checking the category
-v : verbose
-V : show version
-w : include wip (not implemented yet)
-W : Check the version in wip (not implemented yet)
-x : activate DEBUG_ITEMS (examples: -x dh, -x a, etc.) see below for letters
HELP
# use v5.16 is for this fc (see perldoc -f fc)
foreach my $L (sort {fc($a) cmp fc($b)} keys %LongName) {
printf " %s %s\n", $L, $LongName{$L};
}
print <<HELP2;
-y : Select one of split devel category out of 1, 2 or 3 where:
1: for '[A-Za-o]*'
2: for 'p*'
3: for [q-z]*
HELP2
}; #'
# a: Enable all
# d: distbase
# e: eval Special pattern
# E: Edit Version (EditVersion)
# f: debug classify (found family)
# h: http header
# c: cache (URL and distbase combination to version)
# C: curl command
# l: curl listing
# n: count (not implemented yet)
# p: SpecialPattern debug
# s: sourceforge
# S: stats number
# r: rubygems
sub CheckRubyGems($){
my($skip_rubygems_check ) = shift;
# Check if required packages are installed
# httping curl git-base p5-Net-DNS *rubygems mozilla-rootcerts
my($gems_name);
my($gems_package);
my($no_rubygems) = 1;
# -------------- looking for old rubygems or just gem ------------------
open(PKG_INFO, "pkg_info|") || print STDERR sprintf("%4d ", __LINE__), "Failed for pkg_info\n";
while(<PKG_INFO>) {
if (/^(.*rubygems-.*[0-9.]+)/ ) { $gems_package = $1; $no_rubygems = 0; last;}
if (/^ruby22-[a-z]*/ ) { $gems_name = 'gem22'; $no_rubygems = 0; last;} # hard code for ruby2.*
if (/^ruby23-[a-z]*/ ) { $gems_name = 'gem23'; $no_rubygems = 0; last;} # hard code for ruby2.*
if (/^ruby2[0-9]*-[a-z]*/ ) { $gems_name = 'gem'; $no_rubygems = 0; last;} # hard code for ruby2.*
}
close(PKG_INFO);
if ($no_rubygems) { die sprintf("%4d <", __LINE__), (caller 0)[3], "> *** Please install misc/rubygems or lang/ruby2*\n";}
print STDERR sprintf("%4d <", __LINE__), (caller 0)[3], '> gems_package ', $gems_package,'gems_name: ', $gems_name, "\n"
if $DEBUG_RUBYGEM;
if ($gems_name eq '') {
open(PKG_INFO, "pkg_info -qL $gems_package |");
while(<PKG_INFO>) {
if (m|.*/bin.*|) {
$gems_name = $_; }}
close(PKG_INFO);
}
# --------------------------------------------------------------------------
if ($gems_name eq '') { die;} else {print "gems_name: ", $gems_name,"\n" if $DEBUG_RUBYGEM;}
chomp($gems_name);
if($skip_rubygems_check ) { return $gems_name ; }
# --------------------
## rubygems
# --------------------
open (GEMS, "$gems_name list -r -q libarchive|");
my(@result) = <GEMS>;
close(GEMS);
if ( $#result < 5 ) {
print STDERR sprintf("%4d <", __LINE__), (caller 0)[3],
"> *** rubygems won't pull remote info.\n",
" Network Problem ? or please install security/mozilla-rootcerts OR p5-Mozilla-CA.\n",
" Following command is supposed to return serveral lines. Try it on your shell\n",
" $gems_name list -r -q libarchive\n";
exit;}
print STDERR sprintf("%4d <", __LINE__), (caller 0)[3], '> gems name is :', $gems_name,"\n" if $DEBUG_RUBYGEM;
return $gems_name;
}
sub CheckEnvironment(){
# --------------------
# Other packages
# --------------------
my($bad_news) = 0;
foreach my $pkg (qw(curl git-base p5-Net-DNS )) {
if ( open(PKG_INFO, "pkg_info -q -c $pkg|") == 0 ) { $bad_news++;}