File: icon-private-move.sh

package info (click to toggle)
oxygen-icons 4:4.4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 163,920 kB
  • sloc: sh: 227; makefile: 6
file content (58 lines) | stat: -rwxr-xr-x 1,599 bytes parent folder | download | duplicates (2)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh

if [ $# -ne 2 -a $# -ne 3 ]; then
  echo "You need to supply two arguments, e.g.:"
  echo "$0 actions/view-file-columns ../../../../kdebase/apps/dolphin/icons/"
  echo "...and optionally the namespace (e.g. \"ox\" or \"hi\") as third argument."
  exit
fi

# Split the two arguments into their category and icon name parts.
src="$1"
src_category=${src%/*}
src_icon=${src#*/}

destdir="$2"

ns="ox"
if [ $# -eq 3 ]; then
  ns="$3"
fi

svn add $destdir

# Move the scalable icon.
if [ -f scalable/$src.svgz ]; then
  echo "Moving scalable/$src.svgz to $destdir/${ns}sc-$src_category-$src_icon.svgz..."
  svn mv scalable/$src.svgz $destdir/${ns}sc-$src_category-$src_icon.svgz
  echo
fi

# Move the optimized small versions of the icon.
for size in 8 16 22 32 48 64 128; do
  dir="${size}x${size}"

  if [ -f scalable/$src_category/small/$dir/$src_icon.svgz ]; then
    echo "Moving scalable/$src_category/small/$dir/$src_icon.svgz"
    echo "    to $destdir/${ns}$size-$src_category-$src_icon.svgz..."

    # Generate the size dir for smaller SVGs (e.g. icons/22x22/) if necessary.
    if [ ! -d $destdir/small ]; then
      svn mkdir $destdir/small
    fi

    svn mv scalable/$src_category/small/$dir/$src_icon.svgz $destdir/small/${ns}$size-$src_category-$src_icon.svgz
    echo
  fi
done

# Move the rendered PNGs.
for size in 8 16 22 32 48 64 128; do
  dir="${size}x${size}"

  if [ -f $dir/$src.png ]; then
    echo "Moving $dir/$src.png to $destdir/${ns}$size-$src_category-$src_icon.png..."
    svn mv $dir/$src.png $destdir/${ns}$size-$src_category-$src_icon.png
    echo
  fi
done