summaryrefslogtreecommitdiffstats
path: root/test/t2400-aurblup.sh
blob: 708281c6ed5de6de82f7cafb736fb7e912a15aab (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
#!/bin/sh

test_description='aurblup tests'

. ./setup.sh

test_expect_success 'Test official provider update script.' '
	mkdir -p remote/test/foobar-1.0-1 &&
	cat <<-EOD >remote/test/foobar-1.0-1/desc &&
	%FILENAME%
	foobar-1.0-any.pkg.tar.xz

	%NAME%
	foobar

	%VERSION%
	1.0-1

	%ARCH%
	any
	EOD
	mkdir -p remote/test/foobar2-1.0-1 &&
	cat <<-EOD >remote/test/foobar2-1.0-1/desc &&
	%FILENAME%
	foobar2-1.0-any.pkg.tar.xz

	%NAME%
	foobar2

	%VERSION%
	1.0-1

	%ARCH%
	any

	%PROVIDES%
	foobar3
	foobar4
	EOD
	( cd remote/test && bsdtar -czf ../test.db * ) &&
	mkdir sync &&
	"$AURBLUP" &&
	cat <<-EOD >expected &&
	foobar|test|foobar
	foobar2|test|foobar2
	foobar2|test|foobar3
	foobar2|test|foobar4
	EOD
	echo "SELECT Name, Repo, Provides FROM OfficialProviders ORDER BY Provides;" | sqlite3 aur.db >actual &&
	test_cmp actual expected
'

test_done