To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1592
1591  |  1593
Subject: 
Configuration Management
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 26 Dec 2000 19:38:53 GMT
Viewed: 
1481 times
  
I've written a bash shell script to create a release archive of legOS.  Unlike
most projects on SourceForge, legOS doesn't actually have a build process, it's
simply a matter of packaging up the files.  There are two files, the script
itself (I call it makeimg.sh, but a more descriptive name is probably in order)
and exclude.lst, which is a list of file masks to exclude from the image
archive.

This script has only been tested in a DOS box using DJGPP tools, but I strived
to make it portable.

After it runs, the archive will be found in the current directory.

---- exclude.lst begins here ----
.cvsignore
CVS
cvs
Doxyfile
---- exclude.lst ends

---- makeimg.sh begins here - beware of line wrapping!
#!/bin/bash

# Release script for legOS.  Creates a .tar.gz file containing the current
# state of the legOS repository.  The file "exclude.lst" contains a list
# of files/directories to exclude from the archive, e.g. "CVS".  exclude.lst
# must be in the same directory as makeimg.sh.
#
# syntax:  makeimg.sh {tag}
#     eg:  makeimg.sh 0.2.5

# author:  Rossz Vámos-Wentworth rossz2@home.com

# WARNING! This script will destroy the directory 'tmpimage' (relative to
# the current directory) if it exists!

if [ -z $1 ]; then
echo ERROR, you must specify a version or tag, e.g. 0.2.5
exit 1
fi

echo Creating $(pwd)/legOS-$1.tar.gz
exclude=$(dirname $0)"/exclude.lst"

# Start with a clean slate
rm -fr tmpimage
rm -f legOS-$1.tar.gz
mkdir tmpimage

# Get everything from the CVS repository

# In a proper build environment, always tag the modules before building.
# This is to ensure reproducibility (e.g. the archive is accidently
# deleted and needs to be recreated exactly as before). Unfortunately,
# I am not familiar with the tag option and don't wish to mess with the
# repository to learn.

# For safety, read-only access is used here.  You should be connected
# to the internet before running this script (unless your system is
# configured to automatically connect on demand).

cd tmpimage
cvs -l -d:pserver:anonymous@cvs.legOS.sourceforge.net:/cvsroot/legos co legOS
cd ..

# Any files that are created at release time should be handled here
# Create the directory using "mkdir -p tmpimage/legOS/{dirname}" if
# you aren't sure if the directory already exists.

echo $1>tmpimage/legOS/VERSION

# create the archive
cd tmpimage
tar -cz --exclude-from=${exclude} legOS >../legOS-$1.tar.gz
cd ..

# clean up
rm -fr tmpimage
---- makeimg ends

Rossz, rossz2 AT home DOT com



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR