kdeextragear policy question
Otto Bruggeman
bruggie at bruggie.dnsalias.org
Thu Jul 4 21:57:31 BST 2002
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, 4 Jul 2002, Klas Kalass wrote:
> > :-) It is not easy to make a package with that tool right now. I know
> > : that
> >
> > some people have patches but they have not been committed to CVS yet.
> If those people read this, could you (or anyone else of course) please send
> them to me?
Here are my additions... i'm no perl geek (yes it shows) so dont bitch
about the quality of the code, if you dont like it, fix it.
- - It fixes a problem when you have the admin dir as a link.
- - It fixes the SUBDIRS variable in the top Makefile.am in the package
- - It fixes some stuff that needs no fixing but makes it cleaner imo, but
it might fuck up broken tar implementation (aka non-gnu tars).
- - And it cleans up a bit afterwards
Otto
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Made with pgp4pine 1.76
iD8DBQE9JLbBDc93sltYd+ERArRKAKCD8dy8Imt8YcLoE/7PpcG2DcOcjgCfX7ik
H1HURoxRUb8XDQiE3VeE9tE=
=jhbF
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: cvs2pack
===================================================================
RCS file: /home/kde/kdesdk/scripts/cvs2pack,v
retrieving revision 1.3
diff -p -u -3 -r1.3 cvs2pack
--- cvs2pack 2002/04/01 14:07:56 1.3
+++ cvs2pack 2002/06/28 01:13:56
@@ -77,6 +77,7 @@ sub main
push @fromfiles, basedirFiles();
# admin files
+# special case is when admin dir is a link, then link is not properly made
push @fromfiles, "\"$basedir/admin\"";
# override files
@@ -104,7 +105,7 @@ sub main
$src =~ s/\n/ /g;
print "$myname: No. files in copy queue: ", $#fromfiles + 1,"\n";
- system "cp -a $src \"$packagedir\"";
+ system "cp -pRL $src \"$packagedir\"";
# files to remove
@@ -126,25 +127,26 @@ sub main
close RM;
+# Creating a Makefile.am for the top dir
+
+ ModifyMakefileAm( $package, $packagedir );
+
# Run Makefile.cvs
print "$myname: Running Makefile.cvs...\n";
system "cd \"$packagedir\" && make -f Makefile.cvs".
- " && cd .. && tar cf \"$packagedir\".tar \"$packagedir\""
- || die;
+ " && cd .. " || die;
print "Working dir:", `pwd`, "\n";
# Create tar.gz file
-
- print "$myname: tarring... ";
- system "tar cf \"$packagedir.tar\" \"$packagedir\"";
- print "$packagedir.tar\n$myname: gzipping... ";
- system "gzip -9 < \"$packagedir.tar\" > \"$packagedir.tar.gz\" ";
-
- print "$packagedir.tar.gz\n$myname: bzipping... ";
- system "bzip2 < \"$packagedir.tar\" > \"$packagedir.tar.bz2\" ";
- print "$packagedir.tar.bz2\n"
-
+ print "tar cIf \"$packagedir.tar.bz2\" \"$packagedir\"\n";
+ system "tar cIf \"$packagedir.tar.bz2\" \"$packagedir\"\n";
+ print "tar czf \"$packagedir.tar.gz\" \"$packagedir\"\n";
+ system "tar czf \"$packagedir.tar.gz\" \"$packagedir\"\n";
+
+ print "Cleaning up after ourselves:\n";
+ print "rm -rf \"$packagedir\"\n";
+ system "rm -rf \"$packagedir\"\n";
}
sub basedirFiles
@@ -178,6 +180,29 @@ sub MakefileCVS
{
}
+sub ModifyMakefileAm
+{
+ my ( $package, $packagedir ) = @_;
+
+ my $old = "$packagedir/Makefile.am";
+ my $new = "$packagedir/Makefile.am.new";
+ my $bak = "$packagedir/Makefile.am.orig";
+
+ open ( OLD, "< $old" ) or die ( "Can't open $old: $!" );
+ open ( NEW, "> $new" ) or die ( "Can't open $new: $!" );
+
+ # Correct SUBDIRS variable
+ while (<OLD>) {
+ s/SUBDIRS.*=.*\n/SUBDIRS=\$\(TOPSUBDIRS\)\n/i;
+ (print NEW $_) or die "Can't write to $new: $!";
+ }
+
+ close ( OLD ) or die ( "Can't close $old: $!" );
+ close ( NEW ) or die ( "Can't close $new: $!" );
+
+ rename( $old, $bak ) or die ( "Can't rename $old to $bak: $!" );
+ rename( $new, $old ) or die ( "Can't rename $new to $old: $!" );
+}
=head1 DESCRIPTION
More information about the kde-core-devel
mailing list