Skip to content

Subdirectories list is incomplete #14

Description

@dhtdht020

Hello!
While developing OSCDL, I've noticed that the "subdirectories" list provided by the API is incomplete, and has been for quite a few years now.
This issue affects all live API versions, as well as the internal HBB api.

The subdirectories field in the API is essentially just the "Folders to create" value that is passed to the Homebrew Browser via listv036.
This value is intended for (among other things) letting the HBB know which directories, apart from the application directory itself, should be cleared from the SD card when an app is uninstalled/updated.

For example, the application OpenTTD contains the following directories in its archive:

  • /apps/openttd/game
  • /apps/openttd/[...]
  • /apps/openttd/lang
  • /etc
  • /etc/timidity
  • /usr
  • /usr/local
  • /usr/local/lib
  • /usr/local/lib/timidity
  • /usr/local/lib/timidity/Tone_000
  • /usr/local/lib/timidity/Drum_000

There are multiple directories in this application that are unpacked outside of the app directory.
However, at the moment, the HBB only receives the list of directories that are contained in the application directory, so only:

  • /apps/openttd/game
  • /apps/openttd/[...]
  • /apps/openttd/lang

And so, the HBB deletion logic will not clear those directories, and leave them there post app-removal.
This also means that applications based on the API will also not be able to clear those files if they so desire.

The listv036.txt value seems to be valid at this point: https://web.archive.org/web/20230531234025/https://hbb1.oscwii.org/hbb/listv036.txt
And so is the API reponse: https://web.archive.org/web/20230512232051/https://api.oscwii.org/v2/primary/packages

Not an urgent issue at all (we've lived fine with this bug for years apparently, maybe since the inception of repoman), but this should probably be fixed eventually

Relevant code in HBB controller:

StringBuilder subdirectories = new StringBuilder();
for(String folder : compInfo.subdirectories)
subdirectories.append(folder).append(";");
response.append(subdirectories.toString());

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions