Changeset 4609
- Timestamp:
- May 5, 2017, 2:26:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devtools/desktop_to_xml/desktop_to_xml.sh
r4589 r4609 13 13 msg_selected_file="\nSelected file: %s\n\n" 14 14 msg_select_dir="\nSelect the dir containing the desktop file:\n" 15 msg_gen_metainfo="Generating metainfo data path \n"15 msg_gen_metainfo="Generating metainfo data path %s\n" 16 16 msg_parsing_desktop="Parsing %s\n" 17 17 msg_metainfo_generated="\nMetainfo file generated.\n" … … 27 27 msg_rules_old_format="\n********** WARNING!!!! **********\nrules file has an old format.\nIt's HIGHLY recommended to update it to the new rules format.\n *************************** \n" 28 28 msg_select_pkg="\nSelect the name of the package to process\n" 29 msg_desktop_not_found="\nDesktop file not found at %s. Process aborted.\n" 29 30 30 31 function usage_help … … 178 179 #Find the desktop file of the application 179 180 desktopFiles=$(find . -name "*.desktop") 180 printf "$msg_gen_metainfo" 181 if [[ ! $desktopFiles ]] 182 then 183 printf "$msg_desktop_not_found" $wrkDir 184 exit 1 185 fi 181 186 for desktopFile in $desktopFiles 182 187 do … … 194 199 fi 195 200 metainfoDir=$metainfoDir"/metainfo" 201 printf "$msg_gen_metainfo" $metainfoDir 196 202 mkdir $metainfoDir -p 197 203 parse_desktop $metainfoDir $desktopFile … … 261 267 commentArrayIndex++ 262 268 } else if ($1=="Categories") { 269 customCat=0 270 countCat=0 263 271 split($2,array,";",seps) 264 272 for (catIndex in array) … … 266 274 if (array[catIndex]!="") 267 275 { 268 if (array[catIndex]~" LliureX-")276 if (array[catIndex]~"-") 269 277 { 278 customCat=1 270 279 split(array[catIndex],lliurexCats,"-",seps) 271 280 for (lliurexCatIndex in lliurexCats) … … 277 286 categoryArray[catIndex]="<category>"array[catIndex]"</category>" 278 287 } 288 countCat++ 279 289 } 290 } 291 if (customCat==1 && countCat==1) 292 { 293 if (substr($0,length($0),1)==";") 294 $0=$0"GTK" 295 else 296 $0=$0;"GTK" 280 297 } 281 298 } else if ($1=="Icon") { … … 285 302 $0=$1"="iconBaseName 286 303 # split(iconBaseName,array,".",seps) 287 tagIcon="<icon type=\" cached\">"iconBaseName"</icon>";304 tagIcon="<icon type=\"stock\">"iconBaseName"</icon>"; 288 305 } else if ($1=="Exec") { 289 306 if (execPrinted==0)
Note: See TracChangeset
for help on using the changeset viewer.