Ignore:
Timestamp:
May 4, 2017, 12:08:25 PM (2 years ago)
Author:
Juanma
Message:

Fixed packages that directly copy the desktop to a specific location in the install file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devtools/desktop_to_xml/desktop_to_xml.sh

    r4555 r4566  
    2222msg_icon_exists="\nIcon package found on the right location. Assuming llxsrc helper exists in rules\n"
    2323msg_work_done="\n----------\n\nWork done. If the process has no errors please check that the appfile.xml is right and that the rules file has the llxsrc helper. Also check that the icon is present in llx-resources.\nIn other case correct the errors and relaunch the script.\n\nRemember that the generated appfile.xml isn't a full one and is missing some fields like the screenshots. Take a cup of coffee and fulfill the empty fields following the specs at https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Application.html\n\n"
    24 msg_install_not_found="No install file present in debian dir. Aborting.\n"
     24msg_install_not_found="Install file not found in debian dir. Aborting.\n"
    2525msg_select_workdir="Select the workdir\n"
    2626msg_debhelper_enabled="package type llxsrc detected. Setting llx-resources as workdir\n"
     
    6060        index=0
    6161        let count--
    62         if [ $count -gt 0 ]
    63         then
    64                 printf "$msg_select_file"
    65                 for i in `seq 0 ${count}`
    66                 do
    67                         printf "${i}) ${installFiles[$i]}\n"
    68                 done
    69                 printf "Select file [0]: "
    70                 read index
    71                 [ -z $index ] && index=0
    72                 installFile=${installFiles[$index]}
    73                 printf "$msg_selected_file" $installFile
    74                 process_installFile ${installFile}
    75         elif [[ $installFiles[0]=='*install' ]]
     62        if [[ ${installFiles[0]} = '*install' ]]
    7663        then
    7764                printf "$msg_install_not_found"
    7865                get_workdir
    7966                debhelper_mode=1
     67        else
     68                if [ $count -gt 0 ]
     69                then
     70                        printf "$msg_select_file"
     71                        for i in `seq 0 ${count}`
     72                        do
     73                                printf "${i}) ${installFiles[$i]}\n"
     74                        done
     75                        printf "Select file [0]: "
     76                        read index
     77                        [ -z $index ] && index=0
     78                        installFile=${installFiles[$index]}
     79                else
     80                        installFile=${installFiles[0]}
     81                fi
     82                printf "$msg_selected_file" $installFile
     83                process_installFile ${installFile}
    8084        fi
    8185}
     
    109113{
    110114        installFile=$1
     115        wc -l $installFile
    111116        if [ `wc -l $installFile  | cut -f1 -d ' '` -gt 1 ]
    112117        then
     
    134139{
    135140        cd $rootDir"/"$srcDir
    136         printf "Entering $1\n"
    137         cd $1
     141        wrkDir=$1
     142        printf "Entering $wrkDir\n"
     143        if [ -d wrkDir ]
     144        then
     145                cd $wrkDir
     146        else
     147                wrkDir=`dirname $wrkDir`
     148                cd $wrkDir
     149        fi
     150
    138151        #Find the desktop file of the application
    139152        desktopFiles=$(find . -name "*.desktop")
     
    142155        do
    143156                cd $rootDir"/"$srcDir
    144                 printf "Entering $1\n"
    145                 cd $1
    146                 metainfoDir=`dirname $desktopFile`
    147                 metainfoDir=`dirname $metainfoDir`"/metainfo"
     157                printf "Entering $wrkDir\n"
     158                cd $wrkDir
     159                #If workdir != $1 then it means that the install file has a file and not a dir
     160                #In this case we assume that the install is putting the desktop file so metainfoDir becames llx-resources directly
     161                if [[ $wrkDir != $1 ]]
     162                then
     163                        appName=$(basename $pkgDir)
     164                        metainfoDir=${rootDir}"/"${srcDir}"/llx-resources/"${appName}
     165                else
     166                        metainfoDir=`dirname $desktopFile`
     167                        metainfoDir=`dirname $metainfoDir`
     168                fi
     169                metainfoDir=$metainfoDir"/metainfo"
    148170                mkdir $metainfoDir -p
    149171                parse_desktop $metainfoDir $desktopFile
     
    305327                        cd $srcDir
    306328                        appName=$(basename $pkgDir)
    307                         resourcesDir="llx-resources/"${appName}"/icons/"
     329                        resourcesDir="llx-resources/"${appName}"/icons/apps/"
    308330                        mkdir $resourcesDir -p
    309331                        cd $OLDPWD
Note: See TracChangeset for help on using the changeset viewer.