On 11/17/2011 12:29 PM, Marcus Hüwe wrote:
Hi,
On 2011-11-17 10:06:06 +0100, OBS build-service wrote:
From: Sascha Peilicke
This asymtotically moves towards using file magic... There are already guys naming binary firmware like "$FOO.fw-$VERSION", how are we supposed to catch this?
Hmm what about "guessing" the file type in backend's getfilelist sub (it could use some heuristic like diff does) or you do such a check directly in the webui? Just an idea... Nope, the webui just does filtering by file ending. This is rather easy and doesn't take much resources. You're right basically, just that we should store the file type alongside the blob once it is uploaded.
Then, the API could easily provide another attribute in the /source/$project/$package file listing, preferably the mime type. Everything that isn't text/$foo wouldn't be displayed by the webui... There is also bnc#470611 demanding mime types for correct browser behavior (i.e. displaying raw or presented a download dialog, depending on the OS settings). -- Viele Grüße, Sascha