summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordaviddavid <geiger.david68210@gmail.com>2024-02-12 18:58:26 +0100
committerdaviddavid <geiger.david68210@gmail.com>2024-02-12 18:58:26 +0100
commitfde9fe10ef2bb4d201f81c28052dd82f36276cff (patch)
treeb2b546c4817844ffd469bd6fc0b2b6145bc5cf6e
parent67beb9c37327603c46beb9c1e0523143d1ffc65f (diff)
downloadbm-fde9fe10ef2bb4d201f81c28052dd82f36276cff.tar
bm-fde9fe10ef2bb4d201f81c28052dd82f36276cff.tar.gz
bm-fde9fe10ef2bb4d201f81c28052dd82f36276cff.tar.bz2
bm-fde9fe10ef2bb4d201f81c28052dd82f36276cff.tar.xz
bm-fde9fe10ef2bb4d201f81c28052dd82f36276cff.zip
Set current working directory for 'unpack (-u)' command (mga#31850)
- Thanks to Aurelian R
-rw-r--r--bm5
-rw-r--r--man/bm.82
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] [<rpm dir>] [<spec file>] [<srpm file>]",
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