Ignore:
Timestamp:
May 4, 2017, 8:24:36 AM (2 years ago)
Author:
Juanma
Message:

Automatic detection of llxsrc packages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devtools/desktop_to_xml/desktop_to_xml.sh

    r4554 r4555  
    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="\nNo install file present in debian dir. Aborting.\n"
     24msg_install_not_found="No install file present in debian dir. Aborting.\n"
     25msg_select_workdir="Select the workdir\n"
     26msg_debhelper_enabled="package type llxsrc detected. Setting llx-resources as workdir\n"
    2527function usage_help
    2628{
     
    6769                printf "Select file [0]: "
    6870                read index
     71                [ -z $index ] && index=0
     72                installFile=${installFiles[$index]}
     73                printf "$msg_selected_file" $installFile
     74                process_installFile ${installFile}
    6975        elif [[ $installFiles[0]=='*install' ]]
    7076        then
    7177                printf "$msg_install_not_found"
    72                 exit 1
    73         fi
    74         [ -z $index ] && index=0
    75         installFile=${installFiles[$index]}
    76         printf "$msg_selected_file" $installFile
    77         process_metainfo ${installFile}
    78 }
    79 
    80 function process_metainfo
     78                get_workdir
     79                debhelper_mode=1
     80        fi
     81}
     82
     83function get_workdir
     84{
     85                cd $rootDir
     86                cd $srcDir
     87                if [ -d llx-resources ]
     88                then
     89                        printf "$msg_debhelper_enabled"
     90                        installDir="llx-resources"
     91                else
     92                        printf "$msg_select_workdir"
     93                        count=0
     94                        declare -a dirArray
     95                        for directory in *
     96                        do
     97                                printf "${count}) $directory\n"
     98                                dirArray[$count]=$directory
     99                                let count++
     100                        done
     101                        printf "Selected Dir [0]: "
     102                        read index
     103                        installDir=${dirArray[$index]}
     104                fi
     105                process_pkg $installDir
     106}
     107
     108function process_installFile
    81109{
    82110        installFile=$1
     
    323351for parm in $@
    324352do
     353        debhelper_mode=0
    325354        analyze_dir $parm
    326355done
Note: See TracChangeset for help on using the changeset viewer.