diff --git a/bin/is b/bin/is index 8016075bf417753f3c160b54cc47b7e54824e160..d54e2a54fc5b46d467f19fcd1dd1a37155284ef9 100755 --- a/bin/is +++ b/bin/is @@ -100,6 +100,15 @@ def c_cat(parser, args): for filename in args.file: img.cat(filename) +def c_changelog(parser, args): + ''' + Display image's changelog + ''' + # looks if arguments is a file or image name + repoman = load_repositories(args) + img, repo = select_image(args.image, repoman, args.best) + img.changelog.show(int(img.version), args.verbose) + def c_check(parser, args): ''' Check for unreferenced and missing files inside a repository @@ -341,6 +350,15 @@ p_cat.add_argument("file", nargs="+", help="file inside image to cat (globbing allowed)") p_cat.set_defaults(func=c_cat) +# changelog command parser +p_changelog = subparsers.add_parser("changelog", help=c_changelog.__doc__.lower()) +p_changelog.add_argument("-b", "--best", action="store_true", default=False, + help="in best mode, image is the most recent in all repositories") +p_changelog.add_argument("-v", action="store_true", dest="verbose", default=False, + help="display changelog for all versions") +p_changelog.add_argument("image", help="<path|[repository/]image[:version]>") +p_changelog.set_defaults(func=c_changelog) + # check command parser p_check = subparsers.add_parser("check", help=c_check.__doc__.lower()) p_check.add_argument("repository", nargs="+", help="repositories to check") diff --git a/installsystems/image.py b/installsystems/image.py index 5f4a790af2dbc6b009bcce8f69ddfb872374b255..4e3e52ee4b543cbb7717f03256f174c0476d097c 100644 --- a/installsystems/image.py +++ b/installsystems/image.py @@ -517,7 +517,7 @@ class PackageImage(Image): img_changelog = self._tarball.get_str("changelog") desc["changelog"] = Changelog(img_changelog) except KeyError: - pass + desc["changelog"] = Changelog("") except Exception as e: warn("Invalid changelog: %s" % e) return desc