source: projects/vbootstrap/trunk/vbuilder.sh.in @ 517

Revision 517, 16.7 KB checked in by munepi, 14 years ago (diff)

vbuilder.sh.in: modified little

Line 
1#!/bin/bash
2# -*- coding: utf-8-unix -*-
3
4Usage_C(){
5    cat<<EOF
6Usage:  $(basename $0) {--version [version]} {--arch [arch]} {--dist-upgrade} {--target [target]} {--with-compat32} {--build|--clean|--build-rpm [src.rpm]|--install-rpm [arch.rpm|package]|--remove-rpm [package]}
7
8Options:
9        --version:              set [version] (default: ${DEFAULT_VERSION})
10        --arch:                 set [arch] (default: $(uname -i))
11        --dist-upgrade:         make VineSeed bootstrap via ${STABLE_VERSION}
12        --unionfs               cover a bootstrap with unionfs
13        --target:               build rpms with [target]
14        --with-compat32:        build rpms with compat32 on boostrap
15
16Actions:
17        --clean:                clean boostrap of [version]
18        --build:                build boostrap of [version]
19        --build-rpm:            build [src.rpm] on boostrap
20        --install-rpm:          install [arch.rpm|package] on boostrap
21        --remove-rpm:           remove [package] on boostrap
22
23For example,
24* make a clean/plain build environment on the current archtecture:
25$(basename $0) --clean --build
26* build rpms from the specified source rpm:
27$(basename $0) --build-rpm [src.rpm]
28* make a plain build environment for Vine Linux 4.2:
29$(basename $0) --version 4.2 --clean --build
30* make a i386 chroot on x86_64:
31$(basename $0) --arch i386 --clean --build
32* build a kernel package with target i686
33$(basename $0) --target i686 --build-rpm [kernel src.rpm]
34* build a compat32 package:
35$(basename $0) --arch i386 --with-compat32 --build-rpm [src.rpm]
36$(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*//)
37EOF
38}
39
40Usage_ja(){
41    Usage_C
42}
43
44Msg_MissingParameter_C(){
45    para=$1
46    cat<<EOF
47E: Missing some parameters after ${para}
48EOF
49}
50
51Msg_MissingParameter_ja(){
52    para=$1
53    cat<<EOF
54E: ${para} 以後のいくつかのパラメータに間違いがあります
55EOF
56}
57
58Msg_NoSupportVARCH_C(){
59    cat<<EOF
60E: arch ${VARCH} is NOT supported on $(uname -i)
61EOF
62}
63
64Msg_NoSupportVARCH_ja(){
65    cat<<EOF
66E: ${VARCH} アーキテクチャは $(uname -i) 上で非サポートです
67EOF
68}
69
70Msg_NoSupportVERSION_C(){
71    cat<<EOF
72E: ${VERSION} is NOT supported
73EOF
74}
75
76Msg_NoSupportVERSION_ja(){
77    cat<<EOF
78E: バージョン ${VERSION} は非サポートです
79EOF
80}
81
82Msg_NoSupportDistUpgradeVERSION_C(){
83    cat<<EOF
84E: version ${VERSION} does not support --dist-upgrade option
85EOF
86}
87
88Msg_NoSupportDistUpgradeVERSION_ja(){
89    cat<<EOF
90E: バージョン ${VERSION} では --dist-upgrade オプションはサポートされていません
91EOF
92}
93
94Msg_NoSupportTARGET_C(){
95    cat<<EOF
96E: rpm build target ${TARGET} is NOT supported
97EOF
98}
99
100Msg_NoSupportTARGET_ja(){
101    cat<<EOF
102E: rpm ビルドターゲット ${TARGET} はサポートされていません
103EOF
104}
105
106Msg_NotPackageName_C(){
107    cat<<EOF
108E: $RPM_PKG is not a package name
109EOF
110}
111
112Msg_NotPackageName_ja(){
113    cat<<EOF
114E: $RPM_PKG はパッケージ名でありません
115EOF
116}
117
118Msg_NotSourceRPM_C(){
119    cat<<EOF
120E: $RPM_PKG is not a source RPM package
121EOF
122}
123
124Msg_NotSourceRPM_ja(){
125    cat<<EOF
126E: $RPM_PKG はソース RPM パッケージでありません
127EOF
128}
129
130##############################################################################
131
132check-parameter(){
133    if [ -z "$*" ]; then
134        Usage_$LOCALE
135        return 1
136    fi
137
138    while [ ! -z "$*" ]; do
139        case $1 in
140            --help)
141                Usage_$LOCALE
142                return 1
143                ;;
144            --version|--arch|--target|--build-rpm|--install-rpm|--remove-rpm)
145                shift
146                check-next-parameter $1 || return 1
147                ;;
148            --dist-upgrade|--unionfs|--with-compat32|--build|--clean)
149                ;;
150            *)
151                Msg_MissingParameter_$LOCALE $1
152                return 1
153                ;;
154        esac
155        shift
156    done
157    return 0
158}
159
160check-next-parameter(){
161    arg=$1
162    if [ -z "${arg}" ]; then
163        Msg_MissingParameter_$LOCALE ${arg}
164        return 1
165    fi
166
167    if [ $(echo ${arg} | grep '^-') ]; then
168        Msg_MissingParameter_$LOCALE ${arg}
169        return 1
170    fi
171    return 0
172}
173
174setup-vbuilder(){
175    ## load default settings
176    if [ -r /etc/vbootstrap/vbuilder.conf ]; then
177        . /etc/vbootstrap/vbuilder.conf
178    fi
179    [ -z "${VBOOTSTRAP_DIR}" ] && \
180        VBOOTSTRAP_DIR=@@VBUILDER_VBOOTSTRAP_DIR@@
181    [ -z "${DEFAULT_VERSION}" ] && \
182        DEFAULT_VERSION=@@VBUILDER_DEFAULT_VERSION@@
183    [ -z "${BUILT_RPMS_DIR}" ] && \
184        BUILT_RPMS_DIR=@@VBUILDER_BUILT_RPMS_DIR@@
185    [ -d $VBOOTSTRAP_DIR ] || mkdir -p $VBOOTSTRAP_DIR
186    VERSION=$DEFAULT_VERSION
187
188    ## current stable relase version
189    STABLE_VERSION=@@VBUILDER_STABLE_VERSION@@
190
191    ## set locale
192    case $LANG in
193        ja*)  LOCALE=ja ;;
194        *)    LOCALE=C ;;
195    esac
196
197    ## set boolian
198    with_setup_vbootstrap=0
199    with_unionfs=0
200    with_dist_upgrade=0
201}
202
203setup-vbootstrap(){
204    if [ ${with_setup_vbootstrap} -eq 0 ]; then
205        with_setup_vbootstrap=1
206
207        ## check a chroot archtecture
208        if [ ! -z ${VARCH} ]; then
209            case "${VARCH}" in
210                i386|i686|x86_64)
211                    [ "$(uname -i)" = "ppc" ] && \
212                        Msg_NoSupportVARCH_$LOCALE
213                    [ $? -eq 0 ] && exit 1
214                    ;;
215                ppc)
216                    [ "$(uname -i)" = "i386" -o "$(uname -i)" = "i686" -o "$(uname -i)" = "x86_64" ] && \
217                        Msg_NoSupportVARCH_$LOCALE
218                    [ $? -eq 0 ] && exit 1
219                    ;;
220            esac
221        fi
222
223        [ -z ${VARCH} ] && VARCH=$(uname -i)
224
225        ##!! 4.2 is NO support on VARCH=x86_64
226        if [ "${VERSION}" = "4.2" -a "${VARCH}" = "x86_64" ]; then
227            Msg_NoSupportVERSION_${LOCALE}
228            exit 1
229        fi
230
231        ## support i386 chroot on x86_64 below:
232        [ "${VARCH}" != "$(uname -i)" ] && VERSION=${VERSION}_${VARCH}
233
234        ## check support ${VERSION}
235        if [ -z "$(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*// | grep -m 1 ${VERSION})" ]; then
236            Msg_NoSupportVERSION_$LOCALE
237            exit 1
238        fi
239
240        ## check ${VERSION} equals VineSeed*, when with_dist_upgrade=1
241        if [ $with_dist_upgrade -eq 1 ]; then
242            if [ "$(echo ${VERSION} | sed -e "s/\(VineSeed\).*/\1/")" != "VineSeed" ]; then
243                Msg_NoSupportDistUpgradeVERSION_$LOCALE
244                exit 1
245            fi
246        fi
247
248        ## check build target option ${TARGET}
249        if [ ! -z "${TARGET}" ]; then
250            RPM_TARGET_LIST="$(cat /usr/lib/rpm/rpmrc | grep arch_canon: | sed -e "s/arch_canon:[[:blank:]]*\(.*\):.*/\1/")"
251            if [ -z "$(echo $RPM_TARGET_LIST | grep $TARGET)" ]; then
252                Msg_NoSupportTARGET_$LOCALE
253                exit 1
254            fi
255        fi
256
257    fi
258
259    MAJOR_VERSION=$(echo ${VERSION} | sed -e "s/_i[0-9]86//")
260
261    BUILD_ROOT=${VBOOTSTRAP_DIR}/${VERSION}
262    BUILD_USER=vbuilder
263    BUILD_DIR=/home/${BUILD_USER}/rpm
264    ARCHIVES_DIR=${BUILD_ROOT}/var/cache/apt/archives
265    CACHE_DIR=${VBOOTSTRAP_DIR}/cache/${VERSION}/apt/archives
266    UNIONFS_DIR=${VBOOTSTRAP_DIR}/unionfs/${VERSION}
267
268    __chroot_sh="/usr/sbin/chroot ${BUILD_ROOT} /bin/sh -c"
269
270    mkdir -p $VBOOTSTRAP_DIR
271}
272
273setup-vbootstrap-rpm(){
274    setup-vbootstrap
275
276    ## check ${BUILD_ROOT}
277    [ -d ${BUILD_ROOT} ] || Build
278
279    DIST_RELEASE=$(cat ${BUILD_ROOT}/etc/vine-release | cut -f3 -d" " | cut -f1 -d.)
280
281    if [ -f $RPM_PKG ]; then
282        BASE_RPM_PKG=$(basename $RPM_PKG)
283        cp -f $RPM_PKG $BUILD_ROOT${BUILD_DIR}
284    else
285        BASE_RPM_PKG=$RPM_PKG   
286    fi
287}
288
289## recover apt-get data on host/chroot
290apt-get-update(){
291    case $1 in
292        --host)
293            echo -n "apt-get update on host ... "
294            apt-get -qq update > /dev/null 2>&1
295            echo "done."
296            ;;
297        --chroot)
298            echo -n "apt-get update on chroot ... "
299            $__chroot_sh 'apt-get -qq update' > /dev/null 2>&1
300            echo "done."
301            ;;
302        *)
303            echo apt-get-update: unknown option $1
304            exit 1
305            ;;
306    esac
307}
308
309## mount-chroot {|--umount} [file system|name]
310## support file systems: /home /tmp /sys /proc /dev/shm /dev/pts /dev
311## support name: vfs chache_dir
312## NOTE: /tmp needs for applications which use X
313##       vfs is virtual file systems
314##       cache_dir is ${CACHE_DIR} to ${ARCHIVES_DIR}
315mount-chroot(){
316    if [ "$1" = "--umount" ]; then
317        mount-chroot-umount $2 || return 1
318    else
319        mount-chroot-mount $1 || return 1
320    fi
321    return 0
322}
323
324## mount-chroot-umount [file system|name]
325mount-chroot-umount(){
326    local fs=$1
327    case $fs in
328        /home|/tmp|/sys|/proc|/dev/shm|/dev/pts|/dev)
329            [ -d ${BUILD_ROOT}${fs} ] || return 1
330            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] || \
331                umount ${BUILD_ROOT}${fs}
332            return 0
333            ;;
334        vfs)
335            # for dir in /sys /proc /dev/shm /dev/pts /dev; do
336            #   mount-chroot-umount ${dir} || return 1
337            # done
338            [ -d ${BUILD_ROOT}/proc ] || return 1
339            [ -z "$(mount | grep ${BUILD_ROOT}/proc)" ] || \
340                umount ${BUILD_ROOT}/proc
341            return 0
342            ;;
343        cache_dir)
344            [ -d ${ARCHIVES_DIR} ] || return 1
345            [ -z "$(mount | grep ${ARCHIVES_DIR})" ] || \
346                umount ${ARCHIVES_DIR}
347            return 0
348            ;;
349        unionfs_dir)
350            [ -d ${BUILD_ROOT} ] || return 1
351            [ -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ] || \
352                umount ${BUILD_ROOT}
353            if [ ! -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ]; then
354                echo "Retry lazy unmount ... "
355                umount -l ${BUILD_ROOT}
356                echo "done."
357            fi
358            return 0
359            ;;
360        *)
361            echo mount-chroot-umount: unknown file system $fs
362            exit 1
363            ;;
364    esac
365}
366
367## mount-chroot-mount [file system|name]
368mount-chroot-mount(){
369    local fs=$1
370    local mnt_opts=""
371
372    case $fs in
373        /home)
374            mnt_opts="-o rbind"
375            ;;
376        *)
377            mnt_opts="--bind"
378            ;;
379    esac
380
381    case $fs in
382        /home|/tmp|/sys|/proc|/dev/shm|/dev/pts|/dev)
383            [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
384            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
385                mount ${mnt_opts} ${fs} ${BUILD_ROOT}${fs}
386            return 0
387            ;;
388        vfs)
389            # for dir in /dev /dev/pts /dev/shm /proc /sys; do
390            #   mount-chroot-mount ${dir} || return 1
391            # done
392            mount-chroot-mount /proc || return 1
393            return 0
394            ;;
395        cache_dir)
396            [ -d ${CACHE_DIR} ] || mkdir -p ${CACHE_DIR}
397            [ -d ${ARCHIVES_DIR} ] || mkdir -p ${ARCHIVES_DIR}
398            [ -z "$(mount | grep ${ARCHIVES_DIR})" ] && \
399                mount ${mnt_opts} ${CACHE_DIR} ${ARCHIVES_DIR}
400            [ -d ${ARCHIVES_DIR}/partial ] || mkdir -p ${ARCHIVES_DIR}/partial
401            return 0
402            ;;
403        unionfs_dir)
404            if [ $with_unionfs -eq 1 ]; then
405                [ -d ${UNIONFS_DIR} ] || mkdir -p ${UNIONFS_DIR}
406                [ -z "$(mount | grep ${BUILD_ROOT})" ] && \
407                    mount -t unionfs -o dirs=${UNIONFS_DIR}=rw:${BUILD_ROOT}=ro unionfs ${BUILD_ROOT}
408                unionctl ${BUILD_ROOT} --list
409            fi
410            return 0
411            ;;
412        *)
413            echo mount-chroot-mount: unknown file system $fs
414            exit 1
415            ;;
416    esac
417   
418}
419
420
421##############################################################################
422
423Clean(){
424    setup-vbootstrap
425
426    # mount-chroot --umount /home
427    # mount-chroot --umount /tmp
428    mount-chroot --umount vfs
429    mount-chroot --umount cache_dir
430    mount-chroot --umount unionfs_dir
431    apt-get-update --host
432
433    if [ $with_unionfs -eq 1 ]; then
434        if [ -d ${UNIONFS_DIR} ]; then
435            echo -n "Cleaning build root \"${UNIONFS_DIR}\" via unionfs ... "
436            rm -rf ${UNIONFS_DIR}
437            echo "done."
438        fi
439    else
440        if [ -d ${BUILD_ROOT} ]; then
441            echo -n "Cleaning build root \"${BUILD_ROOT}\" ... "
442            rm -rf ${BUILD_ROOT}
443            echo "done."
444        fi
445    fi
446
447    echo "Cleanup a build farm for ${VERSION} done."
448}
449
450Retry_vbootstrap-post(){
451    local CHROOT_DIST_RELEASE=$(cat ${BUILD_ROOT}/etc/vine-release | cut -f3 -d" " | cut -f1 -d.)
452    local DIST_RELEASE=$(cat /etc/vine-release | cut -f3 -d" " | cut -f1 -d.)
453
454    if [ "${CHROOT_DIST_RELEASE}" != "${DIST_RELEASE}" ]; then
455        . /usr/share/vbootstrap/scripts/${VERSION}
456        $__chroot_sh "rm /var/lib/rpm/*"
457        $__chroot_sh "rpmdb --initdb"
458        $__chroot_sh "apt-get -qq update"
459        $__chroot_sh "apt-get -qq -y install ${BASE_PKGS}"
460    fi
461}
462
463Build(){
464    setup-vbootstrap
465
466    if [ $with_dist_upgrade -eq 1 ]; then
467        ## make bootstrap of ${STABLE_VERSION}
468        /usr/sbin/vbootstrap \
469            $(echo ${VERSION} | sed -e "s/VineSeed/${STABLE_VERSION}/") \
470            ${BUILD_ROOT}
471
472        ## aim apt-line to VineSeed
473        sed -i "s/apt ${STABLE_VERSION}/apt VineSeed/g" \
474            ${BUILD_ROOT}/etc/apt/sources.list.d/main.list
475    else
476        /usr/sbin/vbootstrap ${VERSION} ${BUILD_ROOT}
477    fi
478
479    ## retry vbootstrap post in Build()
480    Retry_vbootstrap-post
481
482    mount-chroot cache_dir
483    mount-chroot vfs
484    # mount-chroot /tmp
485    # mount-chroot /home
486
487    $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
488
489    ##!! 4.2 has no apt-sourceslist-{plus,nonfree} packages
490    if [ "${MAJOR_VERSION}" != "4.2" ]; then
491        $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-plus'
492        $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-nonfree'
493    fi
494
495    if [ $with_dist_upgrade -eq 1 ]; then
496        $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
497    fi
498    $__chroot_sh 'apt-get -qq -y install build-essential'
499    $__chroot_sh 'apt-get -qq -y install self-build-setup'
500
501    $__chroot_sh 'apt-get -qq -y install etcskel shadow-utils'
502
503    $__chroot_sh 'cd /dev && /sbin/MAKEDEV console'
504    $__chroot_sh 'cd /dev && /sbin/MAKEDEV null'
505    $__chroot_sh 'cd /dev && /sbin/MAKEDEV zero'
506
507    $__chroot_sh '/usr/sbin/pwconv'
508    $__chroot_sh "/usr/sbin/useradd ${BUILD_USER}"
509
510    ##!! for rpm-4.8.0 or higher
511    ##!! (See http://trac.vinelinux.org/wiki/Vine6/AboutUpdateToolchain)
512    if [ "$(echo ${VERSION} | sed -e "s/\(VineSeed\).*/\1/")" = "VineSeed" ]; then
513        $__chroot_sh "sed -i -e 's/^%_topdir/#%_topdir/' /home/${BUILD_USER}/.rpmmacros"
514    fi
515
516    # mount-chroot --umount /home
517    # mount-chroot --umount /tmp
518    mount-chroot --umount vfs
519    mount-chroot --umount cache_dir
520    apt-get-update --host
521
522    echo "Making a build farm for ${VERSION} done."
523}
524
525RPM_Remove(){
526    setup-vbootstrap-rpm
527    mount-chroot unionfs_dir
528    mount-chroot cache_dir
529    mount-chroot vfs
530
531    if [ -f $RPM_PKG ]; then
532        Msg_NotPackageName_$LOCALE
533        exit 1
534    fi
535    $__chroot_sh "apt-get -y remove $BASE_RPM_PKG"
536
537    mount-chroot --umount vfs
538    mount-chroot --umount cache_dir
539    mount-chroot --umount unionfs_dir
540    apt-get-update --host
541}
542
543RPM_Install(){
544    setup-vbootstrap-rpm
545    mount-chroot unionfs_dir
546    mount-chroot cache_dir
547    mount-chroot vfs
548    apt-get-update --chroot
549
550    $__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $BASE_RPM_PKG"
551
552    mount-chroot --umount vfs
553    mount-chroot --umount cache_dir
554    mount-chroot --umount unionfs_dir
555    apt-get-update --host
556}
557
558RPM_Build(){
559    setup-vbootstrap-rpm
560    mount-chroot unionfs_dir
561    mount-chroot cache_dir
562    mount-chroot vfs
563
564    if [ ! -f $RPM_PKG ]; then
565        Msg_NotSourceRPM_$LOCALE
566        exit 1
567    fi
568   
569    RPM_PKG_USER=$(stat -c %U $RPM_PKG)
570    RPM_PKG_GROUP=$(stat -c %G $RPM_PKG)
571    [ ! -z "${SUDO_UID}" ] && RPM_PKG_USER=SUDO_UID
572    [ ! -z "${SUDO_GID}" ] && RPM_PKG_GROUP=SUDO_GID
573    local __install="install -p -v -o ${RPM_PKG_USER} -g ${RPM_PKG_GROUP}"
574    RPM_PKG_ARCH_LIST="RPMS/i386 RPMS/i686 RPMS/x86_64 RPMS/ppc RPMS/noarch SRPMS"
575    [ -z "${TARGET}" ] || \
576        RPM_PKG_ARCH_LIST="RPMS/${TARGET} ${RPM_PKG_ARCH_LIST}"
577
578    ## make src.rpm for $VERSION
579    $__chroot_sh "cd ${BUILD_DIR} && su ${BUILD_USER} -c 'rpm -ivh $BASE_RPM_PKG'"
580    $__chroot_sh "cd ${BUILD_DIR} && su ${BUILD_USER} -c 'rpmbuild -bs --nodeps --clean --rmsource --rmspec ${BUILD_DIR}/SPECS/*.spec'"
581
582
583    ## change ${DIST_RELEASE}
584    BASE_RPM_PKG=$(echo $BASE_RPM_PKG | sed -e "s/vl\([0-9]*\)\./vl${DIST_RELEASE}\./")
585
586    ## rebuild $BASE_RPM_PKG on ${DIST_RELEASE}
587    $__chroot_sh "cd ${BUILD_DIR}/SRPMS && apt-get -y build-dep $BASE_RPM_PKG"
588    $__chroot_sh "cd ${BUILD_DIR}/SRPMS && su ${BUILD_USER} -c 'rpmbuild --rebuild $RPM_OPTS $BASE_RPM_PKG'"
589    $__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $(find $BUILD_ROOT${BUILD_DIR}/RPMS -type f -regex '.*\.rpm' | sed -e s@${BUILD_ROOT}@@g -e 's|.*\/compat32-.*||g' -e 's|.*\/.*\.src\.rpm||g' -e 's/$/ \\/g')"
590
591    ## copy built rpms to ${HOME}/rpm/ for each archtectures
592    echo "Copying built rpms to ${HOME}/rpm/ for each archtectures ... "
593    for i in $RPM_PKG_ARCH_LIST; do \
594        if [ -d $BUILD_ROOT${BUILD_DIR}/${i} ]; then
595            if [ ! -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i} ]; then
596                $__install -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i}/
597                chown -R ${RPM_PKG_USER}:${RPM_PKG_GROUP} ${BUILT_RPMS_DIR}
598            fi
599            find $BUILD_ROOT${BUILD_DIR}/${i} -type f -regex '.*\.rpm' \
600                -exec $__install -m0644 {} ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i}/ \;
601        fi
602    done
603
604    mount-chroot --umount vfs
605    mount-chroot --umount cache_dir
606    mount-chroot --umount unionfs_dir
607    apt-get-update --host
608
609    echo "done."
610}
611
612
613##############################################################################
614
615setup-vbuilder
616
617check-parameter $* || exit 1
618
619while [ $# -gt 0 ]; do
620    tmpARG=$1
621    case $tmpARG in
622        --version|--arch|--target|--build-rpm|--install-rpm|--remove-rpm)
623            shift
624            ;;
625        --dist-upgrade|--unionfs|--with-compat32|--build|--clean)
626            ;;
627        *)
628            echo unknown option $1
629            exit 1
630            ;;
631    esac
632
633    case $tmpARG in
634        --version)
635            VERSION=$1
636            ;;
637        --arch)
638            VARCH=$1
639            ;;
640        --dist-upgrade)
641            with_dist_upgrade=1
642            ;;
643        --unionfs)
644            with_unionfs=1
645            ;;
646        --target)
647            TARGET=$1
648            RPM_OPTS="${RPM_OPTS} --target $TARGET"
649            ;;
650        --with-compat32)
651            RPM_OPTS="${RPM_OPTS} --with compat32"
652            ;;
653        --build-rpm)
654            RPM_PKG=$1
655            RPM_Build || exit 1
656            ;;
657        --install-rpm)
658            RPM_PKG=$1
659            RPM_Install || exit 1
660            ;;
661        --remove-rpm)
662            RPM_PKG=$1
663            RPM_Remove || exit 1
664            ;;
665        --build)
666            Build
667            ;;
668        --clean)
669            Clean
670            ;;
671    esac
672    shift
673done
674
675exit
Note: See TracBrowser for help on using the repository browser.