Compare commits
17 Commits
version/20
...
release/3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65605d175f | ||
|
|
f00e4910e8 | ||
|
|
d4df1c7cba | ||
|
|
6a202a495f | ||
|
|
4b3e09deec | ||
|
|
e4282ff85b | ||
|
|
866b67d036 | ||
|
|
5417456b05 | ||
|
|
5212ea7bdc | ||
|
|
e3eb2aa347 | ||
|
|
bc58ece69a | ||
|
|
802e9dbc28 | ||
|
|
3f6504eb81 | ||
|
|
03999ef343 | ||
|
|
4a9d8e58d2 | ||
|
|
ced4855c65 | ||
|
|
75c35a49b3 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -20,3 +20,5 @@ archivebuild
|
||||
osgbuild
|
||||
CMakeCache.txt
|
||||
*.pyc
|
||||
base_package
|
||||
extended-data
|
||||
|
||||
10
.gitmodules
vendored
10
.gitmodules
vendored
@@ -1,20 +1,20 @@
|
||||
[submodule "simgear"]
|
||||
path = simgear
|
||||
url = git://git.code.sf.net/p/flightgear/simgear
|
||||
branch = release/2016.1
|
||||
branch = release/3.6.0
|
||||
[submodule "flightgear"]
|
||||
path = flightgear
|
||||
url = git://git.code.sf.net/p/flightgear/flightgear
|
||||
branch = release/2016.1
|
||||
branch = release/3.6.0
|
||||
[submodule "fgrun"]
|
||||
path = fgrun
|
||||
url = git://git.code.sf.net/p/flightgear/fgrun
|
||||
branch = release/2016.1
|
||||
branch = release/3.6.0
|
||||
[submodule "fgdata"]
|
||||
path = fgdata
|
||||
url = git://git.code.sf.net/p/flightgear/fgdata
|
||||
branch = release/2016.1
|
||||
branch = release/3.6.0
|
||||
[submodule "windows-3rd-party"]
|
||||
path = windows-3rd-party
|
||||
url = git://git.code.sf.net/p/flightgear/windows-3rd-party
|
||||
branch = master
|
||||
branch = release/3.6.0
|
||||
|
||||
@@ -101,9 +101,11 @@ Source: "{#VCInstallDir}\redist\x64\Microsoft.VC100.CRT\*.dll"; DestDir: "{app}\
|
||||
Source: "X:\install\msvc100\FlightGear\bin\fgpanel.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
|
||||
Source: "X:\3rdParty\bin\oalinst.exe"; DestDir: "{app}\bin"; Flags: ignoreversion skipifsourcedoesntexist
|
||||
|
||||
; Include the base package
|
||||
; Include the base package
|
||||
#if IncludeData == "TRUE"
|
||||
Source: "X:\fgdata\*.*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs skipifsourcedoesntexist
|
||||
; work-around for 3.6: look for additional aircraft data
|
||||
Source: "X:\extended-data\*.*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs skipifsourcedoesntexist
|
||||
#endif
|
||||
|
||||
; 32 bits install
|
||||
@@ -189,14 +191,13 @@ Name: "{userdocs}\FlightGear\TerraSync"; Permissions: everyone-modify; Check: no
|
||||
Name: "{userdocs}\FlightGear\Custom Scenery"; Permissions: everyone-modify; Check: not DirExists(ExpandConstant('{userdocs}\FlightGear\Custom Scenery'))
|
||||
|
||||
[Icons]
|
||||
Name: "{userdesktop}\FlightGear {#FGVersion}"; Filename: "{app}\bin\fgfs.exe"; Parameters: "--launcher"; WorkingDir: "{app}"; Tasks: desktopicon;
|
||||
Name: "{group}\FlightGear Launcher"; Filename: "{app}\bin\fgfs.exe"; Parameters: "--launcher"; WorkingDir: "{app}";
|
||||
Name: "{group}\FlightGear Manual"; Filename: "{app}\fgdata\Docs\getstart.pdf"
|
||||
Name: "{group}\FlightGear Documentation"; Filename: "{app}\fgdata\Docs\index.html"
|
||||
Name: "{userdesktop}\FlightGear {#FGVersion}"; Filename: "{app}\bin\fgfs.exe"; Parameters: "--launcher"; WorkingDir: "{app}\bin"; Tasks: desktopicon;
|
||||
Name: "{group}\FlightGear"; Filename: "{app}\bin\fgfs.exe"; Parameters: "--launcher"; WorkingDir: "{app}\bin";
|
||||
Name: "{group}\FlightGear Manual"; Filename: "{app}\data\Docs\getstart.pdf"
|
||||
Name: "{group}\FlightGear Documentation"; Filename: "{app}\data\Docs\index.html"
|
||||
Name: "{group}\Flightgear Wiki"; Filename: "http://wiki.flightgear.org"
|
||||
Name: "{group}\Tools\FGRun"; Filename: "{app}\bin\fgrun.exe"; WorkingDir: "{app}";
|
||||
Name: "{group}\Tools\Install & Uninstall Scenery"; Filename: "{app}\bin\fgadmin.exe"; WorkingDir: "{app}"
|
||||
Name: "{group}\Tools\TerraSync"; Filename: "{app}\bin\terrasync.exe"; Parameters: "-S -p 5505 -d ""{userdocs}\FlightGear\TerraSync"""; WorkingDir: "{app}"
|
||||
Name: "{group}\Tools\Uninstall FlightGear"; Filename: "{uninstallexe}"
|
||||
Name: "{group}\Tools\js_demo"; Filename: "{app}\bin\js_demo.exe"
|
||||
Name: "{group}\Tools\fgjs"; Filename: "cmd"; Parameters: "/k fgjs.exe ""--fg-root={app}\fgdata"""; WorkingDir: "{app}\bin"
|
||||
@@ -208,7 +209,7 @@ Name: "{group}\Tools\yasim"; Filename: "cmd"; Parameters: "/k ""{app}\bin\yasim.
|
||||
Name: "{group}\Tools\fgpanel"; Filename: "cmd"; Parameters: "/k ""{app}\bin\fgpanel.exe"" -h"; WorkingDir: "{app}\bin"
|
||||
Name: "{group}\Tools\FGCom"; Filename: "{app}\bin\fgcom.exe"; WorkingDir: "{app}\bin"
|
||||
Name: "{group}\Tools\FGCom-testing"; Filename: "{app}\bin\fgcom.exe"; Parameters: "--frequency=910"; WorkingDir: "{app}\bin"
|
||||
Name: "{group}\Tools\Explore Documentation Folder"; Filename: "{app}\fgdata\Docs"
|
||||
Name: "{group}\Tools\Explore Documentation Folder"; Filename: "{app}\data\Docs"
|
||||
|
||||
[Run]
|
||||
filename: "cmd.exe"; WorkingDir: "{app}\bin"; Parameters: "/C del msvc*.dll"; Check: FileExists(ExpandConstant('{app}\bin\vcredist_x86.exe'))
|
||||
@@ -217,7 +218,7 @@ filename: "{app}\bin\vcredist_x86.exe"; WorkingDir: "{app}\bin"; Parameters: "/p
|
||||
filename: "{app}\bin\vcredist_x64.exe"; WorkingDir: "{app}\bin"; Parameters: "/passive /norestart"; Description: "Installing MS Visual C++ runtime components"; Check: Is64BitInstallMode and FileExists(ExpandConstant('{app}\bin\vcredist_x64.exe'))
|
||||
filename: "{app}\bin\oalinst.exe"; WorkingDir: "{app}\bin"; Description: "Installing OpenAL"; Check: IsTaskSelected('insoal') and FileExists(ExpandConstant('{app}\bin\oalinst.exe'))
|
||||
; Put installation directory into the fgrun.prefs
|
||||
filename: "{app}\bin\fgrun.exe"; WorkingDir: "{app}\bin"; Parameters: "--silent ""--fg-exe={app}\bin\fgfs.exe"" ""--fg-root={app}\fgdata"" ""--fg-scenery={userdocs}\FlightGear\Custom Scenery;{app}\fgdata\Scenery;{userdocs}\FlightGear\TerraSync"" ""--fg-aircraft={userdocs}\FlightGear\Aircraft"" ""--terrasync-dir={userdocs}\FlightGear\TerraSync"" --version={#FGVersion}"
|
||||
filename: "{app}\bin\fgrun.exe"; WorkingDir: "{app}\bin"; Parameters: "--silent ""--fg-exe={app}\bin\fgfs.exe"" ""--fg-root={app}\data"" ""--fg-scenery={userdocs}\FlightGear\Custom Scenery;{app}\fgdata\Scenery;{userdocs}\FlightGear\TerraSync"" ""--fg-aircraft={userdocs}\FlightGear\Aircraft"" ""--terrasync-dir={userdocs}\FlightGear\TerraSync"" --version={#FGVersion}"
|
||||
; Put installation and source directories into the fgadmin.prefs
|
||||
filename: "{app}\bin\fgadmin.exe"; WorkingDir: "{app}\bin"; Parameters: "--silent ""--install-source={src}\..\Scenery"" ""--scenery-dest={userdocs}\FlightGear\Custom Scenery"""
|
||||
|
||||
|
||||
17
aircraft.rules
Normal file
17
aircraft.rules
Normal file
@@ -0,0 +1,17 @@
|
||||
+ /Aircraft
|
||||
+ /Aircraft/777
|
||||
+ /Aircraft/777-200
|
||||
+ /Aircraft/b1900d
|
||||
+ /Aircraft/CitationX
|
||||
+ /Aircraft/ZLT-NT
|
||||
+ /Aircraft/dhc2
|
||||
+ /Aircraft/Cub
|
||||
+ /Aircraft/sopwithCamel
|
||||
+ /Aircraft/f-14b
|
||||
+ /Aircraft/ASK13
|
||||
+ /Aircraft/bo105
|
||||
+ /Aircraft/Dragonfly
|
||||
+ /Aircraft/SenecaII
|
||||
+ /Aircraft/A6M2
|
||||
- /Aircraft/*
|
||||
- .svn
|
||||
10
base-package.rules
Normal file
10
base-package.rules
Normal file
@@ -0,0 +1,10 @@
|
||||
- .git
|
||||
- *.xcf
|
||||
- *.tex
|
||||
- .svn
|
||||
|
||||
- /fgdata/Textures/Unused
|
||||
- /fgdata/Textures/*.orig
|
||||
- /fgdata/Docs/source
|
||||
- /fgdata/Models/Airspace
|
||||
- /fgdata/Models/MNUAV
|
||||
@@ -59,5 +59,25 @@ cp flightgear-*.tar.bz2 ../output/.
|
||||
echo "Assembling base package"
|
||||
cd $WORKSPACE
|
||||
|
||||
tar cjf output/FlightGear-$VERSION-data.tar.bz2 fgdata/
|
||||
rm -rf base_package
|
||||
|
||||
# a: archive mode
|
||||
# z: compress
|
||||
# delete: 'delete extraneous files from dest dirs'; avoid bug 1344
|
||||
# filter: use the rules in our rules file
|
||||
|
||||
echo "Copying FGData files"
|
||||
rsync -a --delete \
|
||||
--filter 'merge base-package.rules' \
|
||||
fgdata base_package
|
||||
|
||||
echo "Syncing aircraft data"
|
||||
rsync -a --delete --filter 'merge aircraft.rules' /home/jenkins/fgaddon-3.6.0/ extended-data
|
||||
|
||||
echo "Copying aircraft data"
|
||||
rsync -a extended-data/ base_package/fgdata
|
||||
|
||||
echo "Creating tar archive"
|
||||
pushd base_package
|
||||
tar cjf $WORKSPACE/output/FlightGear-$VERSION-data.tar.bz2 fgdata/
|
||||
popd
|
||||
|
||||
454
catalogFilenames.py
Normal file
454
catalogFilenames.py
Normal file
@@ -0,0 +1,454 @@
|
||||
aircraft = {
|
||||
"14bis":"14bis_20120506.zip",
|
||||
"21":"21_20101206.zip",
|
||||
"707":"707_20140103.zip",
|
||||
"717":"717_20140116.zip",
|
||||
"727-230":"727-230_20120714.zip",
|
||||
"737-100":"737-100_20120506.zip",
|
||||
"737-200":"737-200_20120506.zip",
|
||||
"737-300":"737-300_20140116.zip",
|
||||
"737NG":"737NG_20140116.zip",
|
||||
"747-200":"747-200_2.1.zip",
|
||||
"747-400":"747-400_20140216.zip",
|
||||
"747":"747_20070714.zip",
|
||||
"757-200":"757-200_20140116.zip",
|
||||
"767-300":"767-300_20100100.zip",
|
||||
"777-200":"777-200_20111215.zip",
|
||||
"777":"777_20140216.zip",
|
||||
"787":"787_20140116.zip",
|
||||
"A-10":"A-10_20140116.zip",
|
||||
"A-26-Invader":"A-26-Invader_20130214.zip",
|
||||
"A-6E":"A-6E_20131204.zip",
|
||||
"A24-Viking":"A24-Viking_20120506.zip",
|
||||
"A300":"A300_20120717.zip",
|
||||
"A320-family":"A320-family_20140116.zip",
|
||||
"A340-600":"A340-600_20080400.zip",
|
||||
"A380":"A380_1.2.zip",
|
||||
"A6M2":"A6M2_20120717.zip",
|
||||
"AG-14":"AG-14_20130810.zip",
|
||||
"AN-225":"AN-225_20130823.zip",
|
||||
"ANT-20":"ANT-20_20120506.zip",
|
||||
"AR-234":"AR-234_20120821.zip",
|
||||
"ASK13":"ASK13_20100401.zip",
|
||||
"ASK21-MI":"ASK21-MI_20120506.zip",
|
||||
"ASK21":"ASK21_20070701.zip",
|
||||
"ATC-ML":"ATC-ML_20131014.zip",
|
||||
"ATC":"ATC_20120717.zip",
|
||||
"ATI-Resolution":"ATI-Resolution_0.0.zip",
|
||||
"ATR-72-500":"ATR-72-500_20120717.zip",
|
||||
"AVRO-IV-Triplane":"AVRO-IV-Triplane_20130805.zip",
|
||||
"Aero-Commander":"Aero-Commander_20130313.zip",
|
||||
"Aerocar":"Aerocar_20130805.zip",
|
||||
"Aerostar-700":"Aerostar-700_20120610.zip",
|
||||
"Aichi-D3A":"Aichi-D3A_20120506.zip",
|
||||
"AirCrane":"AirCrane_20131204.zip",
|
||||
"Airco-DH2":"Airco-DH2_20120506.zip",
|
||||
"Albatross":"Albatross_20130823.zip",
|
||||
"Allegro-2000":"Allegro-2000_20120506.zip",
|
||||
"Alouette-III":"Alouette-III_20131117.zip",
|
||||
"Alouette-II":"Alouette-II_20120506.zip",
|
||||
"Alphajet":"Alphajet_20130225.zip",
|
||||
"Antoinette":"Antoinette_20130220.zip",
|
||||
"Antonov-An-12":"Antonov-An-12_20131220.zip",
|
||||
"Arsenal-VG33":"Arsenal-VG33_0.1.zip",
|
||||
"Arup-S2":"Arup-S2_20120506.zip",
|
||||
"Avro-Arrow":"Avro-Arrow_20120506.zip",
|
||||
"Avro-Lancaster":"Avro-Lancaster_20120817.zip",
|
||||
"B-17":"B-17_20130706.zip",
|
||||
"B-1B":"B-1B_20130823.zip",
|
||||
"B-24-Liberator":"B-24-Liberator_20131227.zip",
|
||||
"B-25":"B-25_20130810.zip",
|
||||
"B-2":"B-2_20130823.zip",
|
||||
"B-36D-Peacemaker":"B-36D-Peacemaker_20120506.zip",
|
||||
"B-52F":"B-52F_20130823.zip",
|
||||
"BAC-TSR2":"BAC-TSR2_20120717.zip",
|
||||
"BAe-125":"BAe-125_20120305.zip",
|
||||
"BV-141":"BV-141_20131015.zip",
|
||||
"BV-170":"BV-170_20130411.zip",
|
||||
"Beechcraft-Staggerwing":"Beechcraft-Staggerwing_20130303.zip",
|
||||
"Bell-222X":"Bell-222X_20120508.zip",
|
||||
"Bell-P-39":"Bell-P-39_20120821.zip",
|
||||
"Bell-P-59":"Bell-P-59_20120817.zip",
|
||||
"Bell-X1":"Bell-X1_20120114.zip",
|
||||
"Bernard-HV220":"Bernard-HV220_20090506.zip",
|
||||
"Bleriot-SPAD-S.510":"Bleriot-SPAD-S.510_20131226.zip",
|
||||
"Boeing-247":"Boeing-247_20130903.zip",
|
||||
"Boeing314":"Boeing314_1.6.zip",
|
||||
"Bombardier-415":"Bombardier-415_20131203.zip",
|
||||
"Br-761":"Br-761_20130123.zip",
|
||||
"Brabazon":"Brabazon_20120821.zip",
|
||||
"Breda-B.Z.308":"Breda-B.Z.308_20130102.zip",
|
||||
"Breguet-XIX":"Breguet-XIX_20100829.zip",
|
||||
"Buccaneer":"Buccaneer_0.1.zip",
|
||||
"Bugatti":"Bugatti_20120524.zip",
|
||||
"Burnelli-CBY-3":"Burnelli-CBY-3_20120506.zip",
|
||||
"C-160-Transall":"C-160-Transall_20120905.zip",
|
||||
"C-2A":"C-2A_20120506.zip",
|
||||
"C130":"C130_20130810.zip",
|
||||
"C460":"C460_20130614.zip",
|
||||
"C561":"C561_20130614.zip",
|
||||
"C684":"C684_20131025.zip",
|
||||
"CRJ-200":"CRJ-200_2.zip",
|
||||
"CRJ700-family":"CRJ700-family_1.1.0.zip",
|
||||
"Campini-Caproni-N1":"Campini-Caproni-N1_20130115.zip",
|
||||
"CanberraBI8":"CanberraBI8_20101204.zip",
|
||||
"Cap10B":"Cap10B_20130824.zip",
|
||||
"Cap10C":"Cap10C_20131202.zip",
|
||||
"Caravelle":"Caravelle_20120506.zip",
|
||||
"Carreidas":"Carreidas_20131025.zip",
|
||||
"Caudron-G3":"Caudron-G3_20120506.zip",
|
||||
"Caudron-G4":"Caudron-G4_20120506.zip",
|
||||
"Cessna-208-Caravan":"Cessna-208-Caravan_20130301.zip",
|
||||
"Cessna-421-Golden-Eagle":"Cessna-421-Golden-Eagle_20120506.zip",
|
||||
"Cessna337":"Cessna337_v20120429.zip",
|
||||
"Citation-Bravo":"Citation-Bravo_20131025.zip",
|
||||
"CitationX":"CitationX_20131025.zip",
|
||||
"Citation":"Citation_20130305.zip",
|
||||
"Coanda-1910":"Coanda-1910_20130129.zip",
|
||||
"Commonwealth-Ca-12":"Commonwealth-Ca-12_20120817.zip",
|
||||
"ComperSwift":"ComperSwift_20120717.zip",
|
||||
"Concorde":"Concorde_2.11.zip",
|
||||
"Convair-XFY-1-Pogo":"Convair-XFY-1-Pogo_20120506.zip",
|
||||
"Cub":"Cub_20120508.zip",
|
||||
"Curtiss-Jenny":"Curtiss-Jenny_20120906.zip",
|
||||
"Curtiss-P40":"Curtiss-P40_20130221.zip",
|
||||
"D510":"D510_20130916.zip",
|
||||
"D520":"D520_20120506.zip",
|
||||
"DC-10-30":"DC-10-30_20140116.zip",
|
||||
"DG-101G":"DG-101G_2013-01-01.zip",
|
||||
"DH-106":"DH-106_20120506.zip",
|
||||
"DH-88":"DH-88_20131026.zip",
|
||||
"DH-89":"DH-89_20120905.zip",
|
||||
"DH-91":"DH-91_20120506.zip",
|
||||
"DO-228":"DO-228_20130824.zip",
|
||||
"DO-26":"DO-26_20100521.zip",
|
||||
"DO-335":"DO-335_20130216.zip",
|
||||
"DO-X":"DO-X_0.2.0.zip",
|
||||
"DR400-dauphin":"DR400-dauphin_20140105.zip",
|
||||
"DR400":"DR400_20131129.zip",
|
||||
"Dauphin":"Dauphin_20140109.zip",
|
||||
"Deperdussin":"Deperdussin_20101124.zip",
|
||||
"DerKleineUhu":"DerKleineUhu_0.1.zip",
|
||||
"Deuche":"Deuche_20120506.zip",
|
||||
"Diamond-Da40":"Diamond-Da40_20130326.zip",
|
||||
"Diamond-Da42":"Diamond-Da42_20120506.zip",
|
||||
"Douglas-Dc3":"Douglas-Dc3_20130107.zip",
|
||||
"Douglas-Dolphin":"Douglas-Dolphin_20131029.zip",
|
||||
"Dragonfly":"Dragonfly_1.0.zip",
|
||||
"Dromader":"Dromader_31-02-2011.zip",
|
||||
"E-2C":"E-2C_20131014.zip",
|
||||
"E3B":"E3B_20130313.zip",
|
||||
"Etrich-Taube":"Etrich-Taube_20120207.zip",
|
||||
"F-106-dart":"F-106-dart_20130808.zip",
|
||||
"F-117":"F-117_20130317.zip",
|
||||
"F-35B":"F-35B_20120717.zip",
|
||||
"F-86":"F-86_20131216.zip",
|
||||
"F-8E-Crusader":"F-8E-Crusader_20130810.zip",
|
||||
"F4U":"F4U_20120717.zip",
|
||||
"F6F-Hellcat":"F6F-Hellcat_20120821.zip",
|
||||
"F7F-Tigercat":"F7F-Tigercat_20130107.zip",
|
||||
"F80C":"F80C_20120717.zip",
|
||||
"FK9MK2":"FK9MK2_20120506.zip",
|
||||
"Fairchild-C119":"Fairchild-C119_20120817.zip",
|
||||
"Fairchild-Metroliner":"Fairchild-Metroliner_20110321.zip",
|
||||
"Fairey-Gannet":"Fairey-Gannet_20131122.zip",
|
||||
"Falcon-50":"Falcon-50_20140116.zip",
|
||||
"Farman-III":"Farman-III_20131014.zip",
|
||||
"Farman-IV":"Farman-IV_20130213.zip",
|
||||
"Focke-Wulf-F19-ente":"Focke-Wulf-F19-ente_20130103.zip",
|
||||
"Fokker-Eindecker-EIII":"Fokker-Eindecker-EIII_20110301.zip",
|
||||
"Fokker-S-11":"Fokker-S-11_20120506.zip",
|
||||
"Fokker-Spin":"Fokker-Spin_20130805.zip",
|
||||
"Ford-Trimotor":"Ford-Trimotor_20120506.zip",
|
||||
"Fouga-Magister":"Fouga-Magister_20120501.zip",
|
||||
"Fw200":"Fw200_20120506.zip",
|
||||
"Fw61":"Fw61_20091025.zip",
|
||||
"G-164":"G-164_20131014.zip",
|
||||
"Gee-Bee":"Gee-Bee_20130711.zip",
|
||||
"Gloster-Meteor":"Gloster-Meteor_20120821.zip",
|
||||
"Gloster-Whittle":"Gloster-Whittle_20120821.zip",
|
||||
"Gotha-G-V":"Gotha-G-V_20131007.zip",
|
||||
"Grob-Astir":"Grob-Astir_20131209.zip",
|
||||
"Grob-G109":"Grob-G109_20131104.zip",
|
||||
"Grob-G115":"Grob-G115_20131209.zip",
|
||||
"Grob-Gf200":"Grob-Gf200_20140102.zip",
|
||||
"H-21C-Shawnee":"H-21C-Shawnee_20120717.zip",
|
||||
"H1-Racer":"H1-Racer_20130531.zip",
|
||||
"H4-Hercules":"H4-Hercules_1.3.zip",
|
||||
"HM-14":"HM-14_20120506.zip",
|
||||
"HS-P-75":"HS-P-75_20130912.zip",
|
||||
"HUP-Retriever":"HUP-Retriever_20120717.zip",
|
||||
"Handley-Page-Halifax":"Handley-Page-Halifax_20120506.zip",
|
||||
"Hansajet":"Hansajet_0.1.zip",
|
||||
"Hawker-Siddeley-Nimrod":"Hawker-Siddeley-Nimrod_20120506.zip",
|
||||
"He-111":"He-111_20131022.zip",
|
||||
"He162":"He162_20131022.zip",
|
||||
"Heinkel-He-111":"Heinkel-He-111_20120817.zip",
|
||||
"Heinkel-He-177":"Heinkel-He-177_20130805.zip",
|
||||
"Heinkel-He-178":"Heinkel-He-178_20101128.zip",
|
||||
"Heinkel-He-280":"Heinkel-He-280_20120825.zip",
|
||||
"HondaJet":"HondaJet_20130620.zip",
|
||||
"Hornet":"Hornet_20101110.zip",
|
||||
"Horsa":"Horsa_20131022.zip",
|
||||
"Horten-Ho-IX":"Horten-Ho-IX_20130208.zip",
|
||||
"Hughes-XF11":"Hughes-XF11_20120506.zip",
|
||||
"Hunter":"Hunter_20131025.zip",
|
||||
"Hurricane":"Hurricane_20130823.zip",
|
||||
"IAR80":"IAR80_20120912.zip",
|
||||
"IL-2":"IL-2_20110311.zip",
|
||||
"JA37":"JA37_1.21.zip",
|
||||
"JAS39-Gripen":"JAS39-Gripen_20120506.zip",
|
||||
"JT-5B":"JT-5B_20130330.zip",
|
||||
"Jaguar":"Jaguar_4.81.zip",
|
||||
"Ju-87":"Ju-87_20130712.zip",
|
||||
"Ju-88":"Ju-88_20120717.zip",
|
||||
"Junkers-F13":"Junkers-F13_20130516.zip",
|
||||
"Junkers-G.38ce":"Junkers-G.38ce_20120506.zip",
|
||||
"Junkers-W34":"Junkers-W34_20130713.zip",
|
||||
"K-7":"K-7_20120506.zip",
|
||||
"K5Y1":"K5Y1_0.1.zip",
|
||||
"KC135":"KC135_20131022.zip",
|
||||
"KM":"KM_20100603.zip",
|
||||
"Ka-50":"Ka-50_20130418.zip",
|
||||
"Katana":"Katana_20130322.zip",
|
||||
"Ki-84":"Ki-84_20120717.zip",
|
||||
"L-1011-500":"L-1011-500_20120506.zip",
|
||||
"LATE-29":"LATE-29_20120506.zip",
|
||||
"La-5":"La-5_20120506.zip",
|
||||
"Lancair-235":"Lancair-235_20130810.zip",
|
||||
"Late-631":"Late-631_20120829.zip",
|
||||
"Leduc-022":"Leduc-022_20120821.zip",
|
||||
"Lightning":"Lightning_20140116.zip",
|
||||
"Lionceau":"Lionceau_20130512.zip",
|
||||
"Lockheed-Martin-FA-22A-Raptor":"Lockheed-Martin-FA-22A-Raptor_20131022.zip",
|
||||
"Lockheed-NF104A":"Lockheed-NF104A_20110316.zip",
|
||||
"Lockheed-NF104":"Lockheed-NF104_20110604.zip",
|
||||
"Lockheed-P38":"Lockheed-P38_20131202.zip",
|
||||
"Lockheed-SR71":"Lockheed-SR71_20120507.zip",
|
||||
"Lockheed-U-2S":"Lockheed-U-2S_20131104.zip",
|
||||
"Lockheed-Vega":"Lockheed-Vega_20100324.zip",
|
||||
"Lockheed1049":"Lockheed1049_1.6.zip",
|
||||
"Lockheed1049h":"Lockheed1049h_1.0.zip",
|
||||
"Long-EZ":"Long-EZ_20120506.zip",
|
||||
"Lynx-WG13":"Lynx-WG13_20120717.zip",
|
||||
"M-XE":"M-XE_20120506.zip",
|
||||
"MB326":"MB326_20131022.zip",
|
||||
"MD11":"MD11_20121126.zip",
|
||||
"ME-209-V1":"ME-209-V1_20130416.zip",
|
||||
"ME-262HGIII":"ME-262HGIII_20120506.zip",
|
||||
"ME-262":"ME-262_20120821.zip",
|
||||
"MPCarrier":"MPCarrier_0.1.zip",
|
||||
"MRJ":"MRJ_20090817.zip",
|
||||
"MS-406":"MS-406_20130806.zip",
|
||||
"Macchi-Castoldi-MC72":"Macchi-Castoldi-MC72_20131016.zip",
|
||||
"Macchi-M33":"Macchi-M33_20120506.zip",
|
||||
"Martin-Baker-MB5":"Martin-Baker-MB5_20120813.zip",
|
||||
"Messerschmitt-BF110":"Messerschmitt-BF110_20130329.zip",
|
||||
"Messerschmitt-Libelle":"Messerschmitt-Libelle_20130511.zip",
|
||||
"Messerschmitt-P1101":"Messerschmitt-P1101_20130315.zip",
|
||||
"MiG-15":"MiG-15_20121210.zip",
|
||||
"MiG-21bis":"MiG-21bis_20120717.zip",
|
||||
"Mig-29":"Mig-29_20140116.zip",
|
||||
"Mil-Mi-12":"Mil-Mi-12_20120216.zip",
|
||||
"Mil-Mi-24":"Mil-Mi-24_20140116.zip",
|
||||
"Mirage-2000":"Mirage-2000_20131025.zip",
|
||||
"MirageIII":"MirageIII_20131008.zip",
|
||||
"MirageIV":"MirageIV_20131008.zip",
|
||||
"Mirage_F1":"Mirage_F1_20131022.zip",
|
||||
"Nakajima-B5N":"Nakajima-B5N_20120506.zip",
|
||||
"Nieuport-11":"Nieuport-11_20130729.zip",
|
||||
"Noratlas":"Noratlas_20120717.zip",
|
||||
"Nord-2502":"Nord-2502_20130605.zip",
|
||||
"Nordstern":"Nordstern_20120813.zip",
|
||||
"North-American-T28D-Trojan":"North-American-T28D-Trojan_20140113.zip",
|
||||
"North-American-T6-Texan":"North-American-T6-Texan_20130915.zip",
|
||||
"Northrop-P61":"Northrop-P61_20130107.zip",
|
||||
"Northrop-xb35":"Northrop-xb35_20130823.zip",
|
||||
"OH-1":"OH-1_0.1.zip",
|
||||
"OV10":"OV10_20140116.zip",
|
||||
"P-38-Lightning":"P-38-Lightning_20120717.zip",
|
||||
"P180":"P180_20131022.zip",
|
||||
"P47":"P47_20131022.zip",
|
||||
"PBY-Catalina":"PBY-Catalina_20140107.zip",
|
||||
"PC-12":"PC-12_20121208.zip",
|
||||
"PC-21":"PC-21_20130810.zip",
|
||||
"PC-6":"PC-6_20130810.zip",
|
||||
"PC-9M":"PC-9M_20131025.zip",
|
||||
"PaperAirplane":"PaperAirplane_20101229.zip",
|
||||
"Percival-Mew-Gull":"Percival-Mew-Gull_20130919.zip",
|
||||
"Piaggio-Pegna-Pc-7":"Piaggio-Pegna-Pc-7_20131018.zip",
|
||||
"Pioneer-200":"Pioneer-200_20120506.zip",
|
||||
"Piper-PA-18":"Piper-PA-18_20120506.zip",
|
||||
"Piper-PA-32":"Piper-PA-32_20120506.zip",
|
||||
"Polikarpov-I16":"Polikarpov-I16_20120506.zip",
|
||||
"Pond-Racer":"Pond-Racer_20120506.zip",
|
||||
"Potez-630":"Potez-630_20100313.zip",
|
||||
"Pterodactyl":"Pterodactyl_20100502.zip",
|
||||
"Quickie":"Quickie_20120506.zip",
|
||||
"R22":"R22_20120903.zip",
|
||||
"R44":"R44_20130426.zip",
|
||||
"RAF-S-E-5":"RAF-S-E-5_20120506.zip",
|
||||
"RV-6A":"RV-6A_0.1.zip",
|
||||
"Rascal":"Rascal_0.1.zip",
|
||||
"Ryan-Navion":"Ryan-Navion_20130103.zip",
|
||||
"Ryan-PT22":"Ryan-PT22_20110503.zip",
|
||||
"Ryan-SoSL":"Ryan-SoSL_20120325.zip",
|
||||
"S-51-Dragonfly":"S-51-Dragonfly_20120717.zip",
|
||||
"SM-55":"SM-55_20120506.zip",
|
||||
"SPAD-VII":"SPAD-VII_20120506.zip",
|
||||
"SR71-BlackBird":"SR71-BlackBird_20110614.zip",
|
||||
"SU-37":"SU-37_20130823.zip",
|
||||
"SaabJ35Draken":"SaabJ35Draken_20071217.zip",
|
||||
"SaabJ35F":"SaabJ35F_0.9.1.zip",
|
||||
"Saunders-Roe-Princess":"Saunders-Roe-Princess_1.3.zip",
|
||||
"SeaVixen":"SeaVixen_20130524.zip",
|
||||
"SenecaII":"SenecaII_1.0.zip",
|
||||
"Short-Stirling":"Short-Stirling_20120506.zip",
|
||||
"Short_Empire":"Short_Empire_20140113.zip",
|
||||
"Sikorsky-76C":"Sikorsky-76C_20120723.zip",
|
||||
"Sikorsky-S38":"Sikorsky-S38_20120506.zip",
|
||||
"Sikorsky-S58":"Sikorsky-S58_20131213.zip",
|
||||
"Skyranger":"Skyranger_20131205.zip",
|
||||
"Skyvan":"Skyvan_20131127.zip",
|
||||
"Socata-ST10":"Socata-ST10_20130107.zip",
|
||||
"SpaceShip-One":"SpaceShip-One_20120506.zip",
|
||||
"Spitfire":"Spitfire_20130310.zip",
|
||||
"Stampe-SV4":"Stampe-SV4_20121113.zip",
|
||||
"Starship":"Starship_20130923.zip",
|
||||
"Stearman":"Stearman_20130817.zip",
|
||||
"Stieglitz":"Stieglitz_20091025.zip",
|
||||
"Stiletto":"Stiletto_20110917.zip",
|
||||
"Storch":"Storch_20130313.zip",
|
||||
"Submarine_Scout":"Submarine_Scout_20130115.zip",
|
||||
"Super-Etendard":"Super-Etendard_20131008.zip",
|
||||
"Super-Frelon":"Super-Frelon_20120506.zip",
|
||||
"Supermarine-S.6B":"Supermarine-S.6B_20130312.zip",
|
||||
"Superwal":"Superwal_20100330.zip",
|
||||
"T-4":"T-4_20130620.zip",
|
||||
"T-50":"T-50_20120717.zip",
|
||||
"T37":"T37_20101230.zip",
|
||||
"T38":"T38_20110911.zip",
|
||||
"TBM-Avenger":"TBM-Avenger_20120506.zip",
|
||||
"TU-114":"TU-114_20120717.zip",
|
||||
"TU-95":"TU-95_20120506.zip",
|
||||
"Tecnam-P92":"Tecnam-P92_20120506.zip",
|
||||
"Tigre":"Tigre_20130823.zip",
|
||||
"Tu-134":"Tu-134_20131220.zip",
|
||||
"UH-1":"UH-1_20130810.zip",
|
||||
"UH-60":"UH-60_20120718.zip",
|
||||
"V22-Osprey":"V22-Osprey_0.2.zip",
|
||||
"VMX22-Osprey":"VMX22-Osprey_0.59-28.08.2010.zip",
|
||||
"Velocity-XL":"Velocity-XL_20120506.zip",
|
||||
"Vickers-Vimy":"Vickers-Vimy_20120506.zip",
|
||||
"Vostok-1":"Vostok-1_20120717.zip",
|
||||
"Westland-Whirlwind":"Westland-Whirlwind_20130930.zip",
|
||||
"X15":"X15_20101128.zip",
|
||||
"XB-70":"XB-70_20120730.zip",
|
||||
"YF-23":"YF-23_20120717.zip",
|
||||
"YS-11":"YS-11_0.1.zip",
|
||||
"Yak-18T":"Yak-18T_20121126.zip",
|
||||
"Yak-36":"Yak-36_20121225.zip",
|
||||
"YardStik":"YardStik_0.0.zip",
|
||||
"ZF_Navy_free_balloon":"ZF_Navy_free_balloon_20130107.zip",
|
||||
"ZLT-NT":"ZLT-NT_20130923.zip",
|
||||
"ZivkoEdge":"ZivkoEdge_0.2.zip",
|
||||
"Zlin-50lx":"Zlin-50lx_20131125.zip",
|
||||
"a4":"a4_20130706.zip",
|
||||
"airwaveXtreme150":"airwaveXtreme150_July-2013.zip",
|
||||
"an2":"an2_20131014.zip",
|
||||
"apache":"apache_20110119.zip",
|
||||
"as332":"as332_20091217.zip",
|
||||
"asw20":"asw20_July-2013.zip",
|
||||
"b1900d":"b1900d_20130911.zip",
|
||||
"b26":"b26_20130620.zip",
|
||||
"b29":"b29_20130401.zip",
|
||||
"beaufighter":"beaufighter_20120717.zip",
|
||||
"beech99":"beech99_20081221.zip",
|
||||
"bf109":"bf109_20130615.zip",
|
||||
"bleriot-XI":"bleriot-XI_20130715.zip",
|
||||
"bluebird":"bluebird_10.4.zip",
|
||||
"bo105":"bo105_20140116.zip",
|
||||
"bocian":"bocian_20131104.zip",
|
||||
"c150":"c150_20140116.zip",
|
||||
"c172p":"c172p_20140112.zip",
|
||||
"c172r":"c172r_20130209.zip",
|
||||
"c182":"c182_20130209.zip",
|
||||
"c182rg":"c182rg_20130209.zip",
|
||||
"c310":"c310_20130209.zip",
|
||||
"c310u3a":"c310u3a_20130209.zip",
|
||||
"ch47":"ch47_0.1.zip",
|
||||
"ch53e":"ch53e_0.1.zip",
|
||||
"colditz":"colditz_20090126.zip",
|
||||
"couzinet70":"couzinet70_20120506.zip",
|
||||
"cri-cri":"cri-cri_20080206.zip",
|
||||
"dc2":"dc2_20130209.zip",
|
||||
"dc3":"dc3_20110905.zip",
|
||||
"dc6":"dc6_20131014.zip",
|
||||
"dc8-63":"dc8-63_0.02.zip",
|
||||
"dc8-73":"dc8-73_0.1.zip",
|
||||
"dhc1":"dhc1_20120506.zip",
|
||||
"dhc2":"dhc2_20130315.zip",
|
||||
"dhc3":"dhc3_20120506.zip",
|
||||
"dhc4":"dhc4_20101230.zip",
|
||||
"dhc6":"dhc6_20130202.zip",
|
||||
"dhc8":"dhc8_20120714.zip",
|
||||
"eastbourne_mono":"eastbourne_mono_20130805.zip",
|
||||
"ec130":"ec130_20140117.zip",
|
||||
"ec135":"ec135_0.6.zip",
|
||||
"ercoupe":"ercoupe_20130313.zip",
|
||||
"eurofighter":"eurofighter_1.4.zip",
|
||||
"f-14b":"f-14b_20121124.zip",
|
||||
"f15c":"f15c_20101022.zip",
|
||||
"f16":"f16_20120812.zip",
|
||||
"f18":"f18_20101026.zip",
|
||||
"fa223":"fa223_20120717.zip",
|
||||
"fkdr1":"fkdr1_20130313.zip",
|
||||
"flash2a":"flash2a_20130313.zip",
|
||||
"fokker100":"fokker100_20140116.zip",
|
||||
"fokker50":"fokker50_20130810.zip",
|
||||
"followme":"followme_20110613.zip",
|
||||
"fw190":"fw190_20120717.zip",
|
||||
"harrier":"harrier_20130823.zip",
|
||||
"j22":"j22_20101022.zip",
|
||||
"j7w":"j7w_20120717.zip",
|
||||
"jeep":"jeep_20120717.zip",
|
||||
"jetman":"jetman_20110613.zip",
|
||||
"ju52":"ju52_20131204.zip",
|
||||
"kodiak":"kodiak_20101223.zip",
|
||||
"l39":"l39_20100310.zip",
|
||||
"marchetti":"marchetti_20050614.zip",
|
||||
"me163":"me163_20131022.zip",
|
||||
"me323":"me323_20131022.zip",
|
||||
"mirage2000":"mirage2000_20101024.zip",
|
||||
"mosquito":"mosquito_20130620.zip",
|
||||
"ogel":"ogel_20130209.zip",
|
||||
"ornithopter":"ornithopter_20070710.zip",
|
||||
"p51d":"p51d_20140111.zip",
|
||||
"pa22":"pa22_20090703.zip",
|
||||
"pa24-250":"pa24-250_20121128.zip",
|
||||
"pa28-161":"pa28-161_20120717.zip",
|
||||
"paraglider":"paraglider_20130620.zip",
|
||||
"payen-pa100":"payen-pa100_20101117.zip",
|
||||
"pittss1c":"pittss1c_20120717.zip",
|
||||
"pushback":"pushback_20120717.zip",
|
||||
"rallye-MS893":"rallye-MS893_20131016.zip",
|
||||
"santa":"santa_20130216.zip",
|
||||
"seahawk":"seahawk_20131025.zip",
|
||||
"sf25b":"sf25b_20120222.zip",
|
||||
"sgs233":"sgs233_20120717.zip",
|
||||
"shuttle":"shuttle_20080808.zip",
|
||||
"sm79":"sm79_20131022.zip",
|
||||
"snowplow":"snowplow_1.0.zip",
|
||||
"sopwithCamel":"sopwithCamel_20131008.zip",
|
||||
"spitfireIX":"spitfireIX_20120717.zip",
|
||||
"sr20":"sr20_20120717.zip",
|
||||
"superguppySGT":"superguppySGT_20110613.zip",
|
||||
"tu154":"tu154_20081221.zip",
|
||||
"tu154b":"tu154b_20130805.zip",
|
||||
"ufo":"ufo_20140125.zip",
|
||||
"victor":"victor_20140116.zip",
|
||||
"vulcanb2":"vulcanb2_20140116.zip",
|
||||
"wrightFlyer1903":"wrightFlyer1903_20070710.zip",
|
||||
"x24b":"x24b_20090126.zip",
|
||||
"yak3":"yak3_20131022.zip"
|
||||
}
|
||||
@@ -6,7 +6,7 @@ aircraftTypeTags = [
|
||||
manufacturerTags = [
|
||||
"boeing", "cessna", "diamond", "douglas", "bell", "piper",
|
||||
"airbus", "vickers", "lockheed", "fokker",
|
||||
"embraer", "bombardier", "pilatus", "robin",
|
||||
"embrarer", "bombardier", "pilatus", "robin",
|
||||
"eurocopter"
|
||||
]
|
||||
|
||||
@@ -55,8 +55,7 @@ featureTags = [
|
||||
"etops",
|
||||
"floats",
|
||||
"amphibious",
|
||||
"airship",
|
||||
"aerobatic"
|
||||
"supersonic"
|
||||
]
|
||||
|
||||
propulsionTags = [
|
||||
|
||||
134
create_catalog.py
Executable file
134
create_catalog.py
Executable file
@@ -0,0 +1,134 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os, sys, re
|
||||
import urllib
|
||||
import hashlib # for MD5
|
||||
|
||||
import catalogFilenames
|
||||
import catalogTags
|
||||
import sgprops
|
||||
|
||||
fgRoot = sys.argv[1]
|
||||
aircraftDir = os.path.join(fgRoot, 'Aircraft')
|
||||
|
||||
catalogProps = sgprops.Node()
|
||||
catalogProps.addChild('version').value = '3.1.0'
|
||||
catalogProps.addChild('id').value = 'org.flightgear.default'
|
||||
catalogProps.addChild('license').value = 'GPL'
|
||||
catalogProps.addChild('url').value = "http://fgfs.goneabitbursar.com/pkg/3.1.0/default-catalog.xml"
|
||||
|
||||
catalogProps.addChild('description').value = "Aircraft developed and maintained by the FlightGear project"
|
||||
|
||||
de = catalogProps.addChild('de')
|
||||
# de.addChild('description').value = "<German translation of catalog description>"
|
||||
|
||||
fr = catalogProps.addChild('fr')
|
||||
|
||||
urls = [
|
||||
"http://flightgear.wo0t.de/",
|
||||
"http://ftp.icm.edu.pl/packages/flightgear/",
|
||||
"http://mirrors.ibiblio.org/pub/mirrors/flightgear/ftp/",
|
||||
"http://ftp.igh.cnrs.fr/pub/flightgear/ftp/",
|
||||
"http://ftp.linux.kiev.ua/pub/fgfs/",
|
||||
"http://fgfs.physra.net/ftp/"
|
||||
]
|
||||
|
||||
thumbs = [
|
||||
"http://www.flightgear.org/thumbs/v3.0/{acft}.jpg"
|
||||
]
|
||||
|
||||
standardTagSet = frozenset(catalogTags.tags)
|
||||
def isNonstandardTag(t):
|
||||
return t not in standardTagSet
|
||||
|
||||
# create the download cache dir if require
|
||||
|
||||
cacheDir = '.catalog_cache'
|
||||
if not os.path.isdir(cacheDir):
|
||||
print "Creating catalog cache dir"
|
||||
os.mkdir(cacheDir)
|
||||
|
||||
|
||||
for d in os.listdir(aircraftDir):
|
||||
acftDirPath = os.path.join(aircraftDir, d)
|
||||
if not os.path.isdir(acftDirPath):
|
||||
continue
|
||||
|
||||
setFilePath = None
|
||||
|
||||
# find the first set file
|
||||
# FIXME - way to designate the primary file
|
||||
for f in os.listdir(acftDirPath):
|
||||
if f.endswith("-set.xml"):
|
||||
setFilePath = os.path.join(acftDirPath, f)
|
||||
break
|
||||
|
||||
if setFilePath is None:
|
||||
print "No -set.xml file found in",acftDirPath,"will be skipped"
|
||||
continue
|
||||
|
||||
try:
|
||||
props = sgprops.readProps(setFilePath, dataDirPath = fgRoot)
|
||||
sim = props.getNode("sim")
|
||||
|
||||
pkgNode = catalogProps.addChild('package')
|
||||
|
||||
# basic / mandatory values
|
||||
pkgNode.addChild('id').value = d
|
||||
pkgNode.addChild('name').value = sim.getValue('description')
|
||||
|
||||
longDesc = sim.getValue('long-description')
|
||||
if longDesc is not None:
|
||||
pkgNode.addChild('description').value = longDesc
|
||||
|
||||
# copy all the standard values
|
||||
for p in ['status', 'author', 'license']:
|
||||
v = sim.getValue(p)
|
||||
if v is not None:
|
||||
pkgNode.addChild(p).value = v
|
||||
|
||||
# ratings
|
||||
if sim.hasChild('rating'):
|
||||
pkgRatings = pkgNode.addChild('rating')
|
||||
for r in ['FDM', 'systems', 'cockpit', 'model']:
|
||||
pkgRatings.addChild(r).value = sim.getValue('rating/' + r, 0)
|
||||
|
||||
# copy tags
|
||||
if sim.hasChild('tags'):
|
||||
for c in sim.getChild('tags').getChildren('tag'):
|
||||
if isNonstandardTag(c.value):
|
||||
print "Skipping non-standard tag:", c.value
|
||||
else:
|
||||
pkgNode.addChild('tag').value = c.value
|
||||
|
||||
# create download and thumbnail URLs
|
||||
s = "{url}Aircraft-3.0/"
|
||||
if d not in catalogFilenames.aircraft:
|
||||
print "filename not found for:",d
|
||||
raise RuntimeError("filename not found for:" + d)
|
||||
s += catalogFilenames.aircraft[d]
|
||||
|
||||
for u in urls:
|
||||
pkgNode.addChild("url").value = s.format(url=u)
|
||||
|
||||
for t in thumbs:
|
||||
pkgNode.addChild("thumbnail").value = t.format(acft=d)
|
||||
|
||||
cachedZip = os.path.join(cacheDir, catalogFilenames.aircraft[d])
|
||||
if not os.path.exists(cachedZip):
|
||||
# download the zip
|
||||
url = s.format(url=urls[0])
|
||||
print "Downloading ", url
|
||||
urllib.urlretrieve(url, cachedZip)
|
||||
#else:
|
||||
# print "Using cached zip for", d
|
||||
|
||||
zipFile = open(cachedZip, 'r')
|
||||
|
||||
digest = hashlib.md5(zipFile.read()).hexdigest()
|
||||
pkgNode.addChild("md5").value = digest
|
||||
pkgNode.addChild("file-size-bytes").value = os.path.getsize(cachedZip)
|
||||
except:
|
||||
print "Failure processing:", setFilePath
|
||||
|
||||
catalogProps.write("catalog.xml")
|
||||
@@ -18,7 +18,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
VERSION="2.33"
|
||||
FGVERSION="release/3.6.0"
|
||||
FGVERSION="release/3.4.0"
|
||||
|
||||
#######################################################
|
||||
# THANKS TO
|
||||
|
||||
2
fgdata
2
fgdata
Submodule fgdata updated: b675f440ef...d01b9bb1c7
2
fgrun
2
fgrun
Submodule fgrun updated: 891d3d0037...c67c2ee07a
Submodule flightgear updated: 1852952916...38e5a2a0eb
@@ -1,50 +1,40 @@
|
||||
# git diff --quiet e5f841bc84d31fee339191a59b8746cb4eb8074c -- ./Aircraft/
|
||||
|
||||
|
||||
import subprocess
|
||||
import os, sgprops
|
||||
import os
|
||||
|
||||
class GITCatalogRepository:
|
||||
def __init__(self, node, singleAircraft = False):
|
||||
self._path = node.getValue("path")
|
||||
|
||||
if not os.path.exists(os.path.join(self._path , ".git")):
|
||||
raise RuntimeError("not a Git directory:" + self._path )
|
||||
|
||||
self._usesSubmodules = node.getValue("uses-submodules", False)
|
||||
def __init__(self, path, usesSubmodules = False, singleAircraft = False):
|
||||
self._path = path
|
||||
|
||||
if not os.path.exists(os.path.join(path, ".git")):
|
||||
raise RuntimeError("not a Git directory:" + path)
|
||||
|
||||
self._usesSubmodules = usesSubmodules
|
||||
self._singleAircraft = singleAircraft
|
||||
|
||||
self._currentRevision = subprocess.check_output(["git", "rev-parse", "HEAD"],
|
||||
|
||||
self._currentRevision = subprocess.catch_output(["git", "rev-parse", "HEAD"],
|
||||
cwd = self._path)
|
||||
|
||||
self._aircraftPath = None
|
||||
if node.hasChild("scan-suffix"):
|
||||
self._aircraftPath = os.path.join(path, node.getValue("scan-suffix"))
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
return self._path
|
||||
|
||||
@property
|
||||
def aircraftPath(self):
|
||||
return self._aircraftPath
|
||||
|
||||
def hasPathChanged(self, path, oldRev):
|
||||
diffArgs = ["git", "diff", "--quiet", oldRev, "--"]
|
||||
if not (self._usesSubmodules and self._singleAircraft):
|
||||
diffArgs.append(path)
|
||||
|
||||
|
||||
return subprocess.call(diffArgs, cwd = self._path)
|
||||
|
||||
def update(self):
|
||||
subprocess.call(["git", "pull"])
|
||||
self._currentRevision = subprocess.check_output(["git", "rev-parse", "HEAD"],
|
||||
self._currentRevision = subprocess.catch_output(["git", "rev-parse", "HEAD"],
|
||||
cwd = self._path)
|
||||
|
||||
|
||||
if self._usesSubmodules:
|
||||
subprocess.call(["git", "submodule", "update"], cwd = self._path)
|
||||
subprocess.call(["git", "submodule", "update"], cwd = self._path)
|
||||
|
||||
def scmRevisionForPath(self, path):
|
||||
if self._usesSubmodules:
|
||||
return subprocess.check_output(["git", "rev-parse", "HEAD"], cwd = self._path)
|
||||
|
||||
return subprocess.catch_output(["git", "rev-parse", "HEAD"], cwd = self._path)
|
||||
|
||||
return self._currentRevision
|
||||
|
||||
|
||||
@@ -15,41 +15,33 @@ mkdir -p output
|
||||
rm -rf output/*
|
||||
rm -rf $WORKSPACE/dist/include/simgear $WORKSPACE/dist/libSim* $WORKSPACE/dist/libsg*.a
|
||||
|
||||
PATH=$PATH:$QTPATH
|
||||
echo "Build path is: $PATH"
|
||||
|
||||
###############################################################################
|
||||
echo "Starting on SimGear"
|
||||
pushd sgBuild
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo ../simgear
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -G Xcode ../simgear
|
||||
|
||||
# compile
|
||||
make
|
||||
xcodebuild -configuration RelWithDebInfo -target install build
|
||||
|
||||
if [ $? -ne '0' ]; then
|
||||
echo "make simgear failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make install
|
||||
|
||||
|
||||
popd
|
||||
|
||||
################################################################################
|
||||
echo "Starting on FlightGear"
|
||||
pushd fgBuild
|
||||
cmake -DFG_NIGHTLY=1 -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo ../flightgear
|
||||
cmake -DFG_NIGHTLY=1 -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -G Xcode ../flightgear
|
||||
|
||||
make
|
||||
xcodebuild -configuration RelWithDebInfo -target install build
|
||||
|
||||
if [ $? -ne '0' ]; then
|
||||
echo "make flightgear failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make install
|
||||
|
||||
popd
|
||||
|
||||
chmod +x $WORKSPACE/dist/bin/osgversion
|
||||
|
||||
@@ -132,6 +132,8 @@ File.open("#{contents}/Info.plist", 'w') { |f|
|
||||
|
||||
createArgs = "-format UDBZ -imagekey bzip2-level=9 -quiet -volname #{volName}"
|
||||
|
||||
# work-around for 3.6: copy aircraft files too
|
||||
`rsync -a extended-data/ #{resourcesDir}/data`
|
||||
|
||||
if !$isRelease
|
||||
# create the 'lite' DMG without the base files
|
||||
|
||||
@@ -1,44 +1,228 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os, sys, re, glob, shutil
|
||||
import os, sys, re, glob
|
||||
import hashlib # for MD5
|
||||
import subprocess
|
||||
import shutil # for copy2
|
||||
import catalogTags
|
||||
import sgprops
|
||||
#from multiprocessing import Pool
|
||||
import argparse
|
||||
import urllib2
|
||||
import package as pkg
|
||||
|
||||
import svn_catalog_repository
|
||||
import git_catalog_repository
|
||||
import git_discrete_repository
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--clean", help="Regenerate every package",
|
||||
action="store_true")
|
||||
parser.add_argument("--update", help="Update/pull SCM source",
|
||||
action="store_true")
|
||||
parser.add_argument("--force-dirty", dest="forcedirty",
|
||||
help="Mark every package as dirty", action="store_true")
|
||||
parser.add_argument("--no-update",
|
||||
dest = "noupdate",
|
||||
help="Disable updating from SCM source",
|
||||
action="store_true")
|
||||
parser.add_argument("--no-upload",
|
||||
dest = "noupload",
|
||||
help="Disable uploading to destination server",
|
||||
action="store_true")
|
||||
parser.add_argument("--clean", help="Regenerate every package", type=bool)
|
||||
parser.add_argument("dir", help="Catalog directory")
|
||||
args = parser.parse_args()
|
||||
|
||||
CATALOG_VERSION = 4
|
||||
standardTagSet = frozenset(catalogTags.tags)
|
||||
def isNonstandardTag(t):
|
||||
return t not in standardTagSet
|
||||
|
||||
thumbnailNames = ["thumbnail.png", "thumbnail.jpg"]
|
||||
includePaths = []
|
||||
packages = {}
|
||||
|
||||
def scanPackages(scmRepo):
|
||||
class VariantData:
|
||||
def __init__(self, path, node):
|
||||
#self._primary = primary
|
||||
self._path = path
|
||||
self._name = node.getValue("sim/description")
|
||||
|
||||
# ratings
|
||||
|
||||
# seperate thumbnails
|
||||
|
||||
@property
|
||||
def catalogNode(self):
|
||||
n = sgprops.Node("variant")
|
||||
n.addChild("id").value = self._path
|
||||
n.addChild("name").value = self._name
|
||||
|
||||
class PackageData:
|
||||
def __init__(self, path):
|
||||
self._path = path
|
||||
self._previousSCMRevision = None
|
||||
self._previousRevision = 0
|
||||
self._thumbnails = []
|
||||
self._variants = {}
|
||||
self._revision = 0
|
||||
self._md5 = None
|
||||
self._fileSize = 0
|
||||
|
||||
self._node = sgprops.Node("package")
|
||||
self._node.addChild("id").value = self.id
|
||||
|
||||
def setPreviousData(self, node):
|
||||
self._previousRevision = node.getValue("revision")
|
||||
self._previousMD5 = node.getValue("md5")
|
||||
self._previousSCMRevision = node.getValue("scm-revision")
|
||||
self._fileSize = int(node.getValue("file-size-bytes"))
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
return os.path.basename(self._path)
|
||||
|
||||
@property
|
||||
def thumbnails(self):
|
||||
return self._thumbnails
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
return self._path
|
||||
|
||||
@property
|
||||
def variants(self):
|
||||
return self._variants
|
||||
|
||||
@property
|
||||
def scmRevision(self):
|
||||
currentRev = scmRepo.scmRevisionForPath(self._path)
|
||||
if (currentRev is None):
|
||||
raise RuntimeError("Unable to query SCM revision of files")
|
||||
|
||||
return currentRev
|
||||
|
||||
def isSourceModified(self, scmRepo):
|
||||
if (self._previousSCMRevision == None):
|
||||
return True
|
||||
|
||||
if (self._previousSCMRevision == self.scmRevision):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def scanSetXmlFiles(self, includes):
|
||||
foundPrimary = False
|
||||
foundMultiple = False
|
||||
|
||||
for f in os.listdir(self._path):
|
||||
if not f.endswith("-set.xml"):
|
||||
continue
|
||||
|
||||
p = os.path.join(self._path, f)
|
||||
node = sgprops.readProps(p, includePaths = includes)
|
||||
if not node.hasChild("sim"):
|
||||
continue
|
||||
|
||||
simNode = node.getChild("sim")
|
||||
if (simNode.getValue("exclude", False)):
|
||||
continue
|
||||
|
||||
primary = simNode.getValue("variant-of", None)
|
||||
if primary:
|
||||
if not primary in self.variants:
|
||||
self._variants[primary] = []
|
||||
self._variants[primary].append(VariantData(self, node))
|
||||
continue
|
||||
|
||||
if foundPrimary:
|
||||
if not foundMultiple:
|
||||
print "Multiple primary -set.xml files at:" + self._path
|
||||
foundMultiple = True
|
||||
continue
|
||||
else:
|
||||
foundPrimary = True;
|
||||
|
||||
self.parsePrimarySetNode(simNode)
|
||||
|
||||
for n in thumbnailNames:
|
||||
if os.path.exists(os.path.join(self._path, n)):
|
||||
self._thumbnails.append(n)
|
||||
|
||||
if not foundPrimary:
|
||||
raise RuntimeError("No primary -set.xml found at:" + self._path)
|
||||
|
||||
|
||||
|
||||
def parsePrimarySetNode(self, sim):
|
||||
|
||||
# basic / mandatory values
|
||||
self._node.addChild('name').value = sim.getValue('description')
|
||||
|
||||
longDesc = sim.getValue('long-description')
|
||||
if longDesc is not None:
|
||||
self._node.addChild('description').value = longDesc
|
||||
|
||||
# copy all the standard values
|
||||
for p in ['status', 'author', 'license']:
|
||||
v = sim.getValue(p)
|
||||
if v is not None:
|
||||
self._node.addChild(p).value = v
|
||||
|
||||
# ratings
|
||||
if sim.hasChild('rating'):
|
||||
pkgRatings = self._node.addChild('rating')
|
||||
for r in ['FDM', 'systems', 'cockpit', 'model']:
|
||||
pkgRatings.addChild(r).value = sim.getValue('rating/' + r, 0)
|
||||
|
||||
# copy tags
|
||||
if sim.hasChild('tags'):
|
||||
for c in sim.getChild('tags').getChildren('tag'):
|
||||
if isNonstandardTag(c.value):
|
||||
print "Skipping non-standard tag:", c.value, self.path
|
||||
else:
|
||||
self._node.addChild('tag').value = c.value
|
||||
|
||||
for t in sim.getChildren("thumbnail"):
|
||||
self._thumbnails.append(t.value)
|
||||
|
||||
def validate(self):
|
||||
for t in self._thumbnails:
|
||||
if not os.path.exists(os.path.join(self._path, t)):
|
||||
raise RuntimeError("missing thumbnail:" + t);
|
||||
|
||||
def generateZip(self, outDir):
|
||||
self._revision = self._previousRevision + 1
|
||||
|
||||
zipName = self.id + ".zip"
|
||||
zipFilePath = os.path.join(outDir, zipName)
|
||||
|
||||
os.chdir(os.path.dirname(self.path))
|
||||
|
||||
print "Creating zip", zipFilePath
|
||||
# TODO: exclude certain files
|
||||
# anything we can do to make this faster?
|
||||
subprocess.call(['zip', '--quiet', '-r', zipFilePath, self.id])
|
||||
|
||||
zipFile = open(zipFilePath, 'r')
|
||||
self._md5 = hashlib.md5(zipFile.read()).hexdigest()
|
||||
self._fileSize = os.path.getsize(zipFilePath)
|
||||
|
||||
def useExistingCatalogData(self):
|
||||
self._md5 = self._previousMD5
|
||||
|
||||
def packageNode(self, mirrorUrls, thumbnailUrl):
|
||||
self._node.getChild("md5", create = True).value = self._md5
|
||||
self._node.getChild("file-size-bytes", create = True).value = self._fileSize
|
||||
self._node.getChild("revision", create = True).value = int(self._revision)
|
||||
self._node.getChild("scm-revision", create = True).value = self.scmRevision
|
||||
|
||||
for m in mirrorUrls:
|
||||
self._node.addChild("url").value = m + "/" + self.id + ".zip"
|
||||
|
||||
for t in self._thumbnails:
|
||||
self._node.addChild("thumbnail").value = thumbnailUrl + "/" + self.id + "_" + t
|
||||
|
||||
for pr in self._variants:
|
||||
for vr in self._variants[pr]:
|
||||
self._node.addChild(vr.catalogNode)
|
||||
|
||||
return self._node
|
||||
|
||||
def extractThumbnails(self, thumbnailDir):
|
||||
for t in self._thumbnails:
|
||||
fullName = self.id + "_" + t
|
||||
shutil.copy2(os.path.join(self._path, t),
|
||||
os.path.join(thumbnailDir, fullName)
|
||||
)
|
||||
# TODO : verify image format, size and so on
|
||||
|
||||
def scanPackages(globPath):
|
||||
result = []
|
||||
globPath = scmRepo.aircraftPath
|
||||
if globPath is None:
|
||||
return result
|
||||
|
||||
print "Scanning", globPath
|
||||
print os.getcwd()
|
||||
for d in glob.glob(globPath):
|
||||
@@ -47,16 +231,19 @@ def scanPackages(scmRepo):
|
||||
print "no -set.xml in", d
|
||||
continue
|
||||
|
||||
result.append(pkg.PackageData(d, scmRepo))
|
||||
result.append(PackageData(d))
|
||||
|
||||
return result
|
||||
|
||||
def initScmRepository(node):
|
||||
scmType = node.getValue("type")
|
||||
if (scmType == "svn"):
|
||||
return svn_catalog_repository.SVNCatalogRepository(node)
|
||||
svnPath = node.getValue("path")
|
||||
return svn_catalog_repository.SVNCatalogRepository(svnPath)
|
||||
elif (scmType == "git"):
|
||||
return git_catalog_repository.GITCatalogRepository(node)
|
||||
gitPath = node.getValue("path")
|
||||
usesSubmodules = node.getValue("uses-submodules", False)
|
||||
return git_catalog_repository.GitCatalogRepository(gitPath, usesSubmodules)
|
||||
elif (scmType == "git-discrete"):
|
||||
return git_discrete_repository.GitDiscreteSCM(node)
|
||||
elif (scmType == None):
|
||||
@@ -64,22 +251,8 @@ def initScmRepository(node):
|
||||
else:
|
||||
raise RuntimeError("Unspported SCM type:" + scmType)
|
||||
|
||||
def initRepositories():
|
||||
repositories = []
|
||||
|
||||
for scm in config.getChildren("scm"):
|
||||
scmRepo = initScmRepository(scm)
|
||||
if args.update or (not args.noupdate and scm.getValue("update")):
|
||||
scmRepo.update()
|
||||
# presumably include repos in parse path
|
||||
# TODO: make this configurable
|
||||
includePaths.append(scmRepo.path)
|
||||
repositories.append(scmRepo)
|
||||
|
||||
return repositories
|
||||
|
||||
def processUpload(node, outputPath):
|
||||
if args.noupload or not node.getValue("enabled", True):
|
||||
if not node.getValue("enabled", True):
|
||||
print "Upload disabled"
|
||||
return
|
||||
|
||||
@@ -89,7 +262,6 @@ def processUpload(node, outputPath):
|
||||
node.getValue("remote")],
|
||||
cwd = outputPath)
|
||||
elif (uploadType == "rsync-ssh"):
|
||||
print "Doing rsync upload to:", node.getValue("remote")
|
||||
subprocess.call(["rsync", node.getValue("args", "-azve"),
|
||||
"ssh", ".",
|
||||
node.getValue("remote")],
|
||||
@@ -101,27 +273,8 @@ def processUpload(node, outputPath):
|
||||
else:
|
||||
raise RuntimeError("Unsupported upload type:" + uploadType)
|
||||
|
||||
def parseExistingCatalog():
|
||||
global existingCatalogPath
|
||||
global previousCatalog
|
||||
|
||||
# contains existing catalog
|
||||
existingCatalogPath = os.path.join(outPath, 'catalog.xml')
|
||||
|
||||
if not os.path.exists(existingCatalogPath):
|
||||
url = config.getValue("template/url")
|
||||
print "Attempting downloading from", url
|
||||
try:
|
||||
# can happen on new or from clean, try to pull current
|
||||
# catalog from the upload location
|
||||
response = urllib2.urlopen(url, timeout = 5)
|
||||
content = response.read()
|
||||
f = open(existingCatalogPath, 'w' )
|
||||
f.write( content )
|
||||
f.close()
|
||||
print "...worked"
|
||||
except urllib2.URLError as e:
|
||||
print "Downloading current catalog failed", e, "from", url
|
||||
# dictionary
|
||||
packages = {}
|
||||
|
||||
rootDir = args.dir
|
||||
if not os.path.isabs(rootDir):
|
||||
@@ -153,7 +306,7 @@ thumbnailPath = os.path.join(outPath, config.getValue('thumbnail-dir', "thumbnai
|
||||
if not os.path.exists(thumbnailPath):
|
||||
os.mkdir(thumbnailPath)
|
||||
|
||||
thumbnailUrls = list(t.value for t in config.getChildren("thumbnail-url"))
|
||||
thumbnailUrl = config.getValue('thumbnail-url')
|
||||
|
||||
for i in config.getChildren("include-dir"):
|
||||
if not os.path.exists(i.value):
|
||||
@@ -161,16 +314,30 @@ for i in config.getChildren("include-dir"):
|
||||
continue
|
||||
includePaths.append(i.value)
|
||||
|
||||
parseExistingCatalog()
|
||||
repositories = initRepositories()
|
||||
mirrorUrls = []
|
||||
|
||||
# contains existing catalog
|
||||
existingCatalogPath = os.path.join(outPath, 'catalog.xml')
|
||||
|
||||
scmRepo = initScmRepository(config.getChild('scm'))
|
||||
|
||||
# scan the directories in the aircraft paths
|
||||
for g in config.getChildren("aircraft-dir"):
|
||||
for p in scanPackages(g.value):
|
||||
packages[p.id] = p
|
||||
|
||||
if not os.path.exists(existingCatalogPath):
|
||||
try:
|
||||
# can happen on new or from clean, try to pull current
|
||||
# catalog from the upload location
|
||||
response = urllib2.urlopen(config.getValue("template/url"), timeout = 5)
|
||||
content = response.read()
|
||||
f = open(existingCatalogPath, 'w' )
|
||||
f.write( content )
|
||||
f.close()
|
||||
except urllib2.URLError as e:
|
||||
print "Downloading current catalog failed", e
|
||||
|
||||
for scm in repositories:
|
||||
for p in scanPackages(scm):
|
||||
try:
|
||||
p.scanSetXmlFiles(includePaths)
|
||||
packages[p.id] = p
|
||||
except:
|
||||
print "Skipping SCM package due to exception:", p.path
|
||||
|
||||
if os.path.exists(existingCatalogPath):
|
||||
try:
|
||||
@@ -192,17 +359,17 @@ else:
|
||||
catalogNode = sgprops.Node("catalog")
|
||||
sgprops.copy(config.getChild("template"), catalogNode)
|
||||
|
||||
catalogNode.getChild("catalog-version", create = True).value = CATALOG_VERSION
|
||||
mirrorUrls = list(m.value for m in config.getChildren("mirror"))
|
||||
mirrorUrls = (m.value for m in config.getChildren("mirror"))
|
||||
|
||||
packagesToGenerate = []
|
||||
for p in packages.values():
|
||||
if p.isSourceModified or args.forcedirty:
|
||||
p.scanSetXmlFiles(includePaths)
|
||||
|
||||
if (p.isSourceModified(scmRepo)):
|
||||
packagesToGenerate.append(p)
|
||||
else:
|
||||
p.useExistingCatalogData()
|
||||
|
||||
excludeFilePath = os.path.join(rootDir, "zip-excludes.lst")
|
||||
|
||||
# def f(x):
|
||||
# x.generateZip(outPath)
|
||||
@@ -213,14 +380,15 @@ excludeFilePath = os.path.join(rootDir, "zip-excludes.lst")
|
||||
# print(p.map(f,packagesToGenerate))
|
||||
|
||||
for p in packagesToGenerate:
|
||||
p.generateZip(outPath, excludeFilePath)
|
||||
p.generateZip(outPath)
|
||||
p.extractThumbnails(thumbnailPath)
|
||||
|
||||
print "Creating catalog"
|
||||
for p in packages.values():
|
||||
catalogNode.addChild(p.packageNode(mirrorUrls, thumbnailUrls[0]))
|
||||
catalogNode.addChild(p.packageNode(mirrorUrls, thumbnailUrl))
|
||||
|
||||
catalogNode.write(os.path.join(outPath, "catalog.xml"))
|
||||
|
||||
for up in config.getChildren("upload"):
|
||||
processUpload(up, outPath)
|
||||
print "Uploading"
|
||||
if config.hasChild("upload"):
|
||||
processUpload(config.getChild("upload"), outPath)
|
||||
|
||||
239
package.py
239
package.py
@@ -1,239 +0,0 @@
|
||||
import os, subprocess
|
||||
import sgprops
|
||||
import hashlib # for MD5
|
||||
import shutil # for copy2
|
||||
import catalogTags
|
||||
|
||||
standardTagSet = frozenset(catalogTags.tags)
|
||||
def isNonstandardTag(t):
|
||||
return t not in standardTagSet
|
||||
|
||||
thumbnailNames = ["thumbnail.png", "thumbnail.jpg"]
|
||||
|
||||
class VariantData:
|
||||
def __init__(self, path, node):
|
||||
#self._primary = primary
|
||||
self._path = path
|
||||
self._name = node.getValue("sim/description")
|
||||
if (not self._name):
|
||||
print "Missing description for " + path
|
||||
self._name = "Missing description:" + self.id
|
||||
|
||||
# ratings
|
||||
|
||||
# seperate thumbnails
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
return self._path[:-8] # "remove -set.xml" (8 chars)
|
||||
|
||||
@property
|
||||
def catalogNode(self):
|
||||
n = sgprops.Node("variant")
|
||||
n.addChild("id").value = self.id
|
||||
n.addChild("name").value = self.name
|
||||
return n
|
||||
|
||||
class PackageData:
|
||||
def __init__(self, path, scmRepo):
|
||||
self._path = path
|
||||
self._scm = scmRepo
|
||||
self._previousSCMRevision = None
|
||||
self._previousRevision = 0
|
||||
self._thumbnails = []
|
||||
self._variants = {}
|
||||
self._revision = 0
|
||||
self._md5 = None
|
||||
self._fileSize = 0
|
||||
self._primarySetXmlPath = None
|
||||
self._node = sgprops.Node("package")
|
||||
|
||||
def setPreviousData(self, node):
|
||||
self._previousRevision = node.getValue("revision")
|
||||
self._previousMD5 = node.getValue("md5")
|
||||
self._previousSCMRevision = node.getValue("scm-revision")
|
||||
self._fileSize = int(node.getValue("file-size-bytes"))
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
return self._primarySetXmlPath
|
||||
|
||||
@property
|
||||
def thumbnails(self):
|
||||
return self._thumbnails
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
return self._path
|
||||
|
||||
@property
|
||||
def variants(self):
|
||||
return self._variants
|
||||
|
||||
@property
|
||||
def scmRevision(self):
|
||||
currentRev = self._scm.scmRevisionForPath(self.path)
|
||||
if (currentRev is None):
|
||||
raise RuntimeError("Unable to query SCM revision of files")
|
||||
|
||||
return currentRev
|
||||
|
||||
@property
|
||||
def isSourceModified(self):
|
||||
if (self._previousSCMRevision == None):
|
||||
return True
|
||||
|
||||
if (self._previousSCMRevision == self.scmRevision):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def scanSetXmlFiles(self, includes):
|
||||
foundPrimary = False
|
||||
foundMultiple = False
|
||||
|
||||
for f in os.listdir(self.path):
|
||||
if not f.endswith("-set.xml"):
|
||||
continue
|
||||
|
||||
p = os.path.join(self.path, f)
|
||||
node = sgprops.readProps(p, includePaths = includes)
|
||||
if not node.hasChild("sim"):
|
||||
continue
|
||||
|
||||
simNode = node.getChild("sim")
|
||||
# honour variosu exclusion flags
|
||||
if (simNode.getValue("exclude-from-catalog", False) or simNode.getValue("exclude-from-gui", False)):
|
||||
continue
|
||||
|
||||
primary = simNode.getValue("variant-of", None)
|
||||
if primary:
|
||||
if not primary in self.variants:
|
||||
self._variants[primary] = []
|
||||
self._variants[primary].append(VariantData(f, node))
|
||||
continue
|
||||
|
||||
if foundPrimary:
|
||||
if not foundMultiple:
|
||||
print "Multiple primary -set.xml files at:" + self.path
|
||||
print "\t" + p
|
||||
foundMultiple = True
|
||||
continue
|
||||
else:
|
||||
foundPrimary = True;
|
||||
self._primarySetXmlPath = f[:-8] # trim -set.xml
|
||||
|
||||
self.parsePrimarySetNode(simNode)
|
||||
|
||||
for n in thumbnailNames:
|
||||
if os.path.exists(os.path.join(self.path, n)):
|
||||
self._thumbnails.append(n)
|
||||
|
||||
if not foundPrimary:
|
||||
raise RuntimeError("No primary -set.xml found at:" + self.path)
|
||||
|
||||
|
||||
|
||||
def parsePrimarySetNode(self, sim):
|
||||
|
||||
# basic / mandatory values
|
||||
self._node.addChild('name').value = sim.getValue('description')
|
||||
|
||||
longDesc = sim.getValue('long-description')
|
||||
if longDesc is not None:
|
||||
self._node.addChild('description').value = longDesc
|
||||
|
||||
# copy all the standard values
|
||||
for p in ['status', 'author', 'license']:
|
||||
v = sim.getValue(p)
|
||||
if v is not None:
|
||||
self._node.addChild(p).value = v
|
||||
|
||||
# ratings
|
||||
if sim.hasChild('rating'):
|
||||
pkgRatings = self._node.addChild('rating')
|
||||
for r in ['FDM', 'systems', 'cockpit', 'model']:
|
||||
pkgRatings.addChild(r).value = sim.getValue('rating/' + r, 0)
|
||||
|
||||
# copy tags
|
||||
if sim.hasChild('tags'):
|
||||
for c in sim.getChild('tags').getChildren('tag'):
|
||||
if isNonstandardTag(c.value):
|
||||
print "Skipping non-standard tag:", c.value, self.path
|
||||
else:
|
||||
self._node.addChild('tag').value = c.value
|
||||
|
||||
for t in sim.getChildren("thumbnail"):
|
||||
self._thumbnails.append(t.value)
|
||||
|
||||
def validate(self):
|
||||
for t in self._thumbnails:
|
||||
if not os.path.exists(os.path.join(self.path, t)):
|
||||
raise RuntimeError("missing thumbnail:" + t);
|
||||
|
||||
def generateZip(self, outDir, globalExcludePath):
|
||||
self._revision = self._previousRevision + 1
|
||||
|
||||
baseName = os.path.basename(self.path)
|
||||
zipName = baseName + ".zip"
|
||||
zipFilePath = os.path.join(outDir, zipName)
|
||||
|
||||
os.chdir(os.path.dirname(self.path))
|
||||
|
||||
print "Creating zip", zipFilePath
|
||||
# anything we can do to make this faster?
|
||||
|
||||
zipArgs = ['zip', '--quiet', '-r']
|
||||
if os.path.exists(globalExcludePath):
|
||||
zipArgs += [ "-x@" + globalExcludePath]
|
||||
|
||||
excludePath = os.path.join(self.path, 'package-exclude.lst')
|
||||
if (os.path.exists(excludePath)):
|
||||
print self.id, "has zip exclude list"
|
||||
zipArgs += ["-x@" + excludePath]
|
||||
|
||||
zipArgs += [zipFilePath, baseName]
|
||||
subprocess.call(zipArgs)
|
||||
|
||||
zipFile = open(zipFilePath, 'r')
|
||||
self._md5 = hashlib.md5(zipFile.read()).hexdigest()
|
||||
self._fileSize = os.path.getsize(zipFilePath)
|
||||
|
||||
def useExistingCatalogData(self):
|
||||
self._md5 = self._previousMD5
|
||||
|
||||
def packageNode(self, mirrorUrls, thumbnailUrl):
|
||||
self._node.addChild("id").value = self.id
|
||||
self._node.getChild("md5", create = True).value = self._md5
|
||||
self._node.getChild("file-size-bytes", create = True).value = self._fileSize
|
||||
self._node.getChild("revision", create = True).value = int(self._revision)
|
||||
self._node.getChild("scm-revision", create = True).value = self.scmRevision
|
||||
|
||||
baseName = os.path.basename(self.path)
|
||||
self._node.getChild("dir", create = True).value = baseName
|
||||
zipName = baseName + ".zip"
|
||||
|
||||
for m in mirrorUrls:
|
||||
self._node.addChild("url").value = m + "/" + zipName
|
||||
|
||||
for t in self._thumbnails:
|
||||
self._node.addChild("thumbnail-path").value = t
|
||||
self._node.addChild("thumbnail").value = thumbnailUrl + "/" + self.id + "_" + t
|
||||
|
||||
for pr in self._variants:
|
||||
for vr in self._variants[pr]:
|
||||
self._node.addChild(vr.catalogNode)
|
||||
|
||||
return self._node
|
||||
|
||||
def extractThumbnails(self, thumbnailDir):
|
||||
for t in self._thumbnails:
|
||||
fullName = self.id + "_" + t
|
||||
shutil.copy2(os.path.join(self._path, t),
|
||||
os.path.join(thumbnailDir, fullName)
|
||||
)
|
||||
# TODO : verify image format, size and so on
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# this file runs on the download server (download.flightgear.org)
|
||||
# from the Jenkins upload-via-ssh jobs. It ensures that only complete
|
||||
# uploads are visible (and mirrored to SF).
|
||||
|
||||
import os, sys, re, fnmatch
|
||||
from subprocess import call
|
||||
|
||||
@@ -23,7 +19,6 @@ print "Wildcard pattern is:" + allSuffix
|
||||
pattern = r'\w+-(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)([\w-]*)' + suffix
|
||||
sourceForgeUserHost = "jmturner@frs.sourceforge.net"
|
||||
sftpCommandFile = "sftp-commands"
|
||||
symbolDir = "/home/jenkins/symbols"
|
||||
|
||||
if isReleaseCandidate:
|
||||
publicRoot = "/var/www/html/builds/rc"
|
||||
@@ -94,9 +89,7 @@ for file in incomingFiles:
|
||||
m = re.match(r'(\w+)-\d+\.\d+\.\d+-([\w-]+)' + suffix, file)
|
||||
latestName = m.group(1) + '-latest-' + m.group(2) + suffix
|
||||
|
||||
print "Creating symlink from " + file + " to " + latestName
|
||||
if os.path.exists(latestName):
|
||||
print "\tremoving existing target"
|
||||
os.remove(latestName)
|
||||
os.symlink(file, latestName)
|
||||
|
||||
@@ -118,11 +111,3 @@ if len(oldFiles) > 0:
|
||||
for file in newFiles:
|
||||
print "Uploading " + file + " to SourceForge"
|
||||
call(["scp", file, sourceForgeUserHost + ":" + sourceForgePath + file])
|
||||
|
||||
if sys.argv[1] == 'windows':
|
||||
print "Archiving PDB files"
|
||||
for file in os.listdir(incomingDir):
|
||||
if fnmatch.fnmatch(file, "*.pdb"):
|
||||
srcFile = os.path.join(incomingDir, file)
|
||||
outFile = os.path.join(symbolDir, file)
|
||||
os.rename(srcFile, outFile)
|
||||
|
||||
@@ -11,7 +11,7 @@ class Node(object):
|
||||
self._parent = parent
|
||||
self._name = name
|
||||
self._value = None
|
||||
self._index = index
|
||||
self._index = 0
|
||||
self._children = []
|
||||
|
||||
@property
|
||||
|
||||
2
simgear
2
simgear
Submodule simgear updated: 68fd8e8dba...a52d3540a0
@@ -1,41 +1,25 @@
|
||||
|
||||
import subprocess, os, sgprops
|
||||
import subprocess
|
||||
import xml.etree.cElementTree as ET
|
||||
|
||||
class SVNCatalogRepository:
|
||||
def __init__(self, node):
|
||||
path = node.getValue("path")
|
||||
if not os.path.exists(path):
|
||||
raise RuntimeError("No directory at:" + path)
|
||||
|
||||
def __init__(self, path):
|
||||
self._path = path
|
||||
xml = subprocess.check_output(["svn", "info", "--xml", path])
|
||||
root = ET.fromstring(xml)
|
||||
|
||||
|
||||
if (root.find(".//repository/root") == None):
|
||||
raise RuntimeError("Not an SVN repository:" + path)
|
||||
|
||||
self._aircraftPath = None
|
||||
if node.hasChild("scan-suffix"):
|
||||
self._aircraftPath = os.path.join(path, node.getValue("scan-suffix"))
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
return self._path
|
||||
|
||||
@property
|
||||
def aircraftPath(self):
|
||||
return self._aircraftPath
|
||||
|
||||
|
||||
def hasPathChanged(self, path, oldRevision):
|
||||
return self.scmRevisionForPath(path) != oldRevision
|
||||
|
||||
|
||||
def scmRevisionForPath(self, path):
|
||||
xml = subprocess.check_output(["svn", "info", "--xml", path])
|
||||
root = ET.fromstring(xml)
|
||||
commit = root.find(".//entry/commit")
|
||||
return commit.get('revision', 0)
|
||||
|
||||
|
||||
def update(self):
|
||||
print "SVN update of", self._path
|
||||
subprocess.call(["svn", "update", self._path])
|
||||
subprocess.call(["svn", "update"])
|
||||
|
||||
Submodule windows-3rd-party updated: 527969ffe1...522b07550b
Reference in New Issue
Block a user