-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* The last-update-time attribute in permissions.json is now optional.…
… You can easilly mark a program as needing to be updated with the command "subuser mark-as-needing-update program-name"
- Loading branch information
1 parent
b1d7f2b
commit d230c69
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python | ||
# This file should be compatible with both Python 2 and 3. | ||
# If it is not, please file a bug report. | ||
import sys | ||
import subuserlib.installTime | ||
import subuserlib.permissions | ||
import subuserlib.availablePrograms | ||
|
||
def printHelp(): | ||
print(""" | ||
Mark a program as needing to be updated. Note, that this may mess up the formatting of it's permissions.json file. | ||
Usage: | ||
$ subuser mark-as-needing-update program-name | ||
""") | ||
|
||
if (not len(sys.argv) == 2) or sys.argv[1] == "help" or sys.argv[1] == "--help" or sys.argv[1] == "-h": | ||
printHelp() | ||
|
||
elif not subuserlib.availablePrograms.available(sys.argv[1]): | ||
print(sys.argv[1] + " is not the name of any known program. Cannot mark it as having an update.") | ||
else: | ||
programName = sys.argv[1] | ||
permissions = subuserlib.permissions.getPermissions(programName) | ||
permissions["last-update-time"] = subuserlib.installTime.currentTimeString() | ||
subuserlib.permissions.setPermissions(programName,permissions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters