Allow applying a hook to multiple files

Bug #1245826 reported by Alberto Mardegan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
click (Ubuntu)
In Progress
Wishlist
Unassigned

Bug Description

Currently, a click hook can be applied to a single file. However, in some cases it might be needed for a click package to install several files in the same directory. For instance, a click package installing a new account plugin which provides different services (for instance, a website could provide an e-mail service, instant messaging, file sharing, etc.) which are represented to libaccounts via XMl files installed to /usr/share/accounts/services (or ~/.local/share/accounts/services).

I would suggest providing the hook's "Pattern" field with a variable holding the filename of the source file (just the base name, with the path stripped out), so that it can be used to differentiate the symlinks in the target directory. So one could write a Pattern like this for libaccounts's services:

  Pattern: ${home}/.local/share/accounts/services/${id}_${basename}

Then also the manifest file should allow specifying a list of files:

"hooks": {
    "example-app": {
      "apparmor": "apparmor/example-app.json",
      "desktop": "example-app.desktop",
      "account-service": ["cool-email.service", "cool-chat.service"]
    }
  }

Related branches

Colin Watson (cjwatson)
Changed in click (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Chris Wayne (cwayne) wrote :

It would also be helpful to apply hooks to directories recursively

Revision history for this message
Alberto Mardegan (mardy) wrote :

Hi Colin, I linked a branch to this bug and created a merge proposal:
https://code.launchpad.net/~mardy/click/lp1245826/+merge/204674

It's certainly not ready because I didn't update the documentation, but before doing that I'd like you to confirm if you agree with the feature and are OK with the implementation. Please let me know.

Revision history for this message
Michael Vogt (mvo) wrote :

This feature is also useful for the click-systemd and click-bin-path packages.

Michael Vogt (mvo)
Changed in click (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Alberto Mardegan (mardy) wrote :

As far as I am concerned, this bug is no longer important. It's very easy to workaround this limitation by having the hook process a JSON file containing all the information needed: the list of files can be put in there.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.