/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.171 Revision 1.182
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.171 2005/05/13 00:30:33 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.182 2005/06/11 00:02:26 vapier Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 6#
7# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 8# have to implement themselves.
11 11
12inherit multilib 12inherit multilib
13ECLASS=eutils 13ECLASS=eutils
14INHERITED="$INHERITED $ECLASS" 14INHERITED="$INHERITED $ECLASS"
15 15
16DEPEND="!bootstrap? ( sys-devel/patch )" 16DEPEND="!bootstrap? ( sys-devel/patch userland_GNU? ( sys-apps/shadow ) )"
17# sys-apps/shadow is needed for useradd, etc, bug #94745.
17 18
18DESCRIPTION="Based on the ${ECLASS} eclass" 19DESCRIPTION="Based on the ${ECLASS} eclass"
19 20
20# Wait for the supplied number of seconds. If no argument is supplied, defaults 21# Wait for the supplied number of seconds. If no argument is supplied, defaults
21# to five seconds. If the EPAUSE_IGNORE env var is set, don't wait. If we're not 22# to five seconds. If the EPAUSE_IGNORE env var is set, don't wait. If we're not
125# List of patches not to apply. Not this is only file names, 126# List of patches not to apply. Not this is only file names,
126# and not the full path .. 127# and not the full path ..
127EPATCH_EXCLUDE="" 128EPATCH_EXCLUDE=""
128# Change the printed message for a single patch. 129# Change the printed message for a single patch.
129EPATCH_SINGLE_MSG="" 130EPATCH_SINGLE_MSG=""
131# Change the printed message for multiple patches.
132EPATCH_MULTI_MSG="Applying various patches (bugfixes/updates) ..."
130# Force applying bulk patches even if not following the style: 133# Force applying bulk patches even if not following the style:
131# 134#
132# ??_${ARCH}_foo.${EPATCH_SUFFIX} 135# ??_${ARCH}_foo.${EPATCH_SUFFIX}
133# 136#
134EPATCH_FORCE="no" 137EPATCH_FORCE="no"
238 ;; 241 ;;
239 esac 242 esac
240 243
241 if [ "${SINGLE_PATCH}" = "no" ] 244 if [ "${SINGLE_PATCH}" = "no" ]
242 then 245 then
243 einfo "Applying various patches (bugfixes/updates) ..." 246 einfo "${EPATCH_MULTI_MSG}"
244 fi 247 fi
245 for x in ${EPATCH_SOURCE} 248 for x in ${EPATCH_SOURCE}
246 do 249 do
247 # New ARCH dependant patch naming scheme ... 250 # New ARCH dependant patch naming scheme ...
248 # 251 #
249 # ???_arch_foo.patch 252 # ???_arch_foo.patch
250 # 253 #
251 if [ -f ${x} ] && \ 254 if [ -f ${x} ] && \
252 ([ "${SINGLE_PATCH}" = "yes" -o "${x/_all_}" != "${x}" -o "`eval echo \$\{x/_${ARCH}_\}`" != "${x}" ] || \ 255 ([ "${SINGLE_PATCH}" = "yes" -o "${x/_all_}" != "${x}" -o "${x/_${ARCH}_}" != "${x}" ] || \
253 [ "${EPATCH_FORCE}" = "yes" ]) 256 [ "${EPATCH_FORCE}" = "yes" ])
254 then 257 then
255 local count=0 258 local count=0
256 local popts="${EPATCH_OPTS}" 259 local popts="${EPATCH_OPTS}"
257 local patchname=${x##*/} 260 local patchname=${x##*/}
367 then 370 then
368 einfo "Done with patching" 371 einfo "Done with patching"
369 fi 372 fi
370} 373}
371 374
372# This function check how many cpu's are present, and then set
373# -j in MAKEOPTS accordingly.
374#
375# Thanks to nall <nall@gentoo.org> for this.
376#
377get_number_of_jobs() {
378 local jobs=0
379
380 if [ ! -r /proc/cpuinfo ]
381 then
382 return 1
383 fi
384
385 # This bit is from H?kan Wessberg <nacka-gentoo@refug.org>, bug #13565.
386 if [ "`egrep "^[[:space:]]*MAKEOPTS=" /etc/make.conf | wc -l`" -gt 0 ]
387 then
388 ADMINOPTS="`egrep "^[[:space:]]*MAKEOPTS=" /etc/make.conf | cut -d= -f2 | sed 's/\"//g'`"
389 ADMINPARAM="`echo ${ADMINOPTS} | gawk '{match($0, /-j *[0-9]*/, opt); print opt[0]}'`"
390 ADMINPARAM="${ADMINPARAM/-j}"
391 fi
392
393 export MAKEOPTS="`echo ${MAKEOPTS} | sed -e 's:-j *[0-9]*::g'`"
394
395 if [ "${ARCH}" = "amd64" -o "${ARCH}" = "x86" -o "${ARCH}" = "hppa" -o \
396 "${ARCH}" = "arm" -o "${ARCH}" = "mips" -o "${ARCH}" = "ia64" ]
397 then
398 # these archs will always have "[Pp]rocessor"
399 jobs="$((`grep -c ^[Pp]rocessor /proc/cpuinfo` * 2))"
400
401 elif [ "${ARCH}" = "sparc" -o "${ARCH}" = "sparc64" ]
402 then
403 # sparc always has "ncpus active"
404 jobs="$((`grep "^ncpus active" /proc/cpuinfo | sed -e "s/^.*: //"` * 2))"
405
406 elif [ "${ARCH}" = "alpha" ]
407 then
408 # alpha has "cpus active", but only when compiled with SMP
409 if [ "`grep -c "^cpus active" /proc/cpuinfo`" -eq 1 ]
410 then
411 jobs="$((`grep "^cpus active" /proc/cpuinfo | sed -e "s/^.*: //"` * 2))"
412 else
413 jobs=2
414 fi
415
416 elif [ "${ARCH}" = "ppc" -o "${ARCH}" = "ppc64" ]
417 then
418 # ppc has "processor", but only when compiled with SMP
419 if [ "`grep -c "^processor" /proc/cpuinfo`" -eq 1 ]
420 then
421 jobs="$((`grep -c ^processor /proc/cpuinfo` * 2))"
422 else
423 jobs=2
424 fi
425 elif [ "${ARCH}" = "s390" ]
426 then
427 # s390 has "# processors : "
428 jobs="$((`grep "^\# processors" /proc/cpuinfo | sed -e "s/^.*: //"` * 2))"
429 else
430 jobs="$((`grep -c ^cpu /proc/cpuinfo` * 2))"
431 die "Unknown ARCH -- ${ARCH}!"
432 fi
433
434 # Make sure the number is valid ...
435 if [ "${jobs}" -lt 1 ]
436 then
437 jobs=1
438 fi
439
440 if [ -n "${ADMINPARAM}" ]
441 then
442 if [ "${jobs}" -gt "${ADMINPARAM}" ]
443 then
444 einfo "Setting make jobs to \"-j${ADMINPARAM}\" to ensure successful merge ..."
445 export MAKEOPTS="${MAKEOPTS} -j${ADMINPARAM}"
446 else
447 einfo "Setting make jobs to \"-j${jobs}\" to ensure successful merge ..."
448 export MAKEOPTS="${MAKEOPTS} -j${jobs}"
449 fi
450 fi
451}
452
453# Cheap replacement for when debianutils (and thus mktemp) 375# Cheap replacement for when debianutils (and thus mktemp)
454# does not exist on the users system 376# does not exist on the users system
455# vapier@gentoo.org 377# vapier@gentoo.org
456# 378#
457# Takes just 1 optional parameter (the directory to create tmpfile in) 379# Takes just 1 optional parameter (the directory to create tmpfile in)
488# Joe Jezak <josejx@gmail.com> and usata@gentoo.org 410# Joe Jezak <josejx@gmail.com> and usata@gentoo.org
489# FBSD stuff: Aaron Walker <ka0ttic@gentoo.org> 411# FBSD stuff: Aaron Walker <ka0ttic@gentoo.org>
490# 412#
491# egetent(database, key) 413# egetent(database, key)
492egetent() { 414egetent() {
493 if useq ppc-macos ; then 415 if [[ "${USERLAND}" == "Darwin" ]] ; then
494 case "$2" in 416 case "$2" in
495 *[!0-9]*) # Non numeric 417 *[!0-9]*) # Non numeric
496 nidump $1 . | awk -F":" "{ if (\$1 ~ /^$2$/) {print \$0;exit;} }" 418 nidump $1 . | awk -F":" "{ if (\$1 ~ /^$2$/) {print \$0;exit;} }"
497 ;; 419 ;;
498 *) # Numeric 420 *) # Numeric
499 nidump $1 . | awk -F":" "{ if (\$3 == $2) {print \$0;exit;} }" 421 nidump $1 . | awk -F":" "{ if (\$3 == $2) {print \$0;exit;} }"
500 ;; 422 ;;
501 esac 423 esac
502 elif useq x86-fbsd ; then 424 elif [[ "${USERLAND}" == "BSD" ]] ; then
503 local action 425 local action
504 if [ "$1" == "passwd" ] 426 if [ "$1" == "passwd" ]
505 then 427 then
506 action="user" 428 action="user"
507 else 429 else
527# homedir: /dev/null 449# homedir: /dev/null
528# groups: none 450# groups: none
529# extra: comment of 'added by portage for ${PN}' 451# extra: comment of 'added by portage for ${PN}'
530enewuser() { 452enewuser() {
531 # get the username 453 # get the username
532 local euser="$1"; shift 454 local euser=$1; shift
533 if [ -z "${euser}" ] 455 if [[ -z ${euser} ]] ; then
534 then
535 eerror "No username specified !" 456 eerror "No username specified !"
536 die "Cannot call enewuser without a username" 457 die "Cannot call enewuser without a username"
537 fi 458 fi
538 459
539 # lets see if the username already exists 460 # lets see if the username already exists
540 if [ "${euser}" == "`egetent passwd \"${euser}\" | cut -d: -f1`" ] 461 if [[ ${euser} == $(egetent passwd "${euser}" | cut -d: -f1) ]] ; then
541 then
542 return 0 462 return 0
543 fi 463 fi
544 einfo "Adding user '${euser}' to your system ..." 464 einfo "Adding user '${euser}' to your system ..."
545 465
546 # options to pass to useradd 466 # options to pass to useradd
547 local opts= 467 local opts=
548 468
549 # handle uid 469 # handle uid
550 local euid="$1"; shift 470 local euid=$1; shift
551 if [ ! -z "${euid}" ] && [ "${euid}" != "-1" ] 471 if [[ ! -z ${euid} ]] && [[ ${euid} != "-1" ]] ; then
552 then
553 if [ "${euid}" -gt 0 ] 472 if [[ ${euid} -gt 0 ]] ; then
554 then
555 if [ ! -z "`egetent passwd ${euid}`" ] 473 if [[ ! -z $(egetent passwd ${euid}) ]] ; then
556 then
557 euid="next" 474 euid="next"
558 fi 475 fi
559 else 476 else
560 eerror "Userid given but is not greater than 0 !" 477 eerror "Userid given but is not greater than 0 !"
561 die "${euid} is not a valid UID" 478 die "${euid} is not a valid UID"
562 fi 479 fi
563 else 480 else
564 euid="next" 481 euid="next"
565 fi 482 fi
566 if [ "${euid}" == "next" ] 483 if [[ ${euid} == "next" ]] ; then
567 then
568 local pwrange 484 local pwrange
569 if [ "${USERLAND}" == "BSD" ] ; then 485 if [[ ${USERLAND} == "BSD" ]] ; then
570 pwrange="`jot 898 101`" 486 pwrange=$(jot 898 101)
571 else 487 else
572 pwrange="`seq 101 999`" 488 pwrange=$(seq 101 999)
573 fi 489 fi
574 for euid in ${pwrange} ; do 490 for euid in ${pwrange} ; do
575 [ -z "`egetent passwd ${euid}`" ] && break 491 [[ -z $(egetent passwd ${euid}) ]] && break
576 done 492 done
577 fi 493 fi
578 opts="${opts} -u ${euid}" 494 opts="${opts} -u ${euid}"
579 einfo " - Userid: ${euid}" 495 einfo " - Userid: ${euid}"
580 496
581 # handle shell 497 # handle shell
582 local eshell="$1"; shift 498 local eshell=$1; shift
583 if [ ! -z "${eshell}" ] && [ "${eshell}" != "-1" ] 499 if [[ ! -z ${eshell} ]] && [[ ${eshell} != "-1" ]] ; then
584 then
585 if [ ! -e "${eshell}" ] 500 if [[ ! -e ${eshell} ]] ; then
586 then
587 eerror "A shell was specified but it does not exist !" 501 eerror "A shell was specified but it does not exist !"
588 die "${eshell} does not exist" 502 die "${eshell} does not exist"
589 fi 503 fi
590 else 504 else
591 if [ "${USERLAND}" == "BSD" ] 505 case ${USERLAND} in
592 then
593 eshell="/usr/bin/false" 506 Darwin) eshell="/usr/bin/false";;
594 else 507 BSD) eshell="/usr/sbin/nologin";;
595 eshell="/bin/false" 508 *) eshell="/bin/false";;
596 fi 509 esac
597 fi 510 fi
598 einfo " - Shell: ${eshell}" 511 einfo " - Shell: ${eshell}"
599 opts="${opts} -s ${eshell}" 512 opts="${opts} -s ${eshell}"
600 513
601 # handle homedir 514 # handle homedir
602 local ehome="$1"; shift 515 local ehome=$1; shift
603 if [ -z "${ehome}" ] && [ "${eshell}" != "-1" ] 516 if [[ -z ${ehome} ]] || [[ ${ehome} == "-1" ]] ; then
604 then
605 ehome="/dev/null" 517 ehome="/dev/null"
606 fi 518 fi
607 einfo " - Home: ${ehome}" 519 einfo " - Home: ${ehome}"
608 opts="${opts} -d ${ehome}" 520 opts="${opts} -d ${ehome}"
609 521
610 # handle groups 522 # handle groups
611 local egroups="$1"; shift 523 local egroups=$1; shift
612 if [ ! -z "${egroups}" ] 524 if [[ ! -z ${egroups} ]] ; then
613 then
614 local oldifs="${IFS}" 525 local oldifs=${IFS}
615 local defgroup="" exgroups="" 526 local defgroup="" exgroups=""
616 527
617 export IFS="," 528 export IFS=","
618 for g in ${egroups} 529 for g in ${egroups} ; do
619 do
620 export IFS="${oldifs}" 530 export IFS=${oldifs}
621 if [ -z "`egetent group \"${g}\"`" ] 531 if [[ -z $(egetent group "${g}") ]] ; then
622 then
623 eerror "You must add group ${g} to the system first" 532 eerror "You must add group ${g} to the system first"
624 die "${g} is not a valid GID" 533 die "${g} is not a valid GID"
625 fi 534 fi
626 if [ -z "${defgroup}" ] 535 if [[ -z ${defgroup} ]] ; then
627 then
628 defgroup="${g}" 536 defgroup=${g}
629 else 537 else
630 exgroups="${exgroups},${g}" 538 exgroups="${exgroups},${g}"
631 fi 539 fi
632 export IFS="," 540 export IFS=","
633 done 541 done
634 export IFS="${oldifs}" 542 export IFS=${oldifs}
635 543
636 opts="${opts} -g ${defgroup}" 544 opts="${opts} -g ${defgroup}"
637 if [ ! -z "${exgroups}" ] 545 if [[ ! -z ${exgroups} ]] ; then
638 then
639 opts="${opts} -G ${exgroups:1}" 546 opts="${opts} -G ${exgroups:1}"
640 fi 547 fi
641 else 548 else
642 egroups="(none)" 549 egroups="(none)"
643 fi 550 fi
644 einfo " - Groups: ${egroups}" 551 einfo " - Groups: ${egroups}"
645 552
646 # handle extra and add the user 553 # handle extra and add the user
647 local eextra="$@"
648 local oldsandbox="${SANDBOX_ON}" 554 local oldsandbox=${SANDBOX_ON}
649 export SANDBOX_ON="0" 555 export SANDBOX_ON="0"
650 if useq ppc-macos 556 case ${USERLAND} in
651 then 557 Darwin)
652 ### Make the user 558 ### Make the user
653 if [ -z "${eextra}" ] 559 if [[ -z $@ ]] ; then
654 then
655 dscl . create /users/${euser} uid ${euid} 560 dscl . create /users/${euser} uid ${euid}
656 dscl . create /users/${euser} shell ${eshell} 561 dscl . create /users/${euser} shell ${eshell}
657 dscl . create /users/${euser} home ${ehome} 562 dscl . create /users/${euser} home ${ehome}
658 dscl . create /users/${euser} realname "added by portage for ${PN}" 563 dscl . create /users/${euser} realname "added by portage for ${PN}"
659 ### Add the user to the groups specified 564 ### Add the user to the groups specified
660 local oldifs="${IFS}" 565 local oldifs=${IFS}
661 export IFS="," 566 export IFS=","
662 for g in ${egroups} 567 for g in ${egroups} ; do
663 do
664 dscl . merge /groups/${g} users ${euser} 568 dscl . merge /groups/${g} users ${euser}
665 done 569 done
666 export IFS="${oldifs}" 570 export IFS=${oldifs}
667 else 571 else
668 einfo "Extra options are not supported on macos yet" 572 einfo "Extra options are not supported on Darwin yet"
669 einfo "Please report the ebuild along with the info below" 573 einfo "Please report the ebuild along with the info below"
670 einfo "eextra: ${eextra}" 574 einfo "eextra: $@"
671 die "Required function missing" 575 die "Required function missing"
672 fi 576 fi
673 elif use x86-fbsd ; then 577 ;;
674 if [ -z "${eextra}" ] 578 BSD)
675 then 579 if [[ -z $@ ]] ; then
676 pw useradd ${euser} ${opts} \ 580 pw useradd ${euser} ${opts} \
677 -c "added by portage for ${PN}" \ 581 -c "added by portage for ${PN}" \
678 die "enewuser failed" 582 die "enewuser failed"
679 else 583 else
680 einfo " - Extra: ${eextra}" 584 einfo " - Extra: $@"
681 pw useradd ${euser} ${opts} \ 585 pw useradd ${euser} ${opts} \
682 -c ${eextra} || die "enewuser failed" 586 "$@" || die "enewuser failed"
683 fi 587 fi
684 else 588 ;;
685 if [ -z "${eextra}" ] 589 *)
686 then 590 if [[ -z $@ ]] ; then
687 useradd ${opts} ${euser} \ 591 useradd ${opts} ${euser} \
688 -c "added by portage for ${PN}" \ 592 -c "added by portage for ${PN}" \
689 || die "enewuser failed" 593 || die "enewuser failed"
690 else 594 else
691 einfo " - Extra: ${eextra}" 595 einfo " - Extra: $@"
692 useradd ${opts} ${euser} ${eextra} \ 596 useradd ${opts} ${euser} "$@" \
693 || die "enewuser failed" 597 || die "enewuser failed"
694 fi 598 fi
695 fi 599 ;;
600 esac
696 export SANDBOX_ON="${oldsandbox}" 601 export SANDBOX_ON=${oldsandbox}
697 602
698 if [ ! -e "${ehome}" ] && [ ! -e "${D}/${ehome}" ] 603 if [ ! -e "${ehome}" ] && [ ! -e "${D}/${ehome}" ]
699 then 604 then
700 einfo " - Creating ${ehome} in ${D}" 605 einfo " - Creating ${ehome} in ${D}"
701 dodir ${ehome} 606 dodir ${ehome}
738 then 643 then
739 if [ "${egid}" -gt 0 ] 644 if [ "${egid}" -gt 0 ]
740 then 645 then
741 if [ -z "`egetent group ${egid}`" ] 646 if [ -z "`egetent group ${egid}`" ]
742 then 647 then
743 if useq ppc-macos ; then 648 if [[ "${USERLAND}" == "Darwin" ]]; then
744 opts="${opts} ${egid}" 649 opts="${opts} ${egid}"
745 else 650 else
746 opts="${opts} -g ${egid}" 651 opts="${opts} -g ${egid}"
747 fi 652 fi
748 else 653 else
762 opts="${opts} ${eextra}" 667 opts="${opts} ${eextra}"
763 668
764 # add the group 669 # add the group
765 local oldsandbox="${SANDBOX_ON}" 670 local oldsandbox="${SANDBOX_ON}"
766 export SANDBOX_ON="0" 671 export SANDBOX_ON="0"
767 if useq ppc-macos ; then 672 if [[ "${USERLAND}" == "Darwin" ]]; then
768 if [ ! -z "${eextra}" ]; 673 if [ ! -z "${eextra}" ];
769 then 674 then
770 einfo "Extra options are not supported on macos yet" 675 einfo "Extra options are not supported on Darwin/OS X yet"
771 einfo "Please report the ebuild along with the info below" 676 einfo "Please report the ebuild along with the info below"
772 einfo "eextra: ${eextra}" 677 einfo "eextra: ${eextra}"
773 die "Required function missing" 678 die "Required function missing"
774 fi 679 fi
775 680
780 [ -z "`egetent group ${egid}`" ] && break 685 [ -z "`egetent group ${egid}`" ] && break
781 done 686 done
782 esac 687 esac
783 dscl . create /groups/${egroup} gid ${egid} 688 dscl . create /groups/${egroup} gid ${egid}
784 dscl . create /groups/${egroup} passwd '*' 689 dscl . create /groups/${egroup} passwd '*'
785 elif use x86-fbsd ; then 690 elif [[ "${USERLAND}" == "BSD" ]] ; then
786 case ${egid} in 691 case ${egid} in
787 *[!0-9]*) # Non numeric 692 *[!0-9]*) # Non numeric
788 for egid in `jot 898 101`; do 693 for egid in `jot 898 101`; do
789 [ -z "`egetent group ${egid}`" ] && break 694 [ -z "`egetent group ${egid}`" ] && break
790 done 695 done
937 *) 842 *)
938 type= 843 type=
939 ;; 844 ;;
940 esac 845 esac
941 fi 846 fi
942 847 if [ "${SLOT}" == "0" ] ; then
848 local desktop_name="${PN}"
849 else
850 local desktop_name="${PN}-${SLOT}"
851 fi
943 local desktop=${T}/${exec%% *}-${P}.desktop 852 local desktop=${T}/${exec%% *}-${desktop_name}.desktop
944 853
945echo "[Desktop Entry] 854echo "[Desktop Entry]
946Encoding=UTF-8 855Encoding=UTF-8
947Version=0.9.2 856Version=0.9.2
948Name=${name} 857Name=${name}
1525 while ((i--)) ; do 1434 while ((i--)) ; do
1526 ewarn "PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass" 1435 ewarn "PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass"
1527 done 1436 done
1528 export EUTILS_ECLASS_PORTAGE_ARCH="${ARCH}" 1437 export EUTILS_ECLASS_PORTAGE_ARCH="${ARCH}"
1529 case ${ARCH} in 1438 case ${ARCH} in
1530 x86) export ARCH="i386";; 1439 x86) export ARCH="i386";;
1531 amd64) export ARCH="x86_64";; 1440 amd64) export ARCH="x86_64";;
1532 hppa) export ARCH="parisc";; 1441 hppa) export ARCH="parisc";;
1533 mips) export ARCH="mips";; 1442 mips) export ARCH="mips";;
1534 sparc) export ARCH="$(tc-arch-kernel)";; # Yeah this is ugly, but it's even WORSE if you don't do this. linux-info.eclass's set_arch_to_kernel is fixed, but won't get used over this one! 1443 sparc) export ARCH="$(tc-arch-kernel)";; # Yeah this is ugly, but it's even WORSE if you don't do this. linux-info.eclass's set_arch_to_kernel is fixed, but won't get used over this one!
1535 *) export ARCH="${ARCH}";; 1444 *) export ARCH="${ARCH}";;
1536 esac 1445 esac
1537} 1446}
1538 1447
1539# set's ARCH back to what portage expects 1448# set's ARCH back to what portage expects
1540set_arch_to_portage() { 1449set_arch_to_portage() {
1647dopamd() { 1556dopamd() {
1648 [[ -z $1 ]] && die "dopamd requires at least one argument" 1557 [[ -z $1 ]] && die "dopamd requires at least one argument"
1649 1558
1650 use pam || return 0 1559 use pam || return 0
1651 1560
1652 insinto /etc/pam.d 1561 INSDESTTREE=/etc/pam.d \
1653 doins "$@" || die "failed to install $@" 1562 doins "$@" || die "failed to install $@"
1654} 1563}
1655# newpamd <old name> <new name> 1564# newpamd <old name> <new name>
1656# 1565#
1657# Install pam file <old name> as <new name> in /etc/pam.d 1566# Install pam file <old name> as <new name> in /etc/pam.d
1658newpamd() { 1567newpamd() {
1659 [[ $# -ne 2 ]] && die "newpamd requires two arguements" 1568 [[ $# -ne 2 ]] && die "newpamd requires two arguements"
1660 1569
1661 use pam || return 0 1570 use pam || return 0
1662 1571
1663 insinto /etc/pam.d 1572 INSDESTTREE=/etc/pam.d \
1664 newins "$1" "$2" || die "failed to install $1 as $2" 1573 newins "$1" "$2" || die "failed to install $1 as $2"
1665} 1574}
1666 1575
1667# make a wrapper script ... 1576# make a wrapper script ...
1668# NOTE: this was originally games_make_wrapper, but I noticed other places where 1577# NOTE: this was originally games_make_wrapper, but I noticed other places where

Legend:
Removed from v.1.171  
changed lines
  Added in v.1.182

  ViewVC Help
Powered by ViewVC 1.1.20