[Fedora-livecd-list] imgcreate/creator.py tools/image-creator tools/livecd-creator

2009-04-20 Thread Jeremy Katz
 imgcreate/creator.py |3 +++
 tools/image-creator  |5 +
 tools/livecd-creator |6 ++
 3 files changed, 14 insertions(+)

New commits:
commit 456c1682e5352a1b2277195d5c261d530a014d30
Author: Martin Langhoff 
Date:   Mon Apr 20 18:50:03 2009 +0200

creator: "-d" opt and matching setdebug() method that gets rpm in debug mode

Useful to diagnose problems with %post scripts during the build. This patch
adds the method to the ImageCreator class, and the corresponding options to
image-creator and livecd-creator

diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 823afc5..a7c79c7 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -760,6 +760,9 @@ class ImageCreator(object):
 shutil.move(os.path.join(self._outdir, f),
 os.path.join(destdir, f))
 
+def setdebug(self):
+rpm.setVerbosity(rpm.RPMLOG_DEBUG)
+
 def create(self):
 """Install, configure and package an image.
 
diff --git a/tools/image-creator b/tools/image-creator
index 6f2604c..51b2558 100755
--- a/tools/image-creator
+++ b/tools/image-creator
@@ -30,6 +30,8 @@ def parse_options(args):
 
 parser.add_option("-n", "--name", type="string", dest="name",
   help="Image name and filesystem label")
+parser.add_option("-d", "--debug", action="store_true", dest="debug",
+  help="Enable debug mode")
 
 imgcreate.setup_logging(parser)
 
@@ -61,6 +63,9 @@ def main():
 
 creator = imgcreate.LoopImageCreator(ks, name)
 
+if options.debug:
+creator.setdebug()
+
 try:
 creator.create()
 except imgcreate.CreatorError, e:
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 39f7478..c534900 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -60,6 +60,9 @@ def parse_options(args):
 # Start a shell in the chroot for post-configuration.
 parser.add_option("-l", "--shell", action="store_true", dest="give_shell",
   help=optparse.SUPPRESS_HELP)
+parser.add_option("-d", "--debug", action="store_true", dest="debug",
+  help="Enable debugging during the build")
+
 # Don't compress the image.
 parser.add_option("-s", "--skip-compression", action="store_true", 
dest="skip_compression",
   help=optparse.SUPPRESS_HELP)
@@ -118,6 +121,9 @@ def main():
 if options.cachedir:
 options.cachedir = os.path.abspath(options.cachedir)
 
+if options.debug:
+creator.setdebug()
+
 try:
 creator.mount(options.base_on, options.cachedir)
 creator.install()


--
Fedora-livecd-list mailing list
Fedora-livecd-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-livecd-list


[Fedora-livecd-list] imgcreate/creator.py tools/image-creator tools/livecd-creator

2009-04-21 Thread Jeremy Katz
 imgcreate/creator.py |3 ---
 tools/image-creator  |5 -
 tools/livecd-creator |6 --
 3 files changed, 14 deletions(-)

New commits:
commit 26b39090403d75ef11cb43b52d5a29202a6ad533
Author: Jeremy Katz 
Date:   Tue Apr 21 10:09:16 2009 -0400

Revert "creator: "-d" opt and matching setdebug() method that gets rpm in 
debug mode"

This reverts commit 456c1682e5352a1b2277195d5c261d530a014d30 as the option 
conflicts
with other existing options

diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index a7c79c7..823afc5 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -760,9 +760,6 @@ class ImageCreator(object):
 shutil.move(os.path.join(self._outdir, f),
 os.path.join(destdir, f))
 
-def setdebug(self):
-rpm.setVerbosity(rpm.RPMLOG_DEBUG)
-
 def create(self):
 """Install, configure and package an image.
 
diff --git a/tools/image-creator b/tools/image-creator
index 51b2558..6f2604c 100755
--- a/tools/image-creator
+++ b/tools/image-creator
@@ -30,8 +30,6 @@ def parse_options(args):
 
 parser.add_option("-n", "--name", type="string", dest="name",
   help="Image name and filesystem label")
-parser.add_option("-d", "--debug", action="store_true", dest="debug",
-  help="Enable debug mode")
 
 imgcreate.setup_logging(parser)
 
@@ -63,9 +61,6 @@ def main():
 
 creator = imgcreate.LoopImageCreator(ks, name)
 
-if options.debug:
-creator.setdebug()
-
 try:
 creator.create()
 except imgcreate.CreatorError, e:
diff --git a/tools/livecd-creator b/tools/livecd-creator
index c534900..39f7478 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -60,9 +60,6 @@ def parse_options(args):
 # Start a shell in the chroot for post-configuration.
 parser.add_option("-l", "--shell", action="store_true", dest="give_shell",
   help=optparse.SUPPRESS_HELP)
-parser.add_option("-d", "--debug", action="store_true", dest="debug",
-  help="Enable debugging during the build")
-
 # Don't compress the image.
 parser.add_option("-s", "--skip-compression", action="store_true", 
dest="skip_compression",
   help=optparse.SUPPRESS_HELP)
@@ -121,9 +118,6 @@ def main():
 if options.cachedir:
 options.cachedir = os.path.abspath(options.cachedir)
 
-if options.debug:
-creator.setdebug()
-
 try:
 creator.mount(options.base_on, options.cachedir)
 creator.install()


--
Fedora-livecd-list mailing list
Fedora-livecd-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-livecd-list


Re: [Fedora-livecd-list] imgcreate/creator.py tools/image-creator tools/livecd-creator

2009-04-21 Thread Sebastian Vahl
Am Mon, 20 Apr 2009 19:59:22 + (UTC)
schrieb Jeremy Katz :

>  imgcreate/creator.py |3 +++
>  tools/image-creator  |5 +
>  tools/livecd-creator |6 ++
>  3 files changed, 14 insertions(+)
> 
> New commits:
> commit 456c1682e5352a1b2277195d5c261d530a014d30
> Author: Martin Langhoff 
> Date:   Mon Apr 20 18:50:03 2009 +0200
> 
> creator: "-d" opt and matching setdebug() method that gets rpm in
> debug mode 
> Useful to diagnose problems with %post scripts during the build.
> This patch adds the method to the ImageCreator class, and the
> corresponding options to image-creator and livecd-creator
> 
> diff --git a/imgcreate/creator.py b/imgcreate/creator.py
> index 823afc5..a7c79c7 100644
> --- a/imgcreate/creator.py
> +++ b/imgcreate/creator.py
> @@ -760,6 +760,9 @@ class ImageCreator(object):
>  shutil.move(os.path.join(self._outdir, f),
>  os.path.join(destdir, f))
>  
> +def setdebug(self):
> +rpm.setVerbosity(rpm.RPMLOG_DEBUG)
> +
>  def create(self):
>  """Install, configure and package an image.
>  
> diff --git a/tools/image-creator b/tools/image-creator
> index 6f2604c..51b2558 100755
> --- a/tools/image-creator
> +++ b/tools/image-creator
> @@ -30,6 +30,8 @@ def parse_options(args):
>  
>  parser.add_option("-n", "--name", type="string", dest="name",
>help="Image name and filesystem label")
> +parser.add_option("-d", "--debug", action="store_true",
> dest="debug",
> +  help="Enable debug mode")
>  
>  imgcreate.setup_logging(parser)
>  
> @@ -61,6 +63,9 @@ def main():
>  
>  creator = imgcreate.LoopImageCreator(ks, name)
>  
> +if options.debug:
> +creator.setdebug()
> +
>  try:
>  creator.create()
>  except imgcreate.CreatorError, e:
> diff --git a/tools/livecd-creator b/tools/livecd-creator
> index 39f7478..c534900 100755
> --- a/tools/livecd-creator
> +++ b/tools/livecd-creator
> @@ -60,6 +60,9 @@ def parse_options(args):
>  # Start a shell in the chroot for post-configuration.
>  parser.add_option("-l", "--shell", action="store_true",
> dest="give_shell", help=optparse.SUPPRESS_HELP)
> +parser.add_option("-d", "--debug", action="store_true",
> dest="debug",
> +  help="Enable debugging during the build")
> +
>  # Don't compress the image.
>  parser.add_option("-s", "--skip-compression",
> action="store_true", dest="skip_compression",
> help=optparse.SUPPRESS_HELP) @@ -118,6 +121,9 @@ def main():
>  if options.cachedir:
>  options.cachedir = os.path.abspath(options.cachedir)
>  
> +if options.debug:
> +creator.setdebug()
> +
>  try:
>  creator.mount(options.base_on, options.cachedir)
>  creator.install()
> 
> 


After this patch livecd-creator is broken:

# livecd-creator --help
Traceback (most recent call last): 
  File "/usr/bin/livecd-creator", line 146, in 
sys.exit(main())   
  File "/usr/bin/livecd-creator", line 86, in main 
options = parse_options(sys.argv[1:])  
  File "/usr/bin/livecd-creator", line 64, in parse_options
help="Enable debugging during the build")  
  File "/usr/lib64/python2.6/optparse.py", line 1014, in add_option
self._check_conflict(option)   
  File "/usr/lib64/python2.6/optparse.py", line 989, in _check_conflict
option)
optparse.OptionConflictError: option -d/--debug: conflicting option
string(s): -d, --debug


Sebastian

--
Fedora-livecd-list mailing list
Fedora-livecd-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-livecd-list


Re: [Fedora-livecd-list] imgcreate/creator.py tools/image-creator tools/livecd-creator

2009-04-21 Thread Jeremy Katz
On Wednesday, April 22 2009, Sebastian Vahl said:
> After this patch livecd-creator is broken:
[snip]
> optparse.OptionConflictError: option -d/--debug: conflicting option
> string(s): -d, --debug

That'll teach me to apply "obvious" patches without trying them

Martin -- can you please send an actual *tested* version if you want the
functionality here?

Jeremy

--
Fedora-livecd-list mailing list
Fedora-livecd-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-livecd-list