]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
simplify code
authorRudolf Polzer <divverent@alientrap.org>
Mon, 23 Jan 2012 19:19:45 +0000 (20:19 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Mon, 23 Jan 2012 19:19:45 +0000 (20:19 +0100)
install-dylibs.sh

index 9f4e3e2b9a349b64c9915073b3dcf49c1cd7b8e8..1554b49cd69a7d2ec83da3b6145cced2d3bdbb25 100755 (executable)
@@ -24,29 +24,20 @@ finkgetdeps()
 finkgetdeps "$INSTALLDIR/radiant.$EXE"
 echo Warning: this only works if only ONE version of gtk-2.0 and pango is installed
 
-LAST=
-for LIB in "$MACLIBDIR"/gtk-2.0/*/loaders/libpixbufloader-bmp.so "$MACLIBDIR"/gdk-pixbuf-2.0/*/loaders/libpixbufloader-bmp.so; do
-       [ -f "$LIB" ] || continue
-       LAST=$LIB
-done
-cp -L "$LAST" "$INSTALLDIR"
-finkgetdeps "$LAST"
-
-LAST=
-for LIB in "$MACLIBDIR"/pango/*/modules/pango-basic-fc.so; do
-       [ -f "$LIB" ] || continue
-       LAST=$LIB
-done
-cp -L "$LAST" "$INSTALLDIR"
-finkgetdeps "$LAST"
+getlib()
+{
+       LAST=
+       for LIB in "$@"; do
+               [ -f "$LIB" ] || continue
+               LAST=$LIB
+       done
+       cp -L "$LAST" "$INSTALLDIR"
+       finkgetdeps "$LAST"
+}
 
-LAST=
-for LIB in "$MACLIBDIR"/pango/*/modules/pango-basic-x.so; do
-       [ -f "$LIB" ] || continue
-       LAST=$LIB
-done
-cp -L "$LAST" "$INSTALLDIR"
-finkgetdeps "$LAST"
+getlib "$MACLIBDIR"/gtk-2.0/*/loaders/libpixbufloader-bmp.so "$MACLIBDIR"/gdk-pixbuf-2.0/*/loaders/libpixbufloader-bmp.so
+getlib "$MACLIBDIR"/pango/*/modules/pango-basic-fc.so
+getlib "$MACLIBDIR"/pango/*/modules/pango-basic-x.so
 
 cp -L "$MACLIBDIR"/../etc/fonts/fonts.conf "$INSTALLDIR"
 cp -L "$MACLIBDIR"/../etc/fonts/fonts.dtd "$INSTALLDIR"