[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][ocaml-team/liquidsoap][master] Configure cache directory



Title: GitLab

Kyle Robbertze pushed to branch master at Debian OCaml Maintainers / liquidsoap

Commits:

  • 34e043a5
    by Kyle Robbertze at 2024-07-23T14:19:58+09:00
    Configure cache directory
    

2 changed files:

Changes:

  • debian/liquidsoap.postinst
    ... ... @@ -16,20 +16,30 @@ case "$1" in
    16 16
         ;;
    
    17 17
     esac
    
    18 18
     
    
    19
    -addgroup --system liquidsoap
    
    19
    +if ! getent group liquidsoap > /dev/null; then
    
    20
    +    addgroup --system liquidsoap
    
    21
    +fi
    
    20 22
     
    
    21 23
     # Create the new system account
    
    22
    -adduser --system --disabled-password --disabled-login \
    
    23
    ---home /usr/share/liquidsoap --ingroup liquidsoap liquidsoap
    
    24
    -usermod --append --groups audio liquidsoap
    
    24
    +id liquidsoap > dev/null 2>&1 || (
    
    25
    +    adduser --system --disabled-password --disabled-login \
    
    26
    +    --home /var/cache/liquidsoap --ingroup liquidsoap liquidsoap &&
    
    27
    +    usermod --append --groups audio liquidsoap
    
    28
    +)
    
    25 29
     
    
    26
    -# Add again /usr/share/liquidsoap if user was already created
    
    30
    +# Add /usr/share/liquidsoap
    
    27 31
     if ! test -d /usr/share/liquidsoap; then
    
    28 32
         mkdir /usr/share/liquidsoap
    
    29 33
     fi
    
    30 34
     
    
    35
    +# Add cache directory
    
    36
    +if ! test -d /var/cache/liquidsoap; then
    
    37
    +    mkdir /var/cache/liquidsoap
    
    38
    +fi
    
    39
    +
    
    31 40
     # Fix directories ownership
    
    32 41
     chown liquidsoap:liquidsoap /var/log/liquidsoap
    
    42
    +chown liquidsoap:liquidsoap /var/cache/liquidsoap
    
    33 43
     chown root:root /usr/share/liquidsoap
    
    34 44
     
    
    35 45
     #DEBHELPER#
    

  • debian/liquidsoap.postrm
    ... ... @@ -8,4 +8,10 @@ if [ "$1" = "purge" ] && [ -d /usr/share/liquidsoap ]; then
    8 8
         fi
    
    9 9
     fi
    
    10 10
     
    
    11
    +if [ "$1" = "purge" ] && [ -d /var/cache/liquidsoap ]; then
    
    12
    +    if ! rmdir /var/cache/liquidsoap; then
    
    13
    +        echo "leaving /var/cache/liquidsoap in place"
    
    14
    +    fi
    
    15
    +fi
    
    16
    +
    
    11 17
     #DEBHELPER#


  • Reply to: