# HG changeset patch # User Christopher Rogers # Date 1340160366 0 # Node ID 0d853e0032ef3484d3b41454db6e136501d8f6b1 # Parent abfee2306690ef510a9483fe240ba3d6bd013656 cook: Updated copy_generic_files function to be more like in slitaz-tank branch. diff -r abfee2306690 -r 0d853e0032ef cook --- a/cook Wed Jun 20 02:41:13 2012 +0000 +++ b/cook Wed Jun 20 02:46:06 2012 +0000 @@ -313,9 +313,10 @@ # Copy all generic files (locale, pixmaps, .desktop). We use standard paths, # so some packages need to copy these files with the receipt and genpkg_rules. -copy_generic_files() { +copy_generic_files() +{ # $LOCALE is set in cook.conf - if [ "$LOCALE" ]; then + if [ "$LOCALE" -a "$WANTED" = "" ]; then if [ -d "$install/usr/share/locale" ]; then mkdir -p $fs/usr/share/locale for i in $LOCALE @@ -331,10 +332,13 @@ if [ "$GENERIC_PIXMAPS" != "no" ]; then if [ -d "$install/usr/share/pixmaps" ]; then mkdir -p $fs/usr/share/pixmaps - cp -a $install/usr/share/pixmaps/$PACKAGE.png \ - $fs/usr/share/pixmaps 2>/dev/null || continue - cp -a $install/usr/share/pixmaps/$PACKAGE.xpm \ - $fs/usr/share/pixmaps 2>/dev/null || continue + if [ -f "$install/usr/share/pixmaps/$PACKAGE.png" ]; then + cp -a $install/usr/share/pixmaps/$PACKAGE.png \ + $fs/usr/share/pixmaps + elif [ -f "$install/usr/share/pixmaps/$PACKAGE.xpm" ]; then + cp -a $install/usr/share/pixmaps/$PACKAGE.xpm \ + $fs/usr/share/pixmaps + fi fi # Custom or homemade PNG pixmap can be in stuff. @@ -348,6 +352,7 @@ # Generic desktop entry copy can be disabled with GENERIC_MENUS="no" if [ "$GENERIC_MENUS" != "no" ]; then if [ -d "$install/usr/share/applications" ] && [ "$WANTED" == "" ]; then + mkdir -p $fs/usr/share cp -a $install/usr/share/applications $fs/usr/share fi fi @@ -361,6 +366,12 @@ mkdir -p $fs/usr/share/applications cp -a $stuff/$PACKAGE.desktop $fs/usr/share/applications fi + + # Add custom licenses + if [ -d "$stuff/licenses" ]; then + mkdir -p $fs/usr/share/licenses + cp -a $stuff/licenses $fs/usr/share/licenses/$PACKAGE + fi } # Find and strip : --strip-all (-s) or --strip-debug on static libs as well