1#!/bin/sh
2
3if [ $# -ne 2 ]; then
4  echo "You need to supply two arguments, e.g.:"
5  echo "$0 mimetypes/text-plain mimetypes/text-x-generic"
6  exit
7fi
8
9# Split the two arguments into their category and icon name parts.
10src="$1"
11src_category=${src%/*}
12src_icon=${src#*/}
13
14dest="$2"
15dest_category=${dest%/*}
16dest_icon=${dest#*/}
17
18# Copy the scalable icon.
19if [ -f scalable/$src.svgz ]; then
20  echo "Copying scalable/$src.svgz to scalable/$dest.svgz..."
21  svn cp scalable/$src.svgz scalable/$dest.svgz
22  echo
23fi
24
25# Copy the optimized small versions of the icon.
26for dir in 8x8 16x16 22x22 32x32 48x48 64x64 128x128 256x256; do
27  if [ -f scalable/$src_category/small/$dir/$src_icon.svgz ]; then
28    echo "Copying scalable/$src_category/small/$dir/$src_icon.svgz"
29    echo "     to scalable/$dest_category/small/$dir/$dest_icon.svgz..."
30    svn cp scalable/$src_category/small/$dir/$src_icon.svgz scalable/$dest_category/small/$dir/$dest_icon.svgz
31    echo
32  fi
33done
34
35# Copy the rendered PNGs.
36for dir in 8x8 16x16 22x22 32x32 48x48 64x64 128x128 256x256; do
37  if [ -f $dir/$src.png ]; then
38    echo "Copying $dir/$src.png to $dir/$dest.png..."
39    svn cp $dir/$src.png $dir/$dest.png
40    echo
41  fi
42done
43