source: soft/build_system/build_system/upload/robot/trunk/extracts @ 1

Last change on this file since 1 was 1, checked in by fasma, 13 years ago

Initial Import from Mandriva's soft revision 224062 and package revision 45733

File size: 1.6 KB
Line 
1#!/bin/sh
2
3CVS='/C/EXTRACTS/'
4LOG=$HOME/extracts.log
5
6orig=`pwd`
7
8if [ ! -d $CVS/CVS ]; then
9    echo "you must have a copy of the current SPECS tree"
10    echo "with a command like: (cd $CVS/..; cvs -d $CVSROOT co SPECS)"
11    exit 1
12fi
13
14exec >> $LOG 2>&1
15
16for f in $*; do
17    cd $CVS
18
19    case $f in
20        /*) file=$f;;
21        *) file=$orig/$f;;
22    esac
23
24    echo "processing $f"
25   
26    name=`rpm -q --queryformat '%{NAME}\n' -p $file`
27    tag=r`rpm -q --queryformat '%{VERSION}-%{RELEASE}\n' -p $file|tr . _`
28    host=`hostname`
29
30    # first step try to extract the module or add the module to the repository
31    cvs update -d $name
32
33    if [ ! -d $name/CVS ]; then
34        mkdir $name
35        cvs add $name
36    fi
37   
38    # clean up the directory
39    cd $name
40
41    for d in init.d menu; do
42        if [ ! -d $d/CVS ]; then
43           mkdir $d
44           cvs add $d
45        fi
46    done
47   
48    rm -f `ls init.d menu | fgrep -v CVS`
49
50    # add the new files
51    rpm2cpio $file | cpio -idv './usr/lib/menu/*' './etc/rc.d/init.d/*' './etc/init.d/*' 'usr/lib/menu/*' 'etc/rc.d/init.d/*' 'etc/init.d/*'
52
53    [ -d usr/lib/menu ] && mv -f usr/lib/menu/* menu
54    [ -d etc/rc.d/init.d -o -d etc/init.d ] && mv -f etc/rc.d/init.d/* etc/init.d/* init.d
55    rm -rf usr etc
56
57    # catch the status of the files to take appropriate action
58    cvs -n update | while read state report; do
59        case $state in
60            \?) $doit cvs add -ko $report;;
61            U) $doit cvs remove $report;;
62        esac
63    done
64
65    # archive the changes
66    $doit cvs commit -m "`basename $0` commit from $host"
67
68    # associate a name on this version
69    $doit cvs tag -F $tag
70
71    echo "done"
72done
73
Note: See TracBrowser for help on using the repository browser.