]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - gamepack-manager
Merge branch 'make-git-dependency-optional' into 'master'
[xonotic/netradiant.git] / gamepack-manager
1 #! /usr/bin/env bash
2
3 # get usage help this way:
4 # ./gamepack_manager -h
5
6 : "${CP:=cp -va}"
7 : "${CP_R:=cp -Rva}"
8 : "${GIT:=git}"
9 : "${SVN:=svn}"
10 : "${WGET:=wget}"
11 : "${ECHO:=echo}"
12 : "${MKDIR:=mkdir -v}"
13 : "${MKDIR_P:=mkdir -vp}"
14 : "${RM_R:=rm -vrf}"
15 : "${MV:=mv -v}"
16 : "${TAR:=tar}"
17 : "${UNZIPPER:=unzip}"
18
19 set -e
20
21 default_download_dir='build/download'
22 default_install_dir='build'
23
24 games_dir='games'
25 pack_suffix='Pack'
26
27 free_license_list='BSD GPL'
28
29 printRawDB () {
30 cat <<\EOF
31 #######################################################
32 #                                                     #
33 #  IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT  #
34 #                                                     #
35 #   Use two whitespaces or more as column separator   #
36 #                                                     #
37 #######################################################
38
39 #######################################################
40 # Obsolete packs                                      #
41 #######################################################
42
43 # Quake2World was renamed as Quetoo.
44 # JediAcademy and JediOutcast gamepacks are unusable.
45 # Other gamepacks have better version available.
46
47 # JediAcademy   no   proprietary  svn     svn://svn.icculus.org/gtkradiant-gamepacks/JAPack/branches/1.5/
48 # JediOutcast   no   proprietary  svn     svn://svn.icculus.org/gtkradiant-gamepacks/JK2Pack/branches/1.5/
49 # Kingpin       no   unknown      zip     http://download.kingpin.info/kingpin/editing/maps/map_editors/NetRadiant/addon/Kingpinpack.zip
50 # Neverball     no   proprietary  zip     http://ingar.intranifty.net/files/netradiant/gamepacks/NeverballPack.zip
51 # OpenArena     no   unknown      zip     http://ingar.intranifty.net/files/netradiant/gamepacks/OpenArenaPack.zip
52 # Quake2World   no   GPL          svn     svn://jdolan.dyndns.org/quake2world/trunk/gtkradiant
53 # Quake3        no   proprietary  svn     svn://svn.icculus.org/gtkradiant-gamepacks/Q3Pack/trunk/ 29
54 # Quake         no   proprietary  zip     http://ingar.intranifty.net/files/netradiant/gamepacks/QuakePack.zip
55 # Tremulous     no   proprietary  svn     svn://svn.icculus.org/gtkradiant-gamepacks/TremulousPack/branches/1.5/
56 # Tremulous     no   proprietary  zip     http://ingar.intranifty.net/files/netradiant/gamepacks/TremulousPack.zip
57 # Unvanquished  no   unknown      zip     http://ingar.intranifty.net/gtkradiant/files/gamepacks/UnvanquishedPack.zip
58 # Warfork       no   GPL          zip     https://cdn.discordapp.com/attachments/611741789237411850/659512520553267201/netradiant_warfork_gamepack.zip
59 # Warsow        no   GPL          svn     https://svn.bountysource.com/wswpack/trunk/netradiant/games/WarsowPack/
60 # Warsow        no   GPL          zip     http://ingar.intranifty.net/files/netradiant/gamepacks/WarsowPack.zip
61
62 #######################################################
63 # Usable packs                                        #
64 #######################################################
65
66 AlienArena      yes  GPL          svn     https://svn.code.sf.net/p/alienarena-cc/code/trunk/tools/netradiant_gamepack/AlienArenaPack
67 DarkPlaces      yes  GPL          svn     svn://svn.icculus.org/gtkradiant-gamepacks/DarkPlacesPack/branches/1.5/
68 Doom3           yes  proprietary  svn     svn://svn.icculus.org/gtkradiant-gamepacks/Doom3Pack/branches/1.5/
69 ET              yes  proprietary  svn     svn://svn.icculus.org/gtkradiant-gamepacks/ETPack/branches/1.5/
70 Heretic2        yes  proprietary  svn     svn://svn.icculus.org/gtkradiant-gamepacks/Her2Pack/branches/1.5/
71 Kingpin         yes  unknown      git     https://gitlab.com/netradiant/gamepacks/kingpin-mapeditor-support.git
72 Neverball       yes  proprietary  git     https://gitlab.com/netradiant/gamepacks/neverball-mapeditor-support.git
73 Nexuiz          yes  GPL          gitdir  git://git.icculus.org/divverent/nexuiz.git misc/netradiant-NexuizPack master
74 OpenArena       yes  GPL          git     https://github.com/NeonKnightOA/oagamepack.git
75 Osirion         yes  GPL          zip     http://ingar.intranifty.net/files/netradiant/gamepacks/OsirionPack.zip
76 Prey            yes  proprietary  svn     svn://svn.icculus.org/gtkradiant-gamepacks/PreyPack/trunk/
77 Q3Rally         yes  proprietary  svn     https://svn.code.sf.net/p/q3rallysa/code/tools/radiant-config/radiant15-netradiant/
78 Quake2          yes  proprietary  svn     svn://svn.icculus.org/gtkradiant-gamepacks/Q2Pack/branches/1.5/
79 Quake3          yes  proprietary  git     https://gitlab.com/netradiant/gamepacks/quake3-mapeditor-support.git
80 Quake4          yes  proprietary  svn     svn://svn.icculus.org/gtkradiant-gamepacks/Q4Pack/branches/1.5/
81 QuakeLive       yes  proprietary  git     https://gitlab.com/netradiant/gamepacks/quakelive-mapeditor-support.git
82 Quake           yes  GPL          zip     http://ingar.intranifty.net/files/netradiant/gamepacks/Quake1Pack.zip
83 Quetoo          yes  GPL          svn     svn://svn.icculus.org/gtkradiant-gamepacks/QuetooPack/branches/1.5/
84 SmokinGuns      yes  unknown      git     https://github.com/smokin-guns/smokinguns-mapeditor-support.git
85 SoF2            yes  unknown      git     https://gitlab.com/netradiant/gamepacks/sof2-mapeditor-support.git
86 STVEF           yes  unknown      git     https://gitlab.com/netradiant/gamepacks/stvef-mapeditor-support.git
87 Tremulous       yes  proprietary  git     https://gitlab.com/netradiant/gamepacks/tremulous-mapeditor-support.git
88 TurtleArena     yes  proprietary  git     https://github.com/Turtle-Arena/turtle-arena-radiant-pack.git
89 UFOAI           yes  proprietary  svn     svn://svn.icculus.org/gtkradiant-gamepacks/UFOAIPack/branches/1.5/
90 Unvanquished    yes  BSD          git     https://github.com/Unvanquished/unvanquished-mapeditor-support.git
91 UrbanTerror     yes  unknown      git     https://gitlab.com/netradiant/gamepacks/urbanterror-mapeditor-support.git
92 Warfork         yes  GPL          git     https://gitlab.com/netradiant/gamepacks/warfork-mapeditor-support.git
93 Warsow          yes  GPL          git     https://github.com/Warsow/NetRadiantPack.git
94 Wolf            yes  proprietary  svn     svn://svn.icculus.org/gtkradiant-gamepacks/WolfPack/branches/1.5/
95 WoP             yes  proprietary  git     https://github.com/PadWorld-Entertainment/wop-mapeditor-support.git
96 Xonotic         yes  GPL          git     https://gitlab.com/xonotic/netradiant-xonoticpack.git
97 ZEQ2Lite        yes  unknown      git     https://gitlab.com/netradiant/gamepacks/zeq2lite-mapeditor-support.git
98 EOF
99 }
100
101 if command -v gsed >/dev/null
102 then
103         SED=gsed
104 elif sed --help >/dev/null 2>&1
105 then
106         SED=sed
107 else
108         printf 'ERROR: GNU sed is missing\n' >&2
109         exit 1
110 fi
111
112 printRealPath ()
113 {
114         if command -v grealpath >/dev/null
115         then
116                 grealpath "${1}"
117         elif command -v realpath >/dev/null
118         then
119                 realpath "${1}"
120         elif command -v greadlink >/dev/null
121         then
122                 # test greadlink first as greadlink has the feature on macos
123                 # but readlink only has it on linux, note that it's probably
124                 # the same on bsd
125                 # note: (g)readlink requires the file to be create first
126                 greadlink -f "${1}"
127         elif command -v readlink >/dev/null
128         then
129                 # --help and -f options are GNU readlink things
130                 if readlink --help >/dev/null 2>&1
131                 then
132                         readlink -f "${1}"
133                 else
134                         if ! python -c "import os; print(os.path.realpath('${1}'))"
135                         then
136                                 printf 'ERROR: GNU realpath or other way to compute real path of a file is missing\n' >&2
137                                 exit 1
138                         fi
139                 fi
140         fi
141 }
142
143 sanitizeDB () {
144         ${SED} -e 's/#.*//;s/[ \t][ \t][ \t]*/\t/g;s/^[ \t]*//;s/[ \t]*$//' \
145         | grep -v '^$'
146 }
147
148 inList () {
149         [ "$(grep "^${1}$")" = "${1}" ]
150 }
151
152 printList () {
153         echo "${1}" \
154         | tr ' ' '\n' \
155         | grep -v '^$' \
156         | sort -u
157 }
158
159 dedupeList () {
160         printList "${1}" \
161         | tr '\n' ' ' \
162         | ${SED} -e 's/ $//'
163 }
164
165 printGamePackDB () {
166         printRawDB \
167         | sanitizeDB
168 }
169
170 printLicenseList () {
171         printGamePackDB \
172         | awk '{ print $3 }' \
173         | sort -u
174 }
175
176 printNameList () {
177         printGamePackDB \
178         | awk '{ print $1 }' \
179         | sort -u
180 }
181
182 printNameListByLicense () {
183         local arg_license_list
184         local license_list
185         local license
186
187         arg_license_list="${1}"
188         license_list=''
189
190         for license in ${arg_license_list}
191         do
192                 case "${license}" in
193                         'none')
194                                 break
195                                 ;;
196                         'all')
197                                 license_list="$(printLicenseList)"
198                                 break
199                                 ;;
200                         'free')
201                                 license_list="${license_list} ${free_license_list}"
202                                 ;;
203                         *)
204                                 if printLicenseList | inList "${license}"
205                                 then
206                                         license_list="${license_list} ${license}"
207                                 else
208                                         printError "unknown license: ${license}"
209                                 fi
210                                 ;;
211                 esac
212         done
213
214         license_list="$(dedupeList "${license_list}")"
215
216         for license in ${license_list}
217         do
218                 printGamePackDB \
219                 | awk '$3 == "'"${license}"'"' \
220                 | awk '{ print $1 }'
221         done | sort -u
222 }
223
224 printNameListByName () {
225         local argname_list
226         local name_list
227         local name
228
229         argname_list="${1}"
230         name_list=''
231
232         for name in ${argname_list}
233         do
234                 case "${name}" in
235                         'none')
236                                 break
237                                 ;;
238                         'all')
239                                 name_list="$(printNameList)"
240                                 break
241                                 ;;
242                         'validated')
243                                 name_list="${name_list} validated"
244                                 ;;
245                         *)
246                                 if printNameList | inList "${name}"
247                                 then
248                                         name_list="${name_list} ${name}"
249                                 else
250                                         printError "unknown name: ${name}"
251                                 fi
252                                 ;;
253                 esac
254         done
255
256         name_list="$(dedupeList "${name_list}")"
257
258         for name in ${name_list}
259         do
260                 if [ "${name}" = 'validated' ]
261                 then
262                         printGamePackDB \
263                         | awk '$2 == "yes"' \
264                         | awk '{ print $1 }'
265                 fi
266
267                 printGamePackDB \
268                 | awk '$1 == "'"${name}"'"' \
269                 | awk '{ print $1 }'
270         done
271 }
272
273 printPackLine () {
274         local name
275
276         name="${1}"
277
278         printGamePackDB \
279         | awk '$1 == "'"${name}"'"'
280 }
281
282 getValue () {
283         local name
284         local key
285
286         name="${1}"
287         key="${2}"
288
289         printPackLine "${name}" \
290         | awk '{ print $'"${key}"' }'
291 }
292
293 downloadExtraUrls ()
294 {
295         if [ -f 'extra-urls.txt' ]
296         then
297                 while IFS='     ' read -r extra_file extra_url
298                 do
299                         (
300                                 ${WGET} -O "${extra_file}" "${extra_url}"
301                         ) </dev/null
302                 done < 'extra-urls.txt'
303         fi
304 }
305
306 downloadPack () {
307         local download_dir
308         local name
309         local license
310         local source_type
311         local source_url
312         local pack
313         local reference
314         local subdir
315         local branch
316
317         download_dir="${1}"
318         name="${2}"
319
320         validation="$(getValue "${name}" 2)"
321         license="$(getValue "${name}" 3)"
322         source_type="$(getValue "${name}" 4)"
323         source_url="$(getValue "${name}" 5)"
324
325         pack="${name}${pack_suffix}"
326
327         ${MKDIR_P} "${download_dir}"
328
329         (
330                 cd "${download_dir}"
331
332                 ${ECHO} ''
333                 ${ECHO} "Available pack: ${pack}"
334                 ${ECHO} "  License: ${license}"
335                 ${ECHO} "  Download via ${source_type} from ${source_url}"
336                 ${ECHO} ''
337
338                 if [ -d "${download_dir}/${pack}" ]
339                 then
340                         ${ECHO} "Updating ${name}…"
341                 else
342                         ${ECHO} "Downloading ${pack}…"
343                 fi
344
345                 case "${source_type}" in
346                         'svn')
347                                 reference="$(getValue "${name}" 6)"
348                                 if [ -z "${reference}" ]
349                                 then
350                                         reference='HEAD'
351                                 fi
352
353                                 if [ -d "${pack}" ]
354                                 then
355                                         if [ -d "${pack}/.git" ]
356                                         then
357                                                 (
358                                                         cd "${pack}"
359                                                         ${GIT} svn fetch
360                                                 )
361                                         else
362                                                 ${SVN} update -r"${reference}" "${pack}"
363                                         fi
364                                 else
365                                         ${SVN} checkout -r"${reference}" "${source_url}" "${pack}" \
366                                         || ${GIT} svn clone "${source_url}" "${pack}"
367                                 fi
368                                 ;;
369                         'zip')
370                                 ${RM_R} 'zipdownload'
371                                 ${MKDIR} 'zipdownload'
372                                 (
373                                         cd 'zipdownload'
374                                         ${WGET} "${source_url}"
375                                         ${UNZIPPER} './'*.zip
376                                 )
377                                 ${RM_R} "${pack}"
378                                 ${MKDIR} "${pack}"
379                                 if [ -d 'zipdownload/games' ]
380                                 then
381                                         ${MV} 'zipdownload/'* "${pack}/"
382                                 else
383                                         ${MV} 'zipdownload/'*'/'* "${pack}/"
384                                 fi
385                                 ${RM_R} 'zipdownload'
386                                 ;;
387                         'gitdir')
388                                 local subdir="$(getValue "${name}" 6)"
389                                 local branch="$(getValue "${name}" 7)"
390                                 ${RM_R} "${pack}"
391                                 ${GIT} archive --remote="${source_url}" --prefix="${pack}/" "${branch}":"${subdir}" \
392                                 | ${TAR} xvf -
393                                 ;;
394                         'git')
395                                 if [ -d "${pack}" ]
396                                 then
397                                         (
398                                                 cd "${pack}"
399                                                 ${GIT} pull
400                                         )
401                                 else
402                                         ${GIT} clone "${source_url}" "${pack}"
403                                 fi
404                                 ;;
405                 esac
406
407                 if [ -d "${pack}" ]
408                 then
409                         (
410                                 cd "${pack}"
411                                 downloadExtraUrls
412                         )
413                 fi
414
415         )
416 }
417
418 downloadPackList () {
419         local download_dir
420         local name_list
421
422         download_dir="${1}"
423         name_list="${2}"
424
425         for name in ${name_list}
426         do
427                 if printNameList | inList "${name}"
428                 then
429                         downloadPack "${download_dir}" "${name}"
430                 else
431                         printError "unknown name: ${name}"
432                 fi
433         done
434 }
435
436 installPack () {
437         local download_dir
438         local install_dir
439         local name
440         local pack
441         local path
442         local game_file
443         local game_dir
444
445         download_dir="${1}"
446         install_dir="${2}"
447         name="${3}"
448
449         pack="${name}${pack_suffix}"
450
451         ${MKDIR_P} "${install_dir}/${games_dir}"
452
453         # Some per-game workaround for malformed gamepack
454         case "${name}" in
455                 'JediAcademy')
456                         pack="${pack}/Tools"
457                         ;;
458                 'Prey'|'Q3')
459                         pack="${pack}/tools"
460                         ;;
461                 'Wolf')
462                         pack="${pack}/bin"
463                         ;;
464         esac
465
466         if [ -d "${download_dir}/${pack}/build/netradiant" ]
467         then
468                 # mkeditorpacks-based gamepack
469                 pack="${pack}/build/netradiant"
470         elif [ -d "${download_dir}/${pack}/netradiant" ]
471         then
472                 # other layout
473                 pack="${pack}/netradiant"
474         fi
475
476         path="${download_dir}/${pack}"
477
478         for game_file in "${path}/${games_dir}/"*'.game'
479         do
480                 if [ x"${game_file}" != x"${path}/"*'.game' ]
481                 then
482                         ${CP} "${game_file}" "${real_install_dir}/${games_dir}/"
483                 fi
484         done
485
486         for game_dir in "${path}/"*'.game'
487         do
488                 if [ x"${game_dir}" != x"${path}/"*'.game' ]
489                 then
490                         ${CP_R} "${game_dir}" "${real_install_dir}/"
491                 fi
492         done
493 }
494
495 installPackList () {
496         local download_dir
497         local install_dir
498         local name_list
499
500         download_dir="${1}"
501         install_dir="${2}"
502         name_list="${3}"
503
504         for name in ${name_list}
505         do
506                 if printNameList | inList "${name}"
507                 then
508                         installPack "${download_dir}" "${install_dir}" "${name}"
509                 else
510                         printError "unknown name: ${name}"
511                 fi
512         done
513 }
514
515 printError () {
516         printf 'ERROR: %s\n' "${1}" >&2
517         exit 1
518 }
519
520 printHelp () {
521         local tab
522         local prog_name
523
524         tab="$(printf '\t')"
525         prog_name='gamepack-manager'
526
527         cat <<-EOF
528         Usage: ${prog_name} [OPTION] [SELECTION <ARGUMENTS>] [ACTION]
529
530         OPTIONS:
531         ${tab}-dd, --download-dir DIRNAME
532         ${tab}${tab}store downloaded games to DIRNAME (default: ${default_download_dir})
533
534         ${tab}-id, --install-dir DIRNAME
535         ${tab}${tab}store installed games to DIRNAME (default: ${default_install_dir})
536
537         SELECTIONS:
538         ${tab}-n, --name NAMES…
539         ${tab}${tab}select games by name (default: none)
540         ${tab}${tab}special keyword: validated, all, none
541         ${tab}${tab}available games:
542         $(printNameList | ${SED} -e 's/^/\t\t\t/')
543
544         ${tab}-l, --license LICENSES…
545         ${tab}${tab}select games by license (default: none)
546         ${tab}${tab}special keyword: free, all, none
547         ${tab}${tab}available licenses:
548         $(printLicenseList | ${SED} -e 's/^/\t\t\t/')
549
550         ACTIONS:
551         ${tab}-ln, --list-names
552         ${tab}${tab}list all game names
553
554         ${tab}-ll, --list-licenses
555         ${tab}${tab}list all game licenses
556
557         ${tab}-ls, --list-selected
558         ${tab}${tab}list selected games
559
560         ${tab}-d, --download
561         ${tab}${tab}download selected games
562
563         ${tab}-i, --install
564         ${tab}${tab}install selected games
565
566         ${tab}-h, --help
567         ${tab}${tab}print this help
568
569         Examples:
570         ${tab}${prog_name} --license GPL BSD --list-selected
571         ${tab}${prog_name} --license GPL BSD --download --install
572
573         ${tab}${prog_name} --name validated --list-selected
574         ${tab}${prog_name} --name validated --download --install
575
576         EOF
577
578         exit
579 }
580
581 option_list=''
582
583 list_selected='false'
584 list_licenses='false'
585 list_names='false'
586
587 download_packs='false'
588 install_packs='false'
589
590 mkdir_download='false'
591 mkdir_install='false'
592
593 by_license='false'
594 by_name='false'
595
596 arg_type=''
597 selected_list=''
598 license_list=''
599 name_list=''
600 install_dir=''
601
602 while ! [ -z "${1}" ]
603 do
604
605         if printList "${option_list}" | inList "${1}"
606         then
607                 printError "option called more than once: ${1}"
608         fi
609
610         if echo "${@}" | tr ' ' '\n' | inList '--help'
611         then
612                 printHelp
613         elif echo "${@}" | tr ' ' '\n' | inList '-h'
614         then
615                 printHelp
616         fi
617
618         case "${1}" in
619                 '--list-names'|'-ln')
620                         arg_type=''
621                         list_names='true'
622                         option_list="${option_list} ${1}"
623                         ;;
624                 '--list-licenses'|'-ll')
625                         arg_type=''
626                         list_licenses='true'
627                         option_list="${option_list} ${1}"
628                         ;;
629                 '--list-selected'|'-ls')
630                         arg_type=''
631                         list_selected='true'
632                         option_list="${option_list} ${1}"
633                         ;;
634                 '--download'|'-d')
635                         arg_type=''
636                         download_packs='true'
637                         mkdir_download='true'
638                         option_list="${option_list} ${1}"
639                         ;;
640                 '--install'|'-i')
641                         arg_type=''
642                         install_packs='true'
643                         mkdir_download='true'
644                         mkdir_install='true'
645                         option_list="${option_list} ${1}"
646                         ;;
647                 '--license'|'-l')
648                         by_license='true'
649                         arg_type='pack-license'
650                         option_list="${option_list} ${1}"
651                         ;;
652                 '--name'|'-n')
653                         by_name='true'
654                         arg_type='pack-name'
655                         option_list="${option_list} ${1}"
656                         ;;
657                 '--download-dir'|'-dd')
658                         arg_type='download-dir'
659                         option_list="${option_list} ${1}"
660                         ;;
661                 '--install-dir'|'-id')
662                         arg_type='install-dir'
663                         option_list="${option_list} ${1}"
664                         ;;
665                 '-'*)
666                         printError "unknown option: ${1}"
667                         ;;
668                 *)
669                         case "${arg_type}" in
670                                 'pack-name')
671                                         name_list="${name_list} ${1}"
672                                         ;;
673                                 'pack-license')
674                                         license_list="${license_list} ${1}"
675                                         ;;
676                                 'download-dir')
677                                         if [ -z "${download_dir}" ]
678                                         then
679                                                 download_dir="${1}"
680                                         else
681                                                 printError "more than one download dir: ${1}"
682                                         fi
683                                         ;;
684                                 'install-dir')
685                                         if [ -z "${install_dir}" ]
686                                         then
687                                                 install_dir="${1}"
688                                         else
689                                                 printError "more than one install dir: ${1}"
690                                         fi
691                                         ;;
692                                 *)
693                                         printError "misplaced argument: ${1}"
694                                         ;;
695                         esac
696                         ;;
697         esac
698
699         shift
700 done
701
702 # compatibility with legacy Makefile
703 if [ "${DOWNLOAD_GAMEPACKS}" = 'yes' ]
704 then
705         if ! [ -z "${DOWNLOADDIR}" ]
706         then
707                 download_dir="${DOWNLOADDIR}"
708         fi
709
710         if ! [ -z "${INSTALLDIR}" ]
711         then
712                 install_dir="${INSTALLDIR}"
713         fi
714
715         license_list='free'
716         by_license='true'
717
718         download_packs='true'
719         mkdir_download='true'
720
721         install_packs='true'
722         mkdir_install='true'
723 fi
724
725 if [ -z "${download_dir}" ]
726 then
727         download_dir="${default_download_dir}"
728 fi
729
730 if [ -z "${install_dir}" ]
731 then
732         install_dir="${default_install_dir}"
733 fi
734
735 if "${by_name}"
736 then
737         selected_list="${selected_list} $(printNameListByName "${name_list}")"
738 fi
739
740 if "${by_license}"
741 then
742         selected_list="${selected_list} $(printNameListByLicense "${license_list}")"
743 fi
744
745 selected_list="$(dedupeList "${selected_list}")"
746
747 if "${mkdir_download}"
748 then
749         ${MKDIR_P} "${download_dir}"
750         real_download_dir="$(printRealPath "${download_dir}")"
751 fi
752
753 if "${mkdir_install}"
754 then
755         ${MKDIR_P} "${install_dir}"
756         real_install_dir="$(printRealPath "${install_dir}")"
757 fi
758
759 if "${list_names}"
760 then
761         printNameList
762 fi
763
764 if "${list_licenses}"
765 then
766         printLicenseList
767 fi
768
769 if "${list_selected}"
770 then
771         printList "${selected_list}"
772 fi
773
774 if "${download_packs}"
775 then
776         downloadPackList "${real_download_dir}" "${selected_list}"
777 fi
778
779 if "${install_packs}"
780 then
781         installPackList "${real_download_dir}" "${real_install_dir}" "${selected_list}"
782 fi
783
784 #EOF