libk  Check-in [50b709b0d3]

Overview
Comment:Remove the $to check entirely and have more output in install.sh Sourcing a file doesn't need it to be executable, so global/common.sh can have it's executable bit removed and the $to check in it entirely removed. Adds some `say`s to install.sh to let you know it did something and help in case of error.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | install
Files: files | file ages | folders
SHA3-256: 50b709b0d3f0ffa491155a7ee58b8b4385961356ecb3186665bd096f01496c4a
User & Date: glowpelt on 2020-01-24 21:18:35
Other Links: branch diff | manifest | tags
Context
2020-01-31
06:05
Merge install script branch. Seems to be Good Enough for now, and shouldn't break anything at all to merge this. check-in: 12a51d9c50 user: glowpelt tags: trunk
2020-01-24
21:18
Remove the $to check entirely and have more output in install.sh Sourcing a file doesn't need it to be executable, so global/common.sh can have it's executable bit removed and the $to check in it entirely removed. Adds some `say`s to install.sh to let you know it did something and help in case of error. Closed-Leaf check-in: 50b709b0d3 user: glowpelt tags: install
2020-01-23
07:10
Make install.sh actually try to install. Just a first pass at the problem for now, but it seems to work fine finally with some quick testing. check-in: 6346f60bb6 user: glowpelt tags: install
Changes

Modified global/common.sh from [0a6c6a9052] to [d610091946].

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
check() {
	var=$1
	test "${!var}" == "" || return 0
	say "we were not able to detect a default value for the configuration variable \$$var. please set this variable to $2 and try again."
	exit 1
}

#test "$to" = "" && {
#	say "\$to environment variable must be set to your build directory - are you running this script by hand? run ./build.sh in the root directory instead!"
#	exit 2
#}

reqpack() {
	if ! has "$1"; then
		say "to $2 for libk, install the $1 package and try again"
		exit 3
	fi
}








<
<
<
<
<







4
5
6
7
8
9
10





11
12
13
14
15
16
17
check() {
	var=$1
	test "${!var}" == "" || return 0
	say "we were not able to detect a default value for the configuration variable \$$var. please set this variable to $2 and try again."
	exit 1
}






reqpack() {
	if ! has "$1"; then
		say "to $2 for libk, install the $1 package and try again"
		exit 3
	fi
}

Modified install.sh from [ca0001a46e] to [df12302eb0].

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

	sharedir="$prefix/usr/share"
	incdir="$prefix/usr/include"
else
	incdir="$prefix/include"
	sharedir="$prefix/share"
fi



# Libraries
# These may or may not exist, depending on what library build is done, so check

[ -e "$build/libk.a" ] && install -Dm644 -t "$libdir" "$build/libk.a"
[ -e "$build/libk.so" ] && install -Dm644 -t "$libdir" "$build/libk.so"
[ -e "$build/boot.o" ] && install -Dm644 -t "$libdir/libk" "$build/boot.o"

# Binaries

install -Dm755 -t "$bindir" "$build/kcore.testbin"
install -Dm755 -t "$bindir" "$build/kcli.testbin"
install -Dm755 -t "$bindir" "$build/kgraft.attach"

# Includes

for inc in "$build"/k/*; do
	install -Dm644 -t "$incdir/k" "$inc"
done

# Documentation

for man in "$build"/doc/man/*; do
	install -Dm644 -t "$sharedir/man" "$man"
done
for html in "$build"/doc/html/*; do
	install -Dm644 -t "$sharedir/doc/libk/html" "$html"
done
for pdf in "$build"/doc/pdf/*; do
	install -Dm644 -t "$sharedir/doc/libk/pdf" "$pdf"
done








>
>


>





>





>





>









>
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
	sharedir="$prefix/usr/share"
	incdir="$prefix/usr/include"
else
	incdir="$prefix/include"
	sharedir="$prefix/share"
fi

say "Starting install."

# Libraries
# These may or may not exist, depending on what library build is done, so check
say "Installing libraries..."
[ -e "$build/libk.a" ] && install -Dm644 -t "$libdir" "$build/libk.a"
[ -e "$build/libk.so" ] && install -Dm644 -t "$libdir" "$build/libk.so"
[ -e "$build/boot.o" ] && install -Dm644 -t "$libdir/libk" "$build/boot.o"

# Binaries
say "Installing binaries..."
install -Dm755 -t "$bindir" "$build/kcore.testbin"
install -Dm755 -t "$bindir" "$build/kcli.testbin"
install -Dm755 -t "$bindir" "$build/kgraft.attach"

# Includes
say "Installing includes..."
for inc in "$build"/k/*; do
	install -Dm644 -t "$incdir/k" "$inc"
done

# Documentation
say "Installing documentation..."
for man in "$build"/doc/man/*; do
	install -Dm644 -t "$sharedir/man" "$man"
done
for html in "$build"/doc/html/*; do
	install -Dm644 -t "$sharedir/doc/libk/html" "$html"
done
for pdf in "$build"/doc/pdf/*; do
	install -Dm644 -t "$sharedir/doc/libk/pdf" "$pdf"
done
say "Install done!"