Ticket #13504: 0003-cleanup-remove-cpsvndir-cpsimple-scripts-from-mythpl.patch

File 0003-cleanup-remove-cpsvndir-cpsimple-scripts-from-mythpl.patch, 2.7 KB (added by Gary Buhrmaster, 4 years ago)
  • deleted file mythplugins/cpsimple

    From 45741c1de98215ef2b08985ab67fc6f3875b5743 Mon Sep 17 00:00:00 2001
    From: Gary Buhrmaster <gary.buhrmaster@gmail.com>
    Date: Thu, 7 Nov 2019 16:21:05 +0000
    Subject: [PATCH 3/6] cleanup: remove cpsvndir/cpsimple scripts from
     mythplugins
    
    ---
     mythplugins/cpsimple | 17 ------------
     mythplugins/cpsvndir | 66 --------------------------------------------
     2 files changed, 83 deletions(-)
     delete mode 100644 mythplugins/cpsimple
     delete mode 100644 mythplugins/cpsvndir
    
    diff --git a/mythplugins/cpsimple b/mythplugins/cpsimple
    deleted file mode 100644
    index a94007e978..0000000000
    + -  
    1 #!/bin/sh
    2 #
    3 # cpsimple: recursive directory copy, then delete .svn sub dirs.
    4 
    5 if [ $(basename "$1") = $(basename "$2") -a -d $2 ]; then
    6   DESTDIR=$(dirname "$2")
    7 else
    8   DESTDIR=$2
    9 fi
    10 
    11 echo cp -pr $1 $DESTDIR
    12 cp -pr $1 $DESTDIR
    13 
    14 echo find $2 '-name .svn -prune -exec rm -fr {} \;'
    15 find $2 -name .svn -prune -exec rm -fr {} \;
    16 
    17 exit 0
  • deleted file mythplugins/cpsvndir

    diff --git a/mythplugins/cpsvndir b/mythplugins/cpsvndir
    deleted file mode 100644
    index 8486a616cc..0000000000
    + -  
    1 #!/bin/sh
    2 #
    3 # cpsvndir: recursive directory copy excluding .svn sub dirs.
    4 
    5 if [ -z "$1" -o -z "$2" ]; then
    6     echo "Usage: $0 source-dir destination-dir"
    7     exit -1
    8 fi
    9 
    10 # Some shells don't set EUID
    11 if [ -z "$EUID" ]; then
    12     if [ -x /usr/bin/id ]; then EUID=`id -u` ;fi
    13     if [ -z "$EUID" ];     then EUID=$USER   ;fi
    14     if [ -z "$EUID" ];     then EUID=0       ;fi  # Will fail if not root
    15 fi
    16 
    17 # Do similarly for EGID
    18 if [ -z "$EGID" ]; then
    19     if [ -x /usr/bin/id ]; then EGID=`id -g` ;fi
    20     if [ -z "$EGID" ];     then EGID=0       ;fi  # Will fail if not root
    21 fi
    22 
    23 BASE=$(basename "$1")
    24 case "$BASE" in
    25     .|..|/)  BASE="" ;;
    26     *)       BASE="/$BASE" ;;
    27 esac
    28 
    29 SRC="$1"
    30 
    31 case "$2" in
    32     /*) DEST="$2$BASE" ;;
    33     *)  DEST="$(pwd)/$2$BASE" ;;
    34 esac
    35 
    36 #echo "BASE=$BASE SRC=$SRC DEST=$DEST"
    37 
    38 IFS='
    39 '
    40 if [ ! -z ${MYTHPYTHON} ]; then
    41     if [ ! -f ${MYTHPYTHON} ]; then
    42         MYTHPYTHON="/usr/bin/env ${MYTHPYTHON}"
    43     fi
    44 fi
    45 
    46 # Copy all files and directories except .svn
    47 cd "$SRC"
    48 for file in $(find . -name .svn -prune -or -print); do
    49     #echo "processing $file"
    50     if [ -d "$file" -a ! -L "$file" ]; then
    51         mkdir -p "$DEST/$file"
    52     else
    53         cp -pR "$file" "$DEST/$file"
    54         ext=${file##*.}
    55         if [ "x$ext" = "xpy" ]; then
    56             sed "1s%^#.*%#!${MYTHPYTHON}%" "$file" > "$DEST/$file"
    57 #        elif [ "x$ext" = "xpl" ]; then
    58 #            do some perly stuff
    59         fi
    60         chown -h $EUID:$EGID "$DEST/$file"
    61         chmod +r "$DEST/$file" &> /dev/null
    62     fi
    63 done
    64 
    65 exit 0
    66