Changeset 932


Ignore:
Timestamp:
Dec 3, 2010, 4:24:59 PM (14 years ago)
Author:
joergs
Message:

added /etc/profile.d/dasscm.sh

Location:
dasscm/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • dasscm/trunk/dasscm.spec

    r928 r932  
    5353install -m 755 usr/bin/dasscm $RPM_BUILD_ROOT/usr/bin/
    5454install -m 755 usr/bin/dasscm_remote_update.sh $RPM_BUILD_ROOT/usr/bin/
     55mkdir -p $RPM_BUILD_ROOT/var/lib/dasscm/
     56mkdir -p $RPM_BUILD_ROOT/var/lib/dasscm/plugin-results/
     57
    5558mkdir -p $RPM_BUILD_ROOT/etc/
    5659install -m 640 etc/dasscm.conf $RPM_BUILD_ROOT/etc/
    57 mkdir -p $RPM_BUILD_ROOT/var/lib/dasscm/
    58 mkdir -p $RPM_BUILD_ROOT/var/lib/dasscm/plugin-results/
     60mkdir -p $RPM_BUILD_ROOT/etc/profile.d/
     61install -m 644 etc/profile.d/dasscm.sh $RPM_BUILD_ROOT/etc/profile.d/
     62
    5963%if %(test -d /etc/bash_completion.d/ && echo 1 || echo 0)
    6064    %define use_bash_completion 1
  • dasscm/trunk/etc/dasscm.conf

    r925 r932  
    3232#DASSCM_CHECKOUT_USERNAME=dasscm
    3333#DASSCM_CHECKOUT_PASSWORD=
     34
     35#
     36# evaluated by /etc/profile.d/dasscm.sh
     37# If set to "yes",
     38# a "dasscm status" is executed during shell login
     39#
     40DASSCM_STATUS_AT_SHELL_LOGIN="yes"
    3441
    3542#
  • dasscm/trunk/etc/profile.d/dasscm.sh

    r777 r932  
    11#!/bin/sh
    22
    3 if [ `whoami` = "root" ]; then
    4   if ! dasscm check > /dev/null; then
    5     printf "* DASSCM warnings *\n"
    6     dasscm status
    7     printf "* please check-in these changes first *\n"
    8   fi
     3CONFIG="/etc/dasscm.conf"
     4
     5if [ -r $CONFIG ]; then
     6    source $CONFIG
     7
     8    # check if a warn message is wanted
     9    # and dasscm is already configured ($DASSCM_REPOSITORY_NAME)
     10    if [ "$DASSCM_STATUS_AT_SHELL_LOGIN" = "yes" -a -n "$DASSCM_REPOSITORY_NAME" ]; then
     11
     12        # check if write permissions are given
     13        if [ -w "${DASSCM_LOCAL_REPOSITORY_BASE}/${DASSCM_REPOSITORY_NAME}" ]; then
     14
     15            # get dasscm status
     16            # and print it, if a result is given
     17            RESULT=`dasscm status`
     18            if [ $? -ne 0 ]; then
     19                printf "* DASSCM warnings *\n"
     20                printf "$RESULT\n"
     21                printf "* please use dasscm to check-in these changes *\n"
     22            fi
     23        fi
     24    fi
    925fi
    10 
    11 # TODO: check configured
    12 # alternative for non-root: X=`echo | sudo -S dasscm check`
Note: See TracChangeset for help on using the changeset viewer.