Check-in [3782b41e52]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:3782b41e527bb69277cd7feacb54111ce676659c
Date: 2012-09-26 10:33:49
User: BarryK
Comment:fix if .desktop files in /usr/local/share/applications, momanager: accumulate many .desktop files in /usr/share/applications.in

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/usr/local/petget/installpkg.sh

@@ -425,46 +425,47 @@
   sed -i -e "$iPATTERN" $ONEDOT #note, ONEDOT is name of .desktop file.
  fi
 
  #120926 if a langpack installed, it will have /usr/share/applications.in (see /usr/sbin/momanager, /usr/share/doc/langpack-template/pinstall.sh).
  ABASEDESKTOP="`basename $ONEDOT`"
+ ADIRDESKTOP="`dirname $ONEDOT`"
  if [ -f /usr/share/applications.in/${ABASEDESKTOP} ];then
   TARGETLANG="`echo -n $LANG_USER | cut -f 1 -d '_'`" #ex: de
   tlPTN="^Name\[${TARGETLANG}\]"
-  if [ "$(grep "$tlPTN" /usr/share/applications/${ABASEDESKTOP})" = "" ];then
+  if [ "$(grep "$tlPTN" ${ADIRDESKTOP}/${ABASEDESKTOP})" = "" ];then
    if [ "$(grep "$tlPTN" /usr/share/applications.in/${ABASEDESKTOP})" != "" ];then
     #aaargh, these accursed back-slashes! ....
     INSERTALINE="`grep "$tlPTN" /usr/share/applications.in/${ABASEDESKTOP} | sed -e 's%\[%\\\\[%' -e 's%\]%\\\\]%'`"
-    sed -i -e "s%^Name=%${INSERTALINE}\\nName=%" /usr/share/applications/${ABASEDESKTOP}
+    sed -i -e "s%^Name=%${INSERTALINE}\\nName=%" ${ADIRDESKTOP}/${ABASEDESKTOP}
    fi
   fi
   #do same for Comment field...
   tlPTN="^Comment\[${TARGETLANG}\]"
-  if [ "$(grep "$tlPTN" /usr/share/applications/${ABASEDESKTOP})" = "" ];then
+  if [ "$(grep "$tlPTN" ${ADIRDESKTOP}/${ABASEDESKTOP})" = "" ];then
    if [ "$(grep "$tlPTN" /usr/share/applications.in/${ABASEDESKTOP})" != "" ];then
     #aaargh, these accursed back-slashes! ....
     INSERTALINE="`grep "$tlPTN" /usr/share/applications.in/${ABASEDESKTOP} | sed -e 's%\[%\\\\[%' -e 's%\]%\\\\]%'`"
-    sed -i -e "s%^Comment=%${INSERTALINE}\\nComment=%" /usr/share/applications/${ABASEDESKTOP}
+    sed -i -e "s%^Comment=%${INSERTALINE}\\nComment=%" ${ADIRDESKTOP}/${ABASEDESKTOP}
    fi
   fi
   #well, i suppose need this too...
   TARGETLANG="`echo -n $LANG_USER | cut -f 1 -d '.'`" #ex: de_DE
   tlPTN="^Name\[${TARGETLANG}\]"
-  if [ "$(grep "$tlPTN" /usr/share/applications/${ABASEDESKTOP})" = "" ];then
+  if [ "$(grep "$tlPTN" ${ADIRDESKTOP}/${ABASEDESKTOP})" = "" ];then
    if [ "$(grep "$tlPTN" /usr/share/applications.in/${ABASEDESKTOP})" != "" ];then
     #aaargh, these accursed back-slashes! ....
     INSERTALINE="`grep "$tlPTN" /usr/share/applications.in/${ABASEDESKTOP} | sed -e 's%\[%\\\\[%' -e 's%\]%\\\\]%'`"
-    sed -i -e "s%^Name=%${INSERTALINE}\\nName=%" /usr/share/applications/${ABASEDESKTOP}
+    sed -i -e "s%^Name=%${INSERTALINE}\\nName=%" ${ADIRDESKTOP}/${ABASEDESKTOP}
    fi
   fi
   #do same for Comment field...
   tlPTN="^Comment\[${TARGETLANG}\]"
-  if [ "$(grep "$tlPTN" /usr/share/applications/${ABASEDESKTOP})" = "" ];then
+  if [ "$(grep "$tlPTN" ${ADIRDESKTOP}/${ABASEDESKTOP})" = "" ];then
    if [ "$(grep "$tlPTN" /usr/share/applications.in/${ABASEDESKTOP})" != "" ];then
     #aaargh, these accursed back-slashes! ....
     INSERTALINE="`grep "$tlPTN" /usr/share/applications.in/${ABASEDESKTOP} | sed -e 's%\[%\\\\[%' -e 's%\]%\\\\]%'`"
-    sed -i -e "s%^Comment=%${INSERTALINE}\\nComment=%" /usr/share/applications/${ABASEDESKTOP}
+    sed -i -e "s%^Comment=%${INSERTALINE}\\nComment=%" ${ADIRDESKTOP}/${ABASEDESKTOP}
    fi
   fi
  fi
 
 done

Changes to woof-code/rootfs-skeleton/usr/sbin/momanager

@@ -35,10 +35,11 @@
 #120216 small mod. to a message.
 #120729 L18L: problem gettext'ing zigbert's apps, which have a lot of scripts, but would like to combine into one .pot file.
 #120731 revert 120729.
 #120731 any script can have a pre-existing .pot file in /usr/share/doc/nls, it will automatically be used instead of generating a .pot file.
 #120731 multiple scripts can have the same TEXTDOMAIN. these scripts can be anywhere. a single .pot will be created/edited.
+#120926 want to accumulate many .desktop files (not just for installed pkgs), in /usr/share/applications.in.
 
 #***MOMANAGER IS ENGLISH ONLY (NOT GETTEXT'ED)***
 #it is for use by developers/translators with knowledge of english.
 
 PARAM1=""
@@ -1498,11 +1499,18 @@
   do
    ADIR="`dirname "$ALINE"`"
    mkdir -p /root/langpack_${GENLANG}-${ADATE}"${ADIR}"
    cp -a -f "$ALINE" /root/langpack_${GENLANG}-${ADATE}"${ADIR}"/
   done
-  mv -f /root/langpack_${GENLANG}-${ADATE}/usr/share/applications /root/langpack_${GENLANG}-${ADATE}/usr/share/applications.in
+
+  #120926 want to accumulate many .desktop files (not just for installed pkgs), in /usr/share/applications.in...
+  mkdir -p /root/langpack_${GENLANG}-${ADATE}/usr/share/applications.in
+  cp -a -f /usr/share/applications.in/* /root/langpack_${GENLANG}-${ADATE}/usr/share/applications.in/
+  cp -a -f /root/langpack_${GENLANG}-${ADATE}/usr/share/applications/* /root/langpack_${GENLANG}-${ADATE}/usr/share/applications.in/
+  rm -r -f /root/langpack_${GENLANG}-${ADATE}/usr/share/applications
+  pupdialog --background 'yellow' --backtitle "Menu .desktop files" --colors --msgbox "Translated .desktop files are now in \Zb/root/langpack_${GENLANG}-${ADATE}/usr/share/applications.in\ZB, and the translations will be inserted into same-name .desktop files in /usr/share/applications or /usr/local/share/applications when the langpack PET pkg is installed, and when the PPM installs a pkg. However, please do note that you can manually accumulate as many .desktop files in /usr/share/applications.in in your host Puppy system as you want, not just for installed pkgs, and MoManager will copy all of these into the langpack. For example, say that you have translated .desktop files for OpenOffice -- put them into \Zb/usr/share/applications.in\ZB -- it doesn't matter that the Puppy in which the langpack will be installed does not (yet) have OpenOffice installed. This operation has already been performed." 0 0
+
   mv -f /root/langpack_${GENLANG}-${ADATE}/usr/share/desktop-directories /root/langpack_${GENLANG}-${ADATE}/usr/share/desktop-directories.in
   #120313 offer to find more...
   pupdialog --background 'orange' --backtitle "Langpack PET almost done" --colors --yes-label "Build PET" --no-label "Find all" --yesno "The langpack has been assembled in folder /root/langpack_${GENLANG}-${ADATE}, ready to be made into a PET. Click \ZbBuild PET\ZB to do this now. However, if you want, you can click \ZbFind all\ZB to tell MoManager to hunt for any other mo, po, pot, t12s translation files in the system, plus ${ORIGLANG1} hunspell dictionary, and include those in the PET..." 0 0
   if [ $? -eq 1 ];then
    find /usr -type f -name '*.po' -o -name '*.mo' | grep "/${ORIGLANG1}[/_.]" |

Changes to woof-code/rootfs-skeleton/usr/share/doc/langpack-template/pinstall.sh

@@ -17,24 +17,27 @@
 
 if [ -d usr/share/applications.in ];then #refer: /usr/sbin/momanager
  for ADESKTOPFILE in `find usr/share/applications.in -mindepth 1 -maxdepth 1 -type f -name '*.desktop' | tr '\n' ' '`
  do
   ABASEDESKTOP="`basename $ADESKTOPFILE`"
-  if [ -f usr/share/applications/${ABASEDESKTOP} ];then
-   if [ "`grep '^Name\[TARGETLANG\]' usr/share/applications/${ABASEDESKTOP}`" = "" ];then
+  ADIRDESKTOP=''
+  [ -f usr/share/applications/${ABASEDESKTOP} ] && ADIRDESKTOP='usr/share/applications'
+  [ ! "$ADIRDESKTOP" ] && [ -f usr/local/share/applications/${ABASEDESKTOP} ] && ADIRDESKTOP='usr/local/share/applications'
+  if [ "$ADIRDESKTOP" ];then
+   if [ "`grep '^Name\[TARGETLANG\]' ${ADIRDESKTOP}/${ABASEDESKTOP}`" = "" ];then
     if [ "`grep '^Name\[TARGETLANG\]' usr/share/applications.in/${ABASEDESKTOP}`" != "" ];then
      #aaargh, these accursed back-slashes! ....
      INSERTALINE="`grep '^Name\[TARGETLANG\]' usr/share/applications.in/${ABASEDESKTOP} | sed -e 's%\[%\\\\[%' -e 's%\]%\\\\]%'`"
-     sed -i -e "s%^Name=%${INSERTALINE}\\nName=%" usr/share/applications/${ABASEDESKTOP}
+     sed -i -e "s%^Name=%${INSERTALINE}\\nName=%" ${ADIRDESKTOP}/${ABASEDESKTOP}
     fi
    fi
    #120926 do same for Comment field...
-   if [ "`grep '^Comment\[TARGETLANG\]' usr/share/applications/${ABASEDESKTOP}`" = "" ];then
+   if [ "`grep '^Comment\[TARGETLANG\]' ${ADIRDESKTOP}/${ABASEDESKTOP}`" = "" ];then
     if [ "`grep '^Comment\[TARGETLANG\]' usr/share/applications.in/${ABASEDESKTOP}`" != "" ];then
      #aaargh, these accursed back-slashes! ....
      INSERTALINE="`grep '^Comment\[TARGETLANG\]' usr/share/applications.in/${ABASEDESKTOP} | sed -e 's%\[%\\\\[%' -e 's%\]%\\\\]%'`"
-     sed -i -e "s%^Comment=%${INSERTALINE}\\nComment=%" usr/share/applications/${ABASEDESKTOP}
+     sed -i -e "s%^Comment=%${INSERTALINE}\\nComment=%" ${ADIRDESKTOP}/${ABASEDESKTOP}
     fi
    fi
   fi
  done
  #rm -r -f usr/share/applications.in