[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: preparing for auto compiling



Hi,
	[emailed and posted]

	I have been asked to provide an example of how to move
 packages into CVS, and I think I this is better. I have a script that
 reminded me of all the things I had to do to move my packages into
 CVS, and I have provided it below, as well as an example output for
 makedev.

	I used to have all my packages in /usr/local/src/Packages/;
 so I would have 
 /usr/local/src/Packages/make/make-3.75/
 /usr/local/src/Packages/make/make_3.75.orig.tar.gz
 so that is how the defaults are set up. (edit the script and tell it
 where the CVS workdir will be and where the old packages are).

	Anyway, heres the usage message:
----------------------------------------------------------------------
 usage: cvs-pkginit <Package Name> <Package Version> [<Debian revision>]
 This assumes that there is an old, non-cvs source tree, in say
 /usr/local/src/Packages. The printed out steps asumme the following:
 /usr/local/src/Packages/<Package>/<Package>-<Version>/     #debianized tree
 /usr/local/src/Packages/<Package>/<Package>_<Version>.orig.tar.gz

   This is not automated since human intervention is still required.
----------------------------------------------------------------------

	And here follows the sample output for makedev (the script
 follows my signature)

	manoj
__> cvs-pkginit makedev 1.6 3
#
# The CVS working directory is  /usr/local/src/Workdir
# Old package tree is           /usr/local/src/Packages
# We expect to see
#     /usr/local/src/Packages/makedev/makedev-1.6/
#     /usr/local/src/Packages/makedev/makedev_1.6.orig.tar.gz
#
# Change to the work directory, create the original sources
#
cd /usr/local/src/Workdir
tar zvvfx /usr/local/src/Packages/makedev/makedev_1.6.orig.tar.gz
cp -a makedev_1.6.orig makedev_1.6
mv -f makedev_1.6.orig makedev
# Now for the cvs import process.
cd makedev
cvs import -ko -m 'Initial Import' debian/makedev upstream upstream_version_
cd ..
rm -rf makedev
cvs co makedev
# There should be no changes below
diff -qBbwr makedev-1.6 makedev | grep -v CVS
#
# Now, change directory to where the debianized version exists 
# /usr/local/src/Packages.  
cd /usr/local/src/Packages/makedev/makedev-1.6
sudo ./debian/rules clean
diff -qBbwr . /usr/local/src/Workdir/makedev | grep -v CVS
#
# Add to the following definition based on the diff output above
#
FILES_DIFFERENT=debian
tar cf - $FILES_DIFFERENT | ( cd /usr/local/src/Workdir/makedev; tar xvvpf -)
cd ..
rm -rf makedev-1.6 makedev_1.6-3*
cd /usr/local/src/Workdir/makedev
cvs add debian
cd debian
cvs add -m 'Initial revision' `cvs update 2>/dev/null | egrep '^?' |sed 's/?//'`
cd ..
cvs update 2>/dev/null  | egrep '^M' | sed 's/^M//'
cvs commit -m 'Added all debian changes'
# Check to see if the tags match
cvs-buildpackage -d -n
cvs tag debian_version_1_6-3
cd ..
rm -rf makedev-1.6


-- 
Manoj Srivastava               <url:mailto:srivasta@acm.org>
Mobile, Alabama USA            <url:http://www.datasync.com/%7Esrivasta/>

======================================================================
#! /usr/bin/perl -w
#                              -*- Mode: Perl -*- 
# cvs-pkginit --- 
# Author           : Manoj Srivastava ( srivasta@tiamat.datasync.com ) 
# Created On       : Wed May 28 11:38:18 1997
# Created On Node  : tiamat.datasync.com
# Last Modified By : Manoj Srivastava
# Last Modified On : Sun Jul 20 14:07:39 1997
# Last Machine Used: tiamat.datasync.com
# Update Count     : 39
# Status           : Unknown, Use with caution!
# HISTORY          : 
# Description      : 
# 
# 

use strict;
use diagnostics;
use Carp;
require 5.001;

package main;

=head1 NAME

cvs-pkginit - A tool to print out steps to enter a package into cvs

=cut


=head1 SYNOPSIS

 usage: cvs-pkginit <Package Name> <Package Version> [<Debian revision>]
 This assumes that there is an old, non-cvs source tree, in say
 $exportdir. The printed out steps asumme the following:
 $exportdir/<Package>/<Package>-<Version>/     #debianized tree
 $exportdir/<Package>/<Package>_<Version>.orig.tar.gz

=over 2

=back

=cut

=head1 DESCRIPTION


=cut 

sub main {
  my $exportdir = '/usr/local/src/Packages';
  my $workdir = '/usr/local/src/Workdir';
  my $usage = '';
  my $MYNAME = '';
  my $version= '';
  my $tversion = '';
  my $deb = '';
  my $ko = '';
  my $package = '';

  my $import_msg = "Initial Import";
  my $vendor_tag='upstream';
  my $import_tag="upstream_version_$tversion";

  my $add_msg="Initial revision";
  my $commit_msg='Added all debian changes';
  my $final_tag="debian_version_$tversion";
  
  
  ($MYNAME     = $0) =~ s|.*/||;

  $usage = <<EOUSAGE;
 usage: $MYNAME <Package Name> <Package Version> [<Debian revision>]
 This assumes that there is an old, non-cvs source tree, in say
 $exportdir. The printed out steps asumme the following:
 $exportdir/<Package>/<Package>-<Version>/     #debianized tree
 $exportdir/<Package>/<Package>_<Version>.orig.tar.gz

   This is not automated since human intervention is still required.
EOUSAGE

  # We need three arguments
  die "$usage\n" unless $#ARGV >= 1;
  
  $package = shift @ARGV;
  $version = shift @ARGV;
  $deb     =shift @ARGV;

  ($tversion = $version) =~ tr/\./_/;
  $ko = "-ko" if $deb;
  
  if ($deb) {
    $final_tag="debian_version_$tversion-$deb";
  }
  
  
  print <<"EOINPUT";
#
# The CVS working directory is  $workdir
# Old package tree is           $exportdir
# We expect to see
#     $exportdir/$package/$package-$version/
#     $exportdir/$package/$package\_$version.orig.tar.gz
#
# Change to the work directory, create the original sources
#
cd $workdir
tar zvvfx $exportdir/$package/$package\_$version.orig.tar.gz
cp -a $package\_$version.orig $package\_$version
mv -f $package\_$version.orig $package
# Now for the cvs import process.
cd $package
cvs import $ko -m '$import_msg' debian/$package $vendor_tag $import_tag
cd ..
rm -rf $package
cvs co $package
# There should be no changes below
diff -qBbwr $package-$version $package | grep -v CVS
#
# Now, change directory to where the debianized version exists 
# $exportdir.  
cd $exportdir/$package/$package-$version
sudo ./debian/rules clean
diff -qBbwr . $workdir/$package | grep -v CVS
#
# Add to the following definition based on the diff output above
#
FILES_DIFFERENT=debian
tar cf - \$FILES_DIFFERENT | ( cd $workdir/$package; tar xvvpf -)
cd ..
rm -rf $package-$version $package\_$version-$deb*
cd $workdir/$package
cvs add debian
cd debian
cvs add -m '$add_msg' `cvs update 2>/dev/null | egrep '^\?' |sed 's/\?//'`
cd ..
cvs update 2>/dev/null  | egrep '^M' | sed 's/^M//'
cvs commit -m '$commit_msg'
# Check to see if the tags match
cvs-buildpackage -d -n
cvs tag $final_tag
cd ..
rm -rf $package-$version
EOINPUT
}





=head1 CAVEATS

This is very inchoate, at the moment, and needs testing.

=cut

=head1 BUGS

None Known so far.

=cut

=head1 AUTHOR

Manoj Srivastava <srivasta@debian.org>

=cut

&main::main();

__END__    


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: