freight-team / freight

A modern take on the Debian archive.
Other
107 stars 37 forks source link

Working directory not being cleaned after freight add when linking fails #56

Open emillynge opened 7 years ago

emillynge commented 7 years ago

I use freight to add new packages from the docker repos every hour. The newest deb is downloaded, and added to freight and the downloaded file is then cleaned up.

but it seems like freight is not cleaning up the freight.$$.XXXXX working directory when the hard linking fails:

root@4b8294f34e3d:/archive/vpc-lib# find /freight*
find: '/freight*': No such file or directory
root@4b8294f34e3d:/archive# find freight*
freight.1051.jCEizAxtjB
freight.1051.jCEizAxtjB/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.1051.jCEizAxtjB/ln
freight.1079.FU3ArY99qd
freight.1079.FU3ArY99qd/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.1079.FU3ArY99qd/ln
freight.1120.LIqOUWKXz5
freight.1120.LIqOUWKXz5/ln
freight.1120.LIqOUWKXz5/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.11762.gdhFhhEr3O
freight.11762.gdhFhhEr3O/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.11762.gdhFhhEr3O/ln
freight.11789.ymFtKxHlBt
freight.11789.ymFtKxHlBt/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.11789.ymFtKxHlBt/ln
freight.11828.d6PsFQ3e8c
freight.11828.d6PsFQ3e8c/ln
freight.11828.d6PsFQ3e8c/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.12141.cBCo5pmm6M
freight.12141.cBCo5pmm6M/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.12141.cBCo5pmm6M/ln
freight.12170.CkA94cr3Zw
freight.12170.CkA94cr3Zw/ln
freight.12170.CkA94cr3Zw/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.14438.Nbq2wCFOhk
freight.14438.Nbq2wCFOhk/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.14438.Nbq2wCFOhk/ln
freight.14465.p2wJnYm9EU
freight.14465.p2wJnYm9EU/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.14465.p2wJnYm9EU/ln
freight.14505.52QdohvnQM
freight.14505.52QdohvnQM/ln
freight.14505.52QdohvnQM/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.14780.AIeRHEv4BS
freight.14780.AIeRHEv4BS/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.14780.AIeRHEv4BS/ln
freight.14806.50Cp75ouGx
freight.14806.50Cp75ouGx/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.14806.50Cp75ouGx/ln
freight.14846.aAoGTibI0u
freight.14846.aAoGTibI0u/ln
freight.14846.aAoGTibI0u/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.17113.2b8z2bYE7g
freight.17113.2b8z2bYE7g/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.17113.2b8z2bYE7g/ln
freight.17141.imlM2ErPV3
freight.17141.imlM2ErPV3/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.17141.imlM2ErPV3/ln
freight.17183.k8P4wr0Kqv
freight.17183.k8P4wr0Kqv/ln
freight.17183.k8P4wr0Kqv/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.17456.LwES6G5tbN
freight.17456.LwES6G5tbN/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.17456.LwES6G5tbN/ln
freight.17482.RShXZNIL3u
freight.17482.RShXZNIL3u/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.17482.RShXZNIL3u/ln
freight.17522.LeKlnePhWG
freight.17522.LeKlnePhWG/ln
freight.17522.LeKlnePhWG/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.19885.InGCSColiO
freight.19885.InGCSColiO/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.19885.InGCSColiO/ln
freight.19910.PQYPRhU8nm
freight.19910.PQYPRhU8nm/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.19910.PQYPRhU8nm/ln
freight.19952.QKju2HUJyH
freight.19952.QKju2HUJyH/ln
freight.19952.QKju2HUJyH/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.20135.4AX6TCg1VR
freight.20135.4AX6TCg1VR/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.20135.4AX6TCg1VR/ln
freight.20159.k9sBW8Tqby
freight.20159.k9sBW8Tqby/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.20159.k9sBW8Tqby/ln
freight.20199.XWjDCVYsnk
freight.20199.XWjDCVYsnk/ln
freight.20199.XWjDCVYsnk/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.22814.eX8qgFTLQZ
freight.22814.eX8qgFTLQZ/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.22814.eX8qgFTLQZ/ln
freight.22837.EnED3KMsCK
freight.22837.EnED3KMsCK/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.22837.EnED3KMsCK/ln
freight.22877.siHSFy2gse
freight.22877.siHSFy2gse/ln
freight.22877.siHSFy2gse/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.25489.w9u51Q4RJh
freight.25489.w9u51Q4RJh/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.25489.w9u51Q4RJh/ln
freight.25515.VlZumOkV8O
freight.25515.VlZumOkV8O/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.25515.VlZumOkV8O/ln
freight.25555.3SD5Y3Fdxl
freight.25555.3SD5Y3Fdxl/ln
freight.25555.3SD5Y3Fdxl/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.28163.V9etBEUbi9
freight.28163.V9etBEUbi9/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.28163.V9etBEUbi9/ln
freight.28189.3RNJHVlkzr
freight.28189.3RNJHVlkzr/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.28189.3RNJHVlkzr/ln
freight.28230.5J9uaJ2iy9
freight.28230.5J9uaJ2iy9/ln
freight.28230.5J9uaJ2iy9/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.30839.JXkpTSp5WO
freight.30839.JXkpTSp5WO/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.30839.JXkpTSp5WO/ln
freight.30868.9QmoGzZWZz
freight.30868.9QmoGzZWZz/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.30868.9QmoGzZWZz/ln
freight.30908.HmirAKBbt8
freight.30908.HmirAKBbt8/ln
freight.30908.HmirAKBbt8/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.3731.sa0n0oUmcq
freight.3731.sa0n0oUmcq/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.3731.sa0n0oUmcq/ln
freight.3756.H4SPWcxrM6
freight.3756.H4SPWcxrM6/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.3756.H4SPWcxrM6/ln
freight.3797.2cOI8LI7bI
freight.3797.2cOI8LI7bI/ln
freight.3797.2cOI8LI7bI/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.6406.6R3soNWUw1
freight.6406.6R3soNWUw1/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.6406.6R3soNWUw1/ln
freight.6436.G5jXMdAtFx
freight.6436.G5jXMdAtFx/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.6436.G5jXMdAtFx/ln
freight.6475.TouCZAszdx
freight.6475.TouCZAszdx/ln
freight.6475.TouCZAszdx/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.9082.0b8Mo7YTKs
freight.9082.0b8Mo7YTKs/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.9082.0b8Mo7YTKs/ln
freight.9110.MLe5y84Tzs
freight.9110.MLe5y84Tzs/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.9110.MLe5y84Tzs/ln
freight.9151.pMOBC5LI6q
freight.9151.pMOBC5LI6q/ln
freight.9151.pMOBC5LI6q/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb
freight.9424.CHWrtvxyYU
freight.9424.CHWrtvxyYU/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb
freight.9424.CHWrtvxyYU/ln
freight.9449.pRoSou3kkm
freight.9449.pRoSou3kkm/docker-engine_17.03.0~ce-0~ubuntu-xenial_amd64.deb
freight.9449.pRoSou3kkm/ln
freight.9490.Qy8kSOhARp
freight.9490.Qy8kSOhARp/ln
freight.9490.Qy8kSOhARp/docker-engine_17.03.1~ce-0~ubuntu-xenial_amd64.deb

root@4b8294f34e3d:/archive# cat freight.1051.jCEizAxtjB/ln
ln: failed to create hard link 'apt/mlswarm/docker-engine_17.04.0~ce-0~ubuntu-xenial_amd64.deb': File exists

This problem however, only occurs when freight-add is called useing a subprocess in a python script.

It seems the trap statement in freight-add is not firing correctly?