rev 11712 - scripts
Modestas Vainius
modax-guest at alioth.debian.org
Thu Jul 24 17:59:10 UTC 2008
Author: modax-guest
Date: 2008-07-24 17:59:10 +0000 (Thu, 24 Jul 2008)
New Revision: 11712
Modified:
scripts/autofixtll
Log:
autofixtll: improve documention, make quilt optional
Modified: scripts/autofixtll
===================================================================
--- scripts/autofixtll 2008-07-24 17:22:23 UTC (rev 11711)
+++ scripts/autofixtll 2008-07-24 17:59:10 UTC (rev 11712)
@@ -17,7 +17,7 @@
environment. This script is a wrapper around S<`debian/rules build'> or
whatever command you specify with B<--build-command> option.
-B<autofixtll> depends on B<quilt> to incrementally build up a patch of the
+By default B<autofixtll> uses B<quilt> to incrementally build up a patch of the
changes it does. The script assumes that quilt patches are located in
debian/patches. The default name of the patch is
S<I<"97_fix_target_link_libraries.diff">> (it can be changed with the
@@ -33,10 +33,10 @@
file adding missing libraries. Finally, the build process is restarted.
This loop continues until build completes successfully or the error which
-B<autofixtll> can't handle occurs. In latter case, a user will need to `quilt
-edit' the respective file manually or add more libs to the @LIBS array. Then
-the script can be restarted again (or use --invoke-edit option to invoke
-I<quilt edit> and restart build for you automatically).
+B<autofixtll> can't handle occurs. In latter case, a user will need to edit
+(e.g. with `quilt edit') the respective file manually or add more libs to the
+ at LIBS array. Then the script can be restarted again (or use --invoke-edit
+option to invoke I<quilt edit> and restart build for you automatically).
CMake verbose output must be enabled for B<autofixtll> to work reliably.
@@ -57,18 +57,18 @@
=item B<-c> I<command>, B<--build-command>=I<command>
The command which should be run to build the source. If the command is not
-specific, `debian/rules build' will be executed from the B<source tree>.
-However, if you specify the command, it will be from the B<build tree>.
+specific, `debian/rules build' will be executed.
=item B<-i>, B<--exec-in-build-dir>
-Run build command in the build directory. Default is to run in the source
+Run the build command in the build directory. Default is to run in the source
directory.
=item B<-p>, B<--patch-name>=I<name>
The name of the quilt patch in which all changes made by the script will be
-stored. Default is I<97_fix_target_link_libraries.diff>.
+stored. Default is I<97_fix_target_link_libraries.diff>. If quilt support is
+disabled, this option is ignored.
=item B<--do-backups>, B<--backup>
@@ -77,17 +77,63 @@
=item B<--invoke-edit>, B<--edit>, B<-e>
-Invoke `quilt edit' on the respective CMakeLists.txt when undefined references
+Invoke editor on the respective CMakeLists.txt when undefined references
cannot be automatically resolved and restart build process immediately when the
-editor is closed.
+editor is closed. If quilt support is enabled, `quilt edit' is invoked. Otherwise
+`editor' command is invoked.
=item B<--quilt>=I<command>, B<-q> I<command>
-Use the specified command to invoke quilt instead of default
-`QUILT_PATCHES=debian/patches quilt'
+Use the specified command to invoke quilt instead of default
+`QUILT_PATCHES=debian/patches quilt'. If you want to disable quilt support,
+pass empty string or "none" instead of the command.
=back
+=head1 KNOWN ISSUES
+
+=over 2
+
+B<autofixtll> may loop forever if the link line it adds evalutes to the empty string
+when cmake processes it. This usually means that appropriate find_package() directive
+is missing in the appropriate cmake scope. Therefore in this case you will have to
+interrupt B<autofixtll> and add necessary find_package() directive(s) to the appropriate
+CMakeLists.txt
+
+=back
+
+=head1 EXAMPLE. Fixing Debianized sources (with quilt)
+
+=over 2
+
+B<autofixtll> was designed to be used with Debianized sources which use quilt for patch
+management and store patches in the F<debian/patches> directory. Therefore you just need
+to apply all patches, create a new 97_fix_target_link_libraries.diff patch or push it to
+the top and run B<autofixtll>. E.g.:
+
+
+ $ QUILT_PATCHES=debian/patches quilt push -a
+ $ QUILT_PATCHES=debian/patches quilt new 97_fix_target_link_libraries.diff
+ $ autofixtll
+ $ QUILT_PATCHES=debian/patches quilt refresh -p ab --no-timestamps --no-index
+
+The patch will be written to F<debian/patches/97_fix_target_link_libraries.diff>.
+
+=back
+
+=head1 EXAMPLE. Fixing non-Debianized sources (without quilt)
+
+=over 2
+
+B<autofixtll> is quite customizable and you use it to fix non-Debianized sources. Therefore
+you will have to do something like this (at least):
+
+ $ mkdir builddir
+ $ cd builddir && cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON <other flags>
+ $ autofixtll -i -c make -d builddir -q none
+
+=back
+
=head1 LICENSE
This program is free software: you can redistribute it and/or modify it under
@@ -129,9 +175,6 @@
new Library('solid', '${KDE4_SOLID_LIBS}'),
new Library('kdecore', '${KDE4_KDECORE_LIBS}'),
new Library('kdeui', '${KDE4_KDEUI_LIBS}'),
- new Library('kparts', '${KDE4_KPARTS_LIBS}'),
- new Library('ktexteditor', '${KDE4_KTEXTEDITOR_LIBS}'),
- new Library('kio', '${KDE4_KIO_LIBS}'),
new Library('kde3support', '${KDE4_KDE3SUPPORT_LIBRARY}'),
);
@@ -391,7 +434,7 @@
return 0;
} else {
# Write
- system("$QUILT add '$cmakelists'");
+ system("$QUILT add '$cmakelists'") if (defined $QUILT);
open(CMAKELISTS, ">$cmakelists.tmp");
for (@contents) {
print CMAKELISTS $_;
@@ -413,7 +456,7 @@
sub invoke_edit {
my ($cmakelists, $do_invoke) = @_;
- my $quilt_cmd = "$QUILT edit '$cmakelists'";
+ my $quilt_cmd = (defined $QUILT) ? "$QUILT edit '$cmakelists'" : "editor '$cmakelists'";
if ($do_invoke) {
print "$MSG_PREFIX Press ENTER to edit '$cmakelists' or ^C to cancel ...";
@@ -527,12 +570,14 @@
system("dh_testdir") == 0 or die "$MSG_PREFIX Please run this script from the debianized source tree $MSG_PREFIX\n";
}
- my $toppatch = `$QUILT top`;
- chomp $toppatch;
- if (!defined $toppatch || $toppatch ne $patchname) {
- die "$MSG_PREFIX Quilt top patch must be named '$patchname' when this script is run. Please either:\n" .
- "$MSG_PREFIX \$ $QUILT push $patchname\n" .
- "$MSG_PREFIX \$ $QUILT new $patchname\n";
+ if (defined $QUILT) {
+ my $toppatch = `$QUILT top`;
+ chomp $toppatch;
+ if (!defined $toppatch || $toppatch ne $patchname) {
+ die "$MSG_PREFIX Quilt top patch must be named '$patchname' when this script is run. Please either:\n" .
+ "$MSG_PREFIX \$ $QUILT push $patchname\n" .
+ "$MSG_PREFIX \$ $QUILT new $patchname\n";
+ }
}
}
@@ -544,7 +589,7 @@
############## Main loop ##############################
-$main::VERSION = "0.5.6";
+$main::VERSION = "0.5.7";
my $sourcedir = Cwd::getcwd();
my $builddir = "obj-" . get_gnu_build_type();
@@ -568,6 +613,8 @@
pod2usage(-exitval => 1, -verbose => 2, -noperldoc => 1) if ($show_help);
+ $QUILT = undef() if ($QUILT =~ m/^\s*$/ || $QUILT eq "none");
+
$builddir = Cwd::realpath(File::Spec->catdir($sourcedir, $builddir));
check_environment($builddir, $buildcmd, $patchname);
@@ -581,8 +628,8 @@
}
if ($ret == 1) {
- print "$MSG_PREFIX If build process is complete, you may want to run the following command to build/refresh the patch\n" .
- "$MSG_PREFIX \$ $QUILT refresh -p ab --no-timestamps --no-index\n";
+ print "$MSG_PREFIX If build process is complete, you may want to run the following command to build/refresh the patch\n";
+ print "$MSG_PREFIX \$ $QUILT refresh -p ab --no-timestamps --no-index\n" if (defined $QUILT);
if ($do_backups) {
print "$MSG_PREFIX Also run the following command to cleanup backup files:\n" .
"$MSG_PREFIX \$ find -name 'CMakeLists.txt.orig' -delete\n";
More information about the pkg-kde-commits
mailing list