Created
August 24, 2017 11:09
-
-
Save junaruga/a27c875f7b1a7872b861b9db63f4ebb2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/bin/env python | |
| import sys | |
| import rpm | |
| if __name__ == "__main__": | |
| if len(sys.argv) < 3: | |
| print("Usage: %s <specfile> <macro>" % sys.argv[0]) | |
| sys.exit(1) | |
| spec = sys.argv[1] | |
| macro = sys.argv[2] | |
| ts = rpm.ts() | |
| spec = ts.parseSpec(spec) | |
| print(rpm.expandMacro(macro)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment