File: check-user

package info (click to toggle)
acr 2.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 712 kB
  • sloc: sh: 4,738; makefile: 41
file content (31 lines) | stat: -rw-r--r-- 908 bytes parent folder | download | duplicates (6)
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
Checking users with ACR
=======================

*NOTE* This feature was added in acr 0.5.

You can check for user or group existence by using the CHKUSR and CHKGRP
commands.

There's one problem by using this stuff in the configure stage, because some
build systems runs only runs 'make install' as root, the rest with an
unprivileged user. This may cause a fail. Another way to check users and
groups, maybe parsing the /etc/passwd and /etc/group, instead of trying to
chown a file.

You can segmentate your configure into another tiny script by appending '-s'
to 'acr' just like this:

----------------------------------------
$ cd src
$ acr -s
$ tail Makefile.acr

install:
	./configure  # check for users.
	mkdir -p ${BINDIR}
	${INSTALL} program ${BINDIR}/

----------------------------------------

Don't forget to use CHKUSR! and CHKGRP! if you want to stop the script there
if an error has occurred.