From fde9fe10ef2bb4d201f81c28052dd82f36276cff Mon Sep 17 00:00:00 2001 From: daviddavid Date: Mon, 12 Feb 2024 18:58:26 +0100 Subject: Set current working directory for 'unpack (-u)' command (mga#31850) - Thanks to Aurelian R --- bm | 5 +++-- man/bm.8 | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bm b/bm index f61d3df..7a50e4c 100644 --- a/bm +++ b/bm @@ -23,13 +23,14 @@ def passtrough(option, opt, val, parser): del parser.rargs[:option.nargs] def parse_options(): + workDir = os.getcwd() parser = OptionParser("%prog [OPTIONS] [] [] []", version="%prog "+VERSION) parser.add_option("-a", dest="mode", action="store_const", const="all", help="do everything and build source and binary packages" " (default)", default="all") parser.add_option("-u", dest="mode", action="store_const", const="unpack", - help="just unpack") + help="just unpack - default directory is \""+workDir+"\"") parser.add_option("-p", dest="mode", action="store_const", const="prep", help="unpack and run %prep stage") parser.add_option("-r", dest="mode", action="store_const", const="generate_buildrequires", @@ -49,7 +50,7 @@ def parse_options(): parser.add_option("-o", dest="options", action="append", metavar="OPT", default=[], help="pass given parameters directly to rpm") - parser.add_option("--unpack-dir", metavar="DIR", default="/var/tmp", + parser.add_option("--unpack-dir", metavar="DIR", default=workDir, help="specify directory where to unpack file(s)") parser.add_option("--build-log", metavar="FILE", help="specify where to put the build log for each package") diff --git a/man/bm.8 b/man/bm.8 index 6cd77d9..855dc77 100644 --- a/man/bm.8 +++ b/man/bm.8 @@ -30,7 +30,7 @@ do everything and build source and binary packages (default) .TP .B \fB-u\fP -just unpack +just unpack - default directory is the current working directory .TP .B \fB-p\fP -- cgit v1.2.1