blob: c553f58d6ef05d7f3b3c65c5c642ec2c896d1e11 (
plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
|
#! /usr/bin/env bash
# -v Run verbose. By default, this script runs bpkg quiet and suppresses
# error messages in the fail tests. Note that when this options is
# specified, bpkg is called with default verbosity level. If you want
# more bpkg diagnostics, add the --verbose N option.
#
trap 'exit 1' ERR
function error ()
{
echo "$*" 1>&2
exit 1
}
bpkg="../bpkg/bpkg"
#bpkg="valgrind -q ../bpkg/bpkg"
#bpkg="../bpkg/bpkg --fetch curl"
#bpkg="../bpkg/bpkg --fetch fetch --tar bsdtar"
cfg=/tmp/conf
pkg=libhello
ver=1.0.0
pkga=../../hello/dist/$pkg-$ver.tar.bz2
pkgd=../../hello/dist/$pkg-$ver
out=$cfg/`basename $pkgd`
rep=../../hello/1/hello
abs_rep=`pwd`/repository/1
verbose=n
options=
while [ $# -gt 0 ]; do
case $1 in
-v)
verbose=y
shift
;;
*)
options="$options $1"
shift
;;
esac
done
if [ "$verbose" != "y" ]; then
options="$options -q"
fi
bpkg="$bpkg $options"
#
#
function test ()
{
local cmd=$1; shift
local ops=
if [ "$cmd" != "rep-create" -a "$cmd" != "rep-info" ]; then
ops="-d $cfg"
fi
if [ -t 0 ]; then
$bpkg $cmd $ops $*
else
# There is no way to get the exit code in process substitution
# so ruin the output.
#
diff -u - <($bpkg $cmd $ops $* || echo "<invalid output>")
fi
if [ $? -ne 0 ]; then
error "failed: $bpkg $cmd $ops $*"
fi
}
function fail ()
{
local cmd=$1; shift
local ops=
if [ "$cmd" != "rep-create" -a "$cmd" != "rep-info" ]; then
ops="-d $cfg"
fi
if [ "$verbose" = "y" ]; then
$bpkg $cmd $ops $*
else
$bpkg $cmd $ops $* 2>/dev/null
fi
if [ $? -eq 0 ]; then
error "succeeded: $bpkg $cmd $ops $*"
fi
return 0
}
# Verify package status.
#
function stat ()
{
local c="$bpkg pkg-status -d $cfg"
if [ $# -eq 1 ]; then
c="$c $pkg/$ver"
elif [ $# -eq 2 ]; then
c="$c $1"; shift
fi
local s=`$c`
if [ "$s" != "$1" ]; then
error "status: '"$s"', expected: '"$1"'"
fi
}
# Verify path is gone (no longer exists)
#
function gone ()
{
if [ -e "$1" ]; then
error "path $1 still exists"
fi
}
##
## rep-create
##
fail rep-create # no 'repositories' file
test rep-create repository/1/misc/stable
test rep-create repository/1/misc/testing
test rep-create repository/1/math/stable
test rep-create repository/1/math/testing
test rep-create repository/1/math/unstable
##
## rep-info
##
fail rep-info # repository location expected
test rep-info repository/1/misc/testing <<EOF
misc/testing $abs_rep/misc/testing
complement misc/stable $abs_rep/misc/stable
libhello 1.0.0-1
EOF
test rep-info -m repository/1/math/unstable <<EOF
math/unstable $abs_rep/math/unstable
: 1
location: ../../misc/testing
:
location: ../testing
role: complement
:
EOF
test rep-info http://pkg.cppget.org/1/hello <<EOF
cppget.org/hello http://pkg.cppget.org/1/hello
libheavy 1.0.0
libhello 1.0.0
EOF
##
## cfg-create
##
test cfg-create --wipe config.cxx=g++-4.9 cxx config.install.root=/tmp/install
stat unknown
##
## rep-add
##
test cfg-create --wipe
fail rep-add # repository location expected
fail rep-add stable # invalid location
fail rep-add http:// # invalid location
# relative path
#
test rep-add ./1/math/stable
fail rep-add ./1/../1/math/stable # duplicate
# absolute path
#
test rep-add /tmp/1/misc/stable
fail rep-add /tmp/1/../1/misc/stable # duplicate
# remote URL
#
test rep-add http://pkg.example.org/1/testing
fail rep-add http://www.example.org/1/testing # duplicate
##
## rep-fetch
##
test cfg-create --wipe
fail rep-fetch # no repositories
# hello repository
#
test cfg-create --wipe
test rep-add $rep
test rep-fetch
test rep-fetch
# math/unstable repository
#
test cfg-create --wipe
test rep-add repository/1/math/unstable
test rep-fetch
test rep-fetch
# both
#
test cfg-create --wipe
test rep-add $rep
test rep-add repository/1/math/unstable
test rep-fetch
test rep-fetch
# remote
#
test cfg-create --wipe
test rep-add http://pkg.cppget.org/1/hello
test rep-fetch
##
## pkg-fetch
##
test rep-create repository/1/fetch/t1
test cfg-create --wipe
fail pkg-fetch -e # archive expected
fail pkg-fetch -e ./no-such-file # archive does not exist
fail pkg-fetch # package name expected
fail pkg-fetch libfoo # package version expected
fail pkg-fetch libfoo/1/2/3 # invalid package version
fail pkg-fetch libfoo/1.0.0 # no repositories
test rep-add repository/1/fetch/t1
fail pkg-fetch libfoo/1.0.0 # no packages
test rep-fetch
fail pkg-fetch libfoo/2+1.0.0 # not available
# local
#
test cfg-create --wipe
test rep-add repository/1/fetch/t1
test rep-fetch
test pkg-fetch libfoo/1.0.0
stat libfoo/1.0.0 fetched
fail pkg-fetch libfoo/1.0.0
fail pkg-fetch -e repository/1/fetch/t1/libfoo-1.0.0.tar.gz
test pkg-purge libfoo
test pkg-fetch -e repository/1/fetch/t1/libfoo-1.0.0.tar.gz
stat libfoo/1.0.0 fetched
test pkg-unpack libfoo
test pkg-fetch -r libfoo/1.1.0
stat libfoo/1.1.0 fetched
test pkg-unpack libfoo
test pkg-fetch -r -e repository/1/fetch/t1/libfoo-1.0.0.tar.gz
stat libfoo/1.0.0 fetched
test pkg-fetch -r libfoo/1.1.0
stat libfoo/1.1.0 fetched
test pkg-fetch -r -e repository/1/fetch/t1/libfoo-1.0.0.tar.gz
stat libfoo/1.0.0 fetched
test pkg-purge libfoo
# remote
#
test cfg-create --wipe
test rep-add http://pkg.cppget.org/1/hello
test rep-fetch
#test pkg-fetch libheavy/1.0.0
test pkg-fetch libhello/1.0.0
test pkg-unpack libhello
test pkg-purge libhello
## @@
##
##
test cfg-create --wipe config.cxx=g++-4.9 cxx config.install.root=/tmp/install
stat unknown
# fetch existing archive
#
stat unknown
test pkg-fetch -e $pkga
stat fetched
test pkg-purge $pkg
stat unknown
##
## pkg-unpack
##
# @@ TODO
# replace
#
test cfg-create --wipe
test rep-add repository/1/fetch/t1
test rep-fetch
test pkg-fetch libfoo/1.0.0
fail pkg-unpack -e repository/1/fetch/libfoo-1.1.0
test pkg-unpack -r -e repository/1/fetch/libfoo-1.1.0
stat libfoo/1.1.0 unpacked
test pkg-purge libfoo
test pkg-fetch libfoo/1.0.0
test pkg-unpack libfoo
fail pkg-unpack -e repository/1/fetch/libfoo-1.1.0
test pkg-unpack -r -e repository/1/fetch/libfoo-1.1.0
stat libfoo/1.1.0 unpacked
test pkg-purge libfoo
##
## pkg-purge
##
fail pkg-purge
fail pkg-purge $pkg
# purge fetched
#
test pkg-fetch -e $pkga
test pkg-purge $pkg
stat unknown
# --keep
#
test pkg-fetch -e $pkga
test pkg-purge -k $pkg
stat fetched
test pkg-purge $pkg
# archive --purge
#
cp $pkga $cfg/
test pkg-fetch -e -p $cfg/`basename $pkga`
test pkg-purge $pkg
stat unknown
gone $cfg/`basename $pkga`
# no archive but --keep
#
test pkg-unpack -e $pkgd
fail pkg-purge --keep $pkg
stat unpacked
test pkg-purge $pkg
# purge unpacked directory
#
test pkg-unpack -e $pkgd
test pkg-purge $pkg
stat unknown
# purge unpacked archive
#
test pkg-fetch -e $pkga
test pkg-unpack $pkg
test pkg-purge $pkg
stat unknown
gone $out
# purge unpacked archive but --keep
#
test pkg-fetch -e $pkga
test pkg-unpack $pkg
test pkg-purge --keep $pkg
stat fetched
gone $out
test pkg-purge $pkg
# directory --purge
#
cp -r $pkgd $cfg/
test pkg-unpack -e -p $out
test pkg-purge $pkg
stat unknown
gone $out
# archive --purge
#
cp $pkga $cfg/
test pkg-fetch -e -p $cfg/`basename $pkga`
test pkg-unpack $pkg
test pkg-purge $pkg
stat unknown
gone $out
gone $cfg/`basename $pkga`
# broken
#
cp $pkga $cfg/
test pkg-fetch -e -p $cfg/`basename $pkga`
test pkg-unpack $pkg
chmod 000 $out
fail pkg-purge $pkg
stat broken
fail pkg-purge $pkg # need --force
fail pkg-purge -f -k $pkg # can't keep broken
fail pkg-purge -f $pkg # directory still exists
chmod 755 $out
rm -r $out
fail pkg-purge -f $pkg # archive still exists
rm $cfg/`basename $pkga`
test pkg-purge -f $pkg
stat unknown
##
## pkg-configure/pkg-disfigure
##
fail pkg-configure # package name expected
fail pkg-configure config.dist.root=/tmp # ditto
fail pkg-configure $pkg $pkg # unexpected argument
fail pkg-configure $pkg # no such package
fail pkg-disfigure # package name expected
fail pkg-disfigure $pkg # no such package
test pkg-fetch -e $pkga
fail pkg-configure $pkg # wrong package state
fail pkg-disfigure $pkg # wrong package state
test pkg-purge $pkg
# src == out
#
test pkg-fetch -e $pkga
test pkg-unpack $pkg
test pkg-configure $pkg
stat configured
test pkg-disfigure $pkg
stat unpacked
test pkg-purge $pkg
stat unknown
# src != out
#
test pkg-unpack -e $pkgd
test pkg-configure $pkg
stat configured
test pkg-disfigure $pkg
stat unpacked
test pkg-purge $pkg
stat unknown
gone $out
# out still exists after disfigure
#
test pkg-unpack -e $pkgd
test pkg-configure $pkg
touch $out/stray
fail pkg-disfigure $pkg
stat broken
rm -r $out
test pkg-purge -f $pkg
stat unknown
# disfigure failed
#
test pkg-unpack -e $pkgd
test pkg-configure $pkg
chmod 555 $out
fail pkg-disfigure $pkg
stat broken
chmod 755 $out
rm -r $out
test pkg-purge -f $pkg
stat unknown
# configure failed but disfigure succeeds
#
test pkg-unpack -e $pkgd
mkdir -p $out/build
chmod 555 $out/build
fail pkg-configure $pkg
stat unpacked
test pkg-purge $pkg
stat unknown
# configure and disfigure both failed
#
test pkg-unpack -e $pkgd
mkdir -p $out/build
chmod 555 $out $out/build # Both to trip configure and disfigure.
fail pkg-configure $pkg
stat broken
chmod 755 $out $out/build
rm -r $out
test pkg-purge -f $pkg
stat unknown
# dependency management
#
test rep-create repository/1/depend/stable
test cfg-create --wipe
test rep-add repository/1/depend/stable
test rep-fetch
test pkg-fetch libbar/1.0.0
test pkg-unpack libbar
fail pkg-configure libbar # no libfoo
stat libbar/1.0.0 "unpacked"
test pkg-fetch libfoo/1.0.0
test pkg-unpack libfoo
fail pkg-configure libbar # libfoo not configured
test pkg-configure libfoo
test pkg-configure libbar
fail pkg-disfigure libfoo # libbar still depends on libfoo
test pkg-disfigure libbar
test pkg-disfigure libfoo
test pkg-purge libbar
test pkg-purge libfoo
test pkg-fetch libfoo/1.0.0
test pkg-unpack libfoo
test pkg-configure libfoo
test pkg-fetch libbar/1.1.0
test pkg-unpack libbar
fail pkg-configure libbar # libfoo >= 1.1.0
test pkg-disfigure libfoo
test pkg-purge libfoo
test pkg-fetch libfoo/1.1.0
test pkg-unpack libfoo
test pkg-configure libfoo
test pkg-configure libbar
test pkg-disfigure libbar
test pkg-disfigure libfoo
test pkg-purge libfoo
test pkg-purge libbar
test pkg-fetch libfoo/1.1.0
test pkg-unpack libfoo
test pkg-configure libfoo
test pkg-fetch libbar/1.2.0
test pkg-unpack libbar
fail pkg-configure libbar # libfoo >= 1.2.0
test pkg-disfigure libfoo
test pkg-purge libfoo
test pkg-fetch libfoo/1.2.0
test pkg-unpack libfoo
test pkg-configure libfoo
test pkg-configure libbar
fail pkg-disfigure libfoo # "package libbar on libfoo >= 1.2.0"
test pkg-disfigure libbar
test pkg-disfigure libfoo
test pkg-purge libfoo
test pkg-purge libbar
test pkg-fetch libfoo/1.1.0
test pkg-unpack libfoo
test pkg-configure libfoo
test pkg-fetch libbar/1.3.0
test pkg-unpack libbar
fail pkg-configure libbar # incompatible constraints
test pkg-disfigure libfoo
test pkg-purge libfoo
test pkg-purge libbar
##
## pkg-status (also tested in pkg-{fetch,unpack,configure,disfigure,purge}
##
test rep-create repository/1/status/stable
test rep-create repository/1/status/extra
test rep-create repository/1/status/testing
test rep-create repository/1/status/unstable
# basics
#
test cfg-create --wipe
stat libfoo/1.0.0 "unknown"
stat libfoo "unknown"
test rep-add repository/1/status/stable
test rep-fetch
stat libfoo/1.0.0 "available"
stat libfoo "available 1.0.0"
test pkg-fetch libfoo/1.0.0
stat libfoo/1.0.0 "fetched"
stat libfoo "fetched 1.0.0"
# multiple versions/revisions
#
test cfg-create --wipe
test rep-add repository/1/status/extra
test rep-fetch
stat libbar "available 1.1.0-1"
test rep-add repository/1/status/stable
test rep-fetch
stat libbar "available 1.1.0-1 1.0.0"
test cfg-create --wipe
test rep-add repository/1/status/testing
test rep-fetch
stat libbar "available 1.1.0 1.0.0-1 1.0.0"
test cfg-create --wipe
test rep-add repository/1/status/unstable
test rep-fetch
stat libbar "available 2.0.0 1.1.0 1.0.0-1 1.0.0"
test pkg-fetch libbar/1.0.0-1
stat libbar "fetched 1.0.0-1; available 2.0.0 1.1.0"
test pkg-purge libbar
test pkg-fetch libbar/2.0.0
stat libbar "fetched 2.0.0"
##
## pkg-update
##
fail pkg-update # package name expected
fail pkg-update $pkg # no such package
test pkg-fetch -e $pkga
fail pkg-update $pkg # wrong package state
test pkg-purge $pkg
# src == out
#
test pkg-fetch -e $pkga
test pkg-unpack $pkg
test pkg-configure $pkg
test pkg-update $pkg
test pkg-update $pkg
test pkg-disfigure $pkg
test pkg-purge $pkg
# src != out
#
test pkg-unpack -e $pkgd
test pkg-configure $pkg
test pkg-update $pkg
test pkg-update $pkg
test pkg-disfigure $pkg
test pkg-purge $pkg
##
## pkg-clean
##
fail pkg-clean # package name expected
fail pkg-clean $pkg # no such package
test pkg-fetch -e $pkga
fail pkg-clean $pkg # wrong package state
test pkg-purge $pkg
# src == out
#
test pkg-fetch -e $pkga
test pkg-unpack $pkg
test pkg-configure $pkg
test pkg-update $pkg
test pkg-clean $pkg
test pkg-clean $pkg
test pkg-disfigure $pkg
test pkg-purge $pkg
# src != out
#
test pkg-unpack -e $pkgd
test pkg-configure $pkg
test pkg-update $pkg
test pkg-clean $pkg
test pkg-clean $pkg
test pkg-disfigure $pkg
test pkg-purge $pkg
##
## Low-level command scenarios.
##
# build package from remote repository
#
test cfg-create --wipe cxx
test rep-add http://pkg.cppget.org/1/hello
test rep-fetch
test pkg-fetch $pkg/$ver
test pkg-unpack $pkg
test pkg-configure $pkg
test pkg-update $pkg
test pkg-clean $pkg
test pkg-disfigure $pkg
test pkg-purge $pkg
##
## High-level commands.
##
##
## build
##
# 1
#
test rep-create repository/1/satisfy/t1
test cfg-create --wipe
fail build -p # package name expected
fail build -p libfoo # unknown package
fail build -p libfoo/1.0.0 # unknown package
test build -p repository/1/satisfy/libfoo-1.1.0.tar.gz <<EOF
build libfoo 1.1.0
EOF
test build -p repository/1/satisfy/libfoo-1.1.0 <<EOF
build libfoo 1.1.0
EOF
test pkg-unpack -e repository/1/satisfy/libfoo-1.1.0
test build -p libfoo <<< "build libfoo 1.1.0"
test build -p libfoo/1.1.0 <<< "build libfoo 1.1.0"
test build -p libfoo libfoo <<< "build libfoo 1.1.0"
test build -p libfoo libfoo/1.1.0 <<< "build libfoo 1.1.0"
test build -p libfoo/1.1.0 libfoo <<< "build libfoo 1.1.0"
test build -p libfoo/1.1.0 libfoo/1.1.0 <<< "build libfoo 1.1.0"
fail build -p libfoo/1.0.0
test pkg-purge libfoo
test rep-add repository/1/satisfy/t1
test rep-fetch
test build -p libfoo <<< "build libfoo 1.0.0"
test build -p libfoo/1.0.0 <<< "build libfoo 1.0.0"
test build -p libfoo libfoo <<< "build libfoo 1.0.0"
test build -p libfoo libfoo/1.0.0 <<< "build libfoo 1.0.0"
test build -p libfoo/1.0.0 libfoo <<< "build libfoo 1.0.0"
test build -p libfoo/1.0.0 libfoo/1.0.0 <<< "build libfoo 1.0.0"
fail build -p libfoo/1.1.0
test pkg-unpack -e repository/1/satisfy/libfoo-1.1.0
test build -p libfoo <<< "build libfoo 1.1.0"
test build -p libfoo/1.0.0 <<< "downgrade libfoo 1.0.0"
fail build -p libfoo/0.0.0
test pkg-purge libfoo
test pkg-fetch -e repository/1/satisfy/libfoo-0.0.0.tar.gz
test pkg-unpack libfoo
test build -p libfoo <<< "upgrade libfoo 1.0.0"
test build -p libfoo/0.0.0 <<< "build libfoo 0.0.0"
fail build -p libfoo/1.1.0
test pkg-purge libfoo
# 2 (libbar depends on libfoo)
#
test rep-create repository/1/satisfy/t2
test cfg-create --wipe
fail build repository/1/satisfy/libbar-1.0.0.tar.gz
test rep-add repository/1/satisfy/t2
test rep-fetch
test build -p libbar <<EOF
build libfoo 1.0.0
build libbar 1.0.0
EOF
test build -p libbar libfoo <<EOF
build libfoo 1.0.0
build libbar 1.0.0
EOF
test build -p libbar libfoo/1.0.0 <<EOF
build libfoo 1.0.0
build libbar 1.0.0
EOF
test build -p libbar libfoo libbar/1.0.0 <<EOF
build libfoo 1.0.0
build libbar 1.0.0
EOF
fail build -p libbar libfoo/1.1.0
test pkg-fetch -e repository/1/satisfy/libfoo-0.0.0.tar.gz
test pkg-unpack libfoo
test build -p libbar <<EOF
build libfoo 0.0.0
build libbar 1.0.0
EOF
test build -p libbar libfoo <<EOF
upgrade libfoo 1.0.0
build libbar 1.0.0
EOF
test build -p libbar libfoo/0.0.0 <<EOF
build libfoo 0.0.0
build libbar 1.0.0
EOF
test pkg-purge libfoo
test pkg-unpack -e repository/1/satisfy/libfoo-1.1.0
test build -p libbar <<EOF
build libfoo 1.1.0
build libbar 1.0.0
EOF
test build -p libbar libfoo <<EOF
build libfoo 1.1.0
build libbar 1.0.0
EOF
test build -p libbar libfoo/1.0.0 <<EOF
downgrade libfoo 1.0.0
build libbar 1.0.0
EOF
test pkg-purge libfoo
# 3 (libbaz depends on libbar; libbar in prerequisite repository)
#
test rep-create repository/1/satisfy/t3
test cfg-create --wipe
test rep-add repository/1/satisfy/t3
test rep-fetch
# only in prerequisite repository
#
fail build -p libfoo
fail build -p libbar
fail build -p libbaz libbar
test build -p libbaz <<EOF
build libfoo 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
EOF
test rep-add repository/1/satisfy/t2
test rep-fetch
# order
#
test build -p libfox libfoo <<EOF
build libfox 1.0.0
build libfoo 1.0.0
EOF
test build -p libfoo libfox <<EOF
build libfoo 1.0.0
build libfox 1.0.0
EOF
test build -p libbaz libfoo <<EOF
build libfoo 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
EOF
test build -p libfoo libbaz <<EOF
build libfoo 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
EOF
test build -p libbaz libfox <<EOF
build libfoo 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
build libfox 1.0.0
EOF
test build -p libfox libbaz <<EOF
build libfox 1.0.0
build libfoo 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
EOF
test build -p libfox libfoo libbaz <<EOF
build libfox 1.0.0
build libfoo 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
EOF
test build -p libfox libbaz libfoo <<EOF
build libfox 1.0.0
build libfoo 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
EOF
test build -p libfoo libfox libbaz <<EOF
build libfoo 1.0.0
build libfox 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
EOF
test build -p libfoo libbaz libfox <<EOF
build libfoo 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
build libfox 1.0.0
EOF
# this one is contradictory: baz before fox but fox before foo
#
test build -p libbaz libfox libfoo <<EOF
build libfox 1.0.0
build libfoo 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
EOF
test build -p libbaz libfoo libfox <<EOF
build libfoo 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
build libfox 1.0.0
EOF
test build -p libbaz libfoo libbar <<EOF
build libfoo 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
EOF
test build -p libbaz libbar libfoo <<EOF
build libfoo 1.0.0
build libbar 1.0.0
build libbaz 1.0.0
EOF
# 4 (libbaz depends on libfoo and libbar; libbar depends on libfoo >= 1.1.0)
#
test rep-create repository/1/satisfy/t4a
test rep-create repository/1/satisfy/t4b
test rep-create repository/1/satisfy/t4c
test cfg-create --wipe
test rep-add repository/1/satisfy/t4c
test rep-fetch
test build -p libbaz <<EOF
build libfoo 1.1.0
build libbar 1.1.0
build libbaz 1.1.0
EOF
test build -p libfoo libbaz <<EOF
build libfoo 1.1.0
build libbar 1.1.0
build libbaz 1.1.0
EOF
fail build -p libfoo/1.0.0 libbaz
fail build -p libfoo/1.1.0 libbaz
# upgrade warning
#
test pkg-fetch -e repository/1/satisfy/libfoo-0.0.0.tar.gz
test pkg-unpack libfoo
test build -p libbaz <<EOF
upgrade libfoo 1.1.0
build libbar 1.1.0
build libbaz 1.1.0
EOF
test pkg-purge libfoo
# downgrade error
#
test pkg-fetch -e repository/1/satisfy/libfoo-1.2.0.tar.gz
test pkg-unpack libfoo
fail build -p libbaz
test rep-add repository/1/satisfy/t4a
test rep-fetch
test build -p libfoo/1.1.0 libbaz <<EOF
downgrade libfoo 1.1.0
build libbar 1.1.0
build libbaz 1.1.0
EOF
test pkg-purge libfoo
# dependent prevents upgrade/downgrade
#
test pkg-fetch libfoo/1.1.0
test pkg-unpack libfoo
test pkg-configure libfoo
test pkg-fetch libbar/1.1.0
test pkg-unpack libbar
test pkg-configure libbar
fail build -p repository/1/satisfy/libfoo-1.2.0.tar.gz
fail build -p libfoo/1.0.0
test build -p libfoo/1.1.0 <<< "build libfoo 1.1.0"
test pkg-disfigure libbar
test pkg-disfigure libfoo
test pkg-purge libbar
test pkg-purge libfoo
# dependent reconfigure
#
test cfg-create --wipe
test pkg-fetch -e repository/1/satisfy/libfoo-1.0.0.tar.gz
test pkg-unpack libfoo
test pkg-configure libfoo
test pkg-fetch -e repository/1/satisfy/libbar-1.0.0.tar.gz
test pkg-unpack libbar
test pkg-configure libbar
test pkg-fetch -e repository/1/satisfy/libbaz-1.1.0.tar.gz
test pkg-unpack libbaz
test pkg-configure libbaz
test rep-add repository/1/satisfy/t4a
test rep-add repository/1/satisfy/t4b
test rep-fetch
test build -p libbar <<EOF
upgrade libfoo 1.1.0
upgrade libbar 1.1.0
reconfigure libbaz
EOF
test build -p libfoo <<EOF
upgrade libfoo 1.1.0
reconfigure libbar
reconfigure libbaz
EOF
test build -p libfoo libbar/1.0.0 <<EOF
upgrade libfoo 1.1.0
reconfigure/build libbar 1.0.0
reconfigure libbaz
EOF
test build -p libbar/1.0.0 libfoo <<EOF
upgrade libfoo 1.1.0
reconfigure/build libbar 1.0.0
reconfigure libbaz
EOF
test build -p libbaz libfoo <<EOF
upgrade libfoo 1.1.0
reconfigure libbar
reconfigure/build libbaz 1.1.0
EOF
test build -p libbaz libfoo/1.0.0 <<EOF
build libfoo 1.0.0
build libbaz 1.1.0
EOF
|