]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - gamepack-manager
gamepacks: add wrath support
[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 Wrath           yes  proprietary  git     https://gitlab.com/netradiant/gamepacks/wrath-mapeditor-support.git
97 Xonotic         yes  GPL          git     https://gitlab.com/xonotic/netradiant-xonoticpack.git
98 ZEQ2Lite        yes  unknown      git     https://gitlab.com/netradiant/gamepacks/zeq2lite-mapeditor-support.git
99 EOF
100 }
101
102 if command -v gsed >/dev/null
103 then
104         SED=gsed
105 elif sed --help >/dev/null 2>&1
106 then
107         SED=sed
108 else
109         printf 'ERROR: GNU sed is missing\n' >&2
110         exit 1
111 fi
112
113 printRealPath ()
114 {
115         if command -v grealpath >/dev/null
116         then
117                 grealpath "${1}"
118         elif command -v realpath >/dev/null
119         then
120                 realpath "${1}"
121         elif command -v greadlink >/dev/null
122         then
123                 # test greadlink first as greadlink has the feature on macos
124                 # but readlink only has it on linux, note that it's probably
125                 # the same on bsd
126                 # note: (g)readlink requires the file to be create first
127                 greadlink -f "${1}"
128         elif command -v readlink >/dev/null
129         then
130                 # --help and -f options are GNU readlink things
131                 if readlink --help >/dev/null 2>&1
132                 then
133                         readlink -f "${1}"
134                 else
135                         if ! python -c "import os; print(os.path.realpath('${1}'))"
136                         then
137                                 printf 'ERROR: GNU realpath or other way to compute real path of a file is missing\n' >&2
138                                 exit 1
139                         fi
140                 fi
141         fi
142 }
143
144 sanitizeDB () {
145         ${SED} -e 's/#.*//;s/[ \t][ \t][ \t]*/\t/g;s/^[ \t]*//;s/[ \t]*$//' \
146         | grep -v '^$'
147 }
148
149 inList () {
150         [ "$(grep "^${1}$")" = "${1}" ]
151 }
152
153 printList () {
154         echo "${1}" \
155         | tr ' ' '\n' \
156         | grep -v '^$' \
157         | sort -u
158 }
159
160 dedupeList () {
161         printList "${1}" \
162         | tr '\n' ' ' \
163         | ${SED} -e 's/ $//'
164 }
165
166 printGamePackDB () {
167         printRawDB \
168         | sanitizeDB
169 }
170
171 printLicenseList () {
172         printGamePackDB \
173         | awk '{ print $3 }' \
174         | sort -u
175 }
176
177 printNameList () {
178         printGamePackDB \
179         | awk '{ print $1 }' \
180         | sort -u
181 }
182
183 printNameListByLicense () {
184         local arg_license_list
185         local license_list
186         local license
187
188         arg_license_list="${1}"
189         license_list=''
190
191         for license in ${arg_license_list}
192         do
193                 case "${license}" in
194                         'none')
195                                 break
196                                 ;;
197                         'all')
198                                 license_list="$(printLicenseList)"
199                                 break
200                                 ;;
201                         'free')
202                                 license_list="${license_list} ${free_license_list}"
203                                 ;;
204                         *)
205                                 if printLicenseList | inList "${license}"
206                                 then
207                                         license_list="${license_list} ${license}"
208                                 else
209                                         printError "unknown license: ${license}"
210                                 fi
211                                 ;;
212                 esac
213         done
214
215         license_list="$(dedupeList "${license_list}")"
216
217         for license in ${license_list}
218         do
219                 printGamePackDB \
220                 | awk '$3 == "'"${license}"'"' \
221                 | awk '{ print $1 }'
222         done | sort -u
223 }
224
225 printNameListByName () {
226         local argname_list
227         local name_list
228         local name
229
230         argname_list="${1}"
231         name_list=''
232
233         for name in ${argname_list}
234         do
235                 case "${name}" in
236                         'none')
237                                 break
238                                 ;;
239                         'all')
240                                 name_list="$(printNameList)"
241                                 break
242                                 ;;
243                         'validated')
244                                 name_list="${name_list} validated"
245                                 ;;
246                         *)
247                                 if printNameList | inList "${name}"
248                                 then
249                                         name_list="${name_list} ${name}"
250                                 else
251                                         printError "unknown name: ${name}"
252                                 fi
253                                 ;;
254                 esac
255         done
256
257         name_list="$(dedupeList "${name_list}")"
258
259         for name in ${name_list}
260         do
261                 if [ "${name}" = 'validated' ]
262                 then
263                         printGamePackDB \
264                         | awk '$2 == "yes"' \
265                         | awk '{ print $1 }'
266                 fi
267
268                 printGamePackDB \
269                 | awk '$1 == "'"${name}"'"' \
270                 | awk '{ print $1 }'
271         done
272 }
273
274 printPackLine () {
275         local name
276
277         name="${1}"
278
279         printGamePackDB \
280         | awk '$1 == "'"${name}"'"'
281 }
282
283 getValue () {
284         local name
285         local key
286
287         name="${1}"
288         key="${2}"
289
290         printPackLine "${name}" \
291         | awk '{ print $'"${key}"' }'
292 }
293
294 downloadExtraUrls ()
295 {
296         if [ -f 'extra-urls.txt' ]
297         then
298                 local line
299                 while read line
300                 do
301                         local extra_file="$(echo "${line}" | cut -f1 -d$'\t')"
302                         local extra_url="$(echo "${line}" | cut -f2 -d$'\t')"
303                         ${WGET} -O "${extra_file}" "${extra_url}" < /dev/null
304                 done < 'extra-urls.txt'
305         fi
306 }
307
308 downloadPack () {
309         local download_dir
310         local name
311         local license
312         local source_type
313         local source_url
314         local pack
315         local reference
316         local subdir
317         local branch
318
319         download_dir="${1}"
320         name="${2}"
321
322         validation="$(getValue "${name}" 2)"
323         license="$(getValue "${name}" 3)"
324         source_type="$(getValue "${name}" 4)"
325         source_url="$(getValue "${name}" 5)"
326
327         pack="${name}${pack_suffix}"
328
329         ${MKDIR_P} "${download_dir}"
330
331         (
332                 cd "${download_dir}"
333
334                 ${ECHO} ''
335                 ${ECHO} "Available pack: ${pack}"
336                 ${ECHO} "  License: ${license}"
337                 ${ECHO} "  Download via ${source_type} from ${source_url}"
338                 ${ECHO} ''
339
340                 if [ -d "${download_dir}/${pack}" ]
341                 then
342                         ${ECHO} "Updating ${name}…"
343                 else
344                         ${ECHO} "Downloading ${pack}…"
345                 fi
346
347                 case "${source_type}" in
348                         'svn')
349                                 reference="$(getValue "${name}" 6)"
350                                 if [ -z "${reference}" ]
351                                 then
352                                         reference='HEAD'
353                                 fi
354
355                                 if [ -d "${pack}" ]
356                                 then
357                                         if [ -d "${pack}/.git" ]
358                                         then
359                                                 (
360                                                         cd "${pack}"
361                                                         ${GIT} svn fetch
362                                                 )
363                                         else
364                                                 ${SVN} update -r"${reference}" "${pack}"
365                                         fi
366                                 else
367                                         ${SVN} checkout -r"${reference}" "${source_url}" "${pack}" \
368                                         || ${GIT} svn clone "${source_url}" "${pack}"
369                                 fi
370                                 ;;
371                         'zip')
372                                 ${RM_R} 'zipdownload'
373                                 ${MKDIR} 'zipdownload'
374                                 (
375                                         cd 'zipdownload'
376                                         ${WGET} "${source_url}"
377                                         ${UNZIPPER} './'*.zip
378                                 )
379                                 ${RM_R} "${pack}"
380                                 ${MKDIR} "${pack}"
381                                 if [ -d 'zipdownload/games' ]
382                                 then
383                                         ${MV} 'zipdownload/'* "${pack}/"
384                                 else
385                                         ${MV} 'zipdownload/'*'/'* "${pack}/"
386                                 fi
387                                 ${RM_R} 'zipdownload'
388                                 ;;
389                         'gitdir')
390                                 local subdir="$(getValue "${name}" 6)"
391                                 local branch="$(getValue "${name}" 7)"
392                                 ${RM_R} "${pack}"
393                                 ${GIT} archive --remote="${source_url}" --prefix="${pack}/" "${branch}":"${subdir}" \
394                                 | ${TAR} xvf -
395                                 ;;
396                         'git')
397                                 if [ -d "${pack}" ]
398                                 then
399                                         (
400                                                 cd "${pack}"
401                                                 ${GIT} pull
402                                         )
403                                 else
404                                         ${GIT} clone "${source_url}" "${pack}"
405                                 fi
406                                 ;;
407                 esac
408
409                 if [ -d "${pack}" ]
410                 then
411                         (
412                                 cd "${pack}"
413                                 downloadExtraUrls
414                         )
415                 fi
416
417         )
418 }
419
420 downloadPackList () {
421         local download_dir
422         local name_list
423
424         download_dir="${1}"
425         name_list="${2}"
426
427         for name in ${name_list}
428         do
429                 if printNameList | inList "${name}"
430                 then
431                         downloadPack "${download_dir}" "${name}"
432                 else
433                         printError "unknown name: ${name}"
434                 fi
435         done
436 }
437
438 installPack () {
439         local download_dir
440         local install_dir
441         local name
442         local pack
443         local path
444         local game_file
445         local game_dir
446
447         download_dir="${1}"
448         install_dir="${2}"
449         name="${3}"
450
451         pack="${name}${pack_suffix}"
452
453         ${MKDIR_P} "${install_dir}/${games_dir}"
454
455         # Some per-game workaround for malformed gamepack
456         case "${name}" in
457                 'JediAcademy')
458                         pack="${pack}/Tools"
459                         ;;
460                 'Prey'|'Q3')
461                         pack="${pack}/tools"
462                         ;;
463                 'Wolf')
464                         pack="${pack}/bin"
465                         ;;
466         esac
467
468         if [ -d "${download_dir}/${pack}/build/netradiant" ]
469         then
470                 # mkeditorpacks-based gamepack
471                 pack="${pack}/build/netradiant"
472         elif [ -d "${download_dir}/${pack}/netradiant" ]
473         then
474                 # other layout
475                 pack="${pack}/netradiant"
476         fi
477
478         path="${download_dir}/${pack}"
479
480         for game_file in "${path}/${games_dir}/"*'.game'
481         do
482                 if [ x"${game_file}" != x"${path}/"*'.game' ]
483                 then
484                         ${CP} "${game_file}" "${real_install_dir}/${games_dir}/"
485                 fi
486         done
487
488         for game_dir in "${path}/"*'.game'
489         do
490                 if [ x"${game_dir}" != x"${path}/"*'.game' ]
491                 then
492                         ${CP_R} "${game_dir}" "${real_install_dir}/"
493                 fi
494         done
495 }
496
497 installPackList () {
498         local download_dir
499         local install_dir
500         local name_list
501
502         download_dir="${1}"
503         install_dir="${2}"
504         name_list="${3}"
505
506         for name in ${name_list}
507         do
508                 if printNameList | inList "${name}"
509                 then
510                         installPack "${download_dir}" "${install_dir}" "${name}"
511                 else
512                         printError "unknown name: ${name}"
513                 fi
514         done
515 }
516
517 printError () {
518         printf 'ERROR: %s\n' "${1}" >&2
519         exit 1
520 }
521
522 printHelp () {
523         local tab
524         local prog_name
525
526         tab="$(printf '\t')"
527         prog_name='gamepack-manager'
528
529         cat <<-EOF
530         Usage: ${prog_name} [OPTION] [SELECTION <ARGUMENTS>] [ACTION]
531
532         OPTIONS:
533         ${tab}-dd, --download-dir DIRNAME
534         ${tab}${tab}store downloaded games to DIRNAME (default: ${default_download_dir})
535
536         ${tab}-id, --install-dir DIRNAME
537         ${tab}${tab}store installed games to DIRNAME (default: ${default_install_dir})
538
539         SELECTIONS:
540         ${tab}-n, --name NAMES…
541         ${tab}${tab}select games by name (default: none)
542         ${tab}${tab}special keyword: validated, all, none
543         ${tab}${tab}available games:
544         $(printNameList | ${SED} -e 's/^/\t\t\t/')
545
546         ${tab}-l, --license LICENSES…
547         ${tab}${tab}select games by license (default: none)
548         ${tab}${tab}special keyword: free, all, none
549         ${tab}${tab}available licenses:
550         $(printLicenseList | ${SED} -e 's/^/\t\t\t/')
551
552         ACTIONS:
553         ${tab}-ln, --list-names
554         ${tab}${tab}list all game names
555
556         ${tab}-ll, --list-licenses
557         ${tab}${tab}list all game licenses
558
559         ${tab}-ls, --list-selected
560         ${tab}${tab}list selected games
561
562         ${tab}-d, --download
563         ${tab}${tab}download selected games
564
565         ${tab}-i, --install
566         ${tab}${tab}install selected games
567
568         ${tab}-h, --help
569         ${tab}${tab}print this help
570
571         Examples:
572         ${tab}${prog_name} --license GPL BSD --list-selected
573         ${tab}${prog_name} --license GPL BSD --download --install
574
575         ${tab}${prog_name} --name validated --list-selected
576         ${tab}${prog_name} --name validated --download --install
577
578         EOF
579
580         exit
581 }
582
583 option_list=''
584
585 list_selected='false'
586 list_licenses='false'
587 list_names='false'
588
589 download_packs='false'
590 install_packs='false'
591
592 mkdir_download='false'
593 mkdir_install='false'
594
595 by_license='false'
596 by_name='false'
597
598 arg_type=''
599 selected_list=''
600 license_list=''
601 name_list=''
602 install_dir=''
603
604 while ! [ -z "${1}" ]
605 do
606
607         if printList "${option_list}" | inList "${1}"
608         then
609                 printError "option called more than once: ${1}"
610         fi
611
612         if echo "${@}" | tr ' ' '\n' | inList '--help'
613         then
614                 printHelp
615         elif echo "${@}" | tr ' ' '\n' | inList '-h'
616         then
617                 printHelp
618         fi
619
620         case "${1}" in
621                 '--list-names'|'-ln')
622                         arg_type=''
623                         list_names='true'
624                         option_list="${option_list} ${1}"
625                         ;;
626                 '--list-licenses'|'-ll')
627                         arg_type=''
628                         list_licenses='true'
629                         option_list="${option_list} ${1}"
630                         ;;
631                 '--list-selected'|'-ls')
632                         arg_type=''
633                         list_selected='true'
634                         option_list="${option_list} ${1}"
635                         ;;
636                 '--download'|'-d')
637                         arg_type=''
638                         download_packs='true'
639                         mkdir_download='true'
640                         option_list="${option_list} ${1}"
641                         ;;
642                 '--install'|'-i')
643                         arg_type=''
644                         install_packs='true'
645                         mkdir_download='true'
646                         mkdir_install='true'
647                         option_list="${option_list} ${1}"
648                         ;;
649                 '--license'|'-l')
650                         by_license='true'
651                         arg_type='pack-license'
652                         option_list="${option_list} ${1}"
653                         ;;
654                 '--name'|'-n')
655                         by_name='true'
656                         arg_type='pack-name'
657                         option_list="${option_list} ${1}"
658                         ;;
659                 '--download-dir'|'-dd')
660                         arg_type='download-dir'
661                         option_list="${option_list} ${1}"
662                         ;;
663                 '--install-dir'|'-id')
664                         arg_type='install-dir'
665                         option_list="${option_list} ${1}"
666                         ;;
667                 '-'*)
668                         printError "unknown option: ${1}"
669                         ;;
670                 *)
671                         case "${arg_type}" in
672                                 'pack-name')
673                                         name_list="${name_list} ${1}"
674                                         ;;
675                                 'pack-license')
676                                         license_list="${license_list} ${1}"
677                                         ;;
678                                 'download-dir')
679                                         if [ -z "${download_dir}" ]
680                                         then
681                                                 download_dir="${1}"
682                                         else
683                                                 printError "more than one download dir: ${1}"
684                                         fi
685                                         ;;
686                                 'install-dir')
687                                         if [ -z "${install_dir}" ]
688                                         then
689                                                 install_dir="${1}"
690                                         else
691                                                 printError "more than one install dir: ${1}"
692                                         fi
693                                         ;;
694                                 *)
695                                         printError "misplaced argument: ${1}"
696                                         ;;
697                         esac
698                         ;;
699         esac
700
701         shift
702 done
703
704 # compatibility with legacy Makefile
705 if [ "${DOWNLOAD_GAMEPACKS}" = 'yes' ]
706 then
707         if ! [ -z "${DOWNLOADDIR}" ]
708         then
709                 download_dir="${DOWNLOADDIR}"
710         fi
711
712         if ! [ -z "${INSTALLDIR}" ]
713         then
714                 install_dir="${INSTALLDIR}"
715         fi
716
717         license_list='free'
718         by_license='true'
719
720         download_packs='true'
721         mkdir_download='true'
722
723         install_packs='true'
724         mkdir_install='true'
725 fi
726
727 if [ -z "${download_dir}" ]
728 then
729         download_dir="${default_download_dir}"
730 fi
731
732 if [ -z "${install_dir}" ]
733 then
734         install_dir="${default_install_dir}"
735 fi
736
737 if "${by_name}"
738 then
739         selected_list="${selected_list} $(printNameListByName "${name_list}")"
740 fi
741
742 if "${by_license}"
743 then
744         selected_list="${selected_list} $(printNameListByLicense "${license_list}")"
745 fi
746
747 selected_list="$(dedupeList "${selected_list}")"
748
749 if "${mkdir_download}"
750 then
751         ${MKDIR_P} "${download_dir}"
752         real_download_dir="$(printRealPath "${download_dir}")"
753 fi
754
755 if "${mkdir_install}"
756 then
757         ${MKDIR_P} "${install_dir}"
758         real_install_dir="$(printRealPath "${install_dir}")"
759 fi
760
761 if "${list_names}"
762 then
763         printNameList
764 fi
765
766 if "${list_licenses}"
767 then
768         printLicenseList
769 fi
770
771 if "${list_selected}"
772 then
773         printList "${selected_list}"
774 fi
775
776 if "${download_packs}"
777 then
778         downloadPackList "${real_download_dir}" "${selected_list}"
779 fi
780
781 if "${install_packs}"
782 then
783         installPackList "${real_download_dir}" "${real_install_dir}" "${selected_list}"
784 fi
785
786 #EOF