source: projects/vbootstrap/tags/0.0.16/vbuilder.sh.in @ 485

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

updated vbuilder.sh.in: added --unionfs option

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            --version|--arch|--target|--build-rpm|--install-rpm|--remove-rpm)
141                shift
142                check-next-parameter $1 || return 1
143                ;;
144            --dist-upgrade|--unionfs|--with-compat32|--build|--clean)
145                ;;
146            *)
147                Msg_MissingParameter_$LOCALE $1
148                return 1
149                ;;
150        esac
151        shift
152    done
153    return 0
154}
155
156check-next-parameter(){
157    arg=$1
158    if [ -z "${arg}" ]; then
159        Msg_MissingParameter_$LOCALE ${arg}
160        return 1
161    fi
162
163    if [ $(echo ${arg} | grep '^-') ]; then
164        Msg_MissingParameter_$LOCALE ${arg}
165        return 1
166    fi
167    return 0
168}
169
170setup-vbuilder(){
171    ## load default settings
172    if [ -r /etc/vbootstrap/vbuilder.conf ]; then
173        . /etc/vbootstrap/vbuilder.conf
174    fi
175    [ -z "${VBOOTSTRAP_DIR}" ] && \
176        VBOOTSTRAP_DIR=@@VBUILDER_VBOOTSTRAP_DIR@@
177    [ -z "${DEFAULT_VERSION}" ] && \
178        DEFAULT_VERSION=@@VBUILDER_DEFAULT_VERSION@@
179    [ -z "${BUILT_RPMS_DIR}" ] && \
180        BUILT_RPMS_DIR=@@VBUILDER_BUILT_RPMS_DIR@@
181    [ -d $VBOOTSTRAP_DIR ] || mkdir -p $VBOOTSTRAP_DIR
182    VERSION=$DEFAULT_VERSION
183
184    ## current stable relase version
185    STABLE_VERSION=@@VBUILDER_STABLE_VERSION@@
186
187    ## set locale
188    case $LANG in
189        ja*)  LOCALE=ja ;;
190        *)    LOCALE=C ;;
191    esac
192
193    ## set boolian
194    with_setup_vbootstrap=0
195    with_unionfs=0
196    with_dist_upgrade=0
197}
198
199setup-vbootstrap(){
200    if [ ${with_setup_vbootstrap} -eq 0 ]; then
201        with_setup_vbootstrap=1
202
203        ## check a chroot archtecture
204        if [ ! -z ${VARCH} ]; then
205            case "${VARCH}" in
206                i386)
207                    [ "$(uname -i)" = "ppc" ] && \
208                        Msg_NoSupportVARCH_$LOCALE
209                    [ $? -eq 0 ] && exit 1
210                    ;;
211                i686)
212                    [ "$(uname -i)" = "ppc" ] && \
213                        Msg_NoSupportVARCH_$LOCALE
214                    [ $? -eq 0 ] && exit 1
215                    ;;
216                x86_64)
217                    [ "$(uname -i)" = "ppc" ] && \
218                        Msg_NoSupportVARCH_$LOCALE
219                    [ $? -eq 0 ] && exit 1
220                    ;;
221                ppc)
222                    [ "$(uname -i)" = "i386" -o "$(uname -i)" = "i686" -o "$(uname -i)" = "x86_64" ] && \
223                        Msg_NoSupportVARCH_$LOCALE
224                    [ $? -eq 0 ] && exit 1
225                    ;;
226            esac
227        fi
228
229        [ -z ${VARCH} ] && VARCH=$(uname -i)
230
231        ##!! 4.2 is NO support on VARCH=x86_64
232        if [ "${VERSION}" = "4.2" -a "${VARCH}" = "x86_64" ]; then
233            Msg_NoSupportVERSION_${LOCALE}
234            exit 1
235        fi
236
237        ## support i386 chroot on x86_64 below:
238        [ "${VARCH}" != "$(uname -i)" ] && VERSION=${VERSION}_${VARCH}
239
240        ## check support ${VERSION}
241        if [ -z "$(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*// | grep -m 1 ${VERSION})" ]; then
242            Msg_NoSupportVERSION_$LOCALE
243            exit 1
244        fi
245
246        ## check ${VERSION} equals VineSeed*, when with_dist_upgrade=1
247        if [ $with_dist_upgrade -eq 1 ]; then
248            if [ "$(echo ${VERSION} | sed -e "s/\(VineSeed\).*/\1/")" != "VineSeed" ]; then
249                Msg_NoSupportDistUpgradeVERSION_$LOCALE
250                exit 1
251            fi
252        fi
253
254        ## check build target option ${TARGET}
255        if [ ! -z "${TARGET}" ]; then
256            RPM_TARGET_LIST="$(cat /usr/lib/rpm/rpmrc | grep arch_canon: | sed -e "s/arch_canon:[[:blank:]]*\(.*\):.*/\1/")"
257            if [ -z "$(echo $RPM_TARGET_LIST | grep $TARGET)" ]; then
258                Msg_NoSupportTARGET_$LOCALE
259                exit 1
260            fi
261        fi
262
263    fi
264
265    MAJOR_VERSION=$(echo ${VERSION} | sed -e "s/_i[0-9]86//")
266
267    BUILD_ROOT=${VBOOTSTRAP_DIR}/${VERSION}
268    BUILD_USER=vbuilder
269    BUILD_DIR=/home/${BUILD_USER}/rpm
270    ARCHIVES_DIR=${BUILD_ROOT}/var/cache/apt/archives
271    CACHE_DIR=${VBOOTSTRAP_DIR}/cache/${VERSION}/apt/archives
272    UNIONFS_DIR=${VBOOTSTRAP_DIR}/unionfs/${VERSION}
273
274    __chroot_sh="/usr/sbin/chroot ${BUILD_ROOT} /bin/sh -c"
275
276    mkdir -p $VBOOTSTRAP_DIR
277}
278
279setup-vbootstrap-rpm(){
280    setup-vbootstrap
281
282    ## check ${BUILD_ROOT}
283    [ -d ${BUILD_ROOT} ] || Build
284
285    DIST_RELEASE=$(cat ${BUILD_ROOT}/etc/vine-release | cut -f3 -d" " | cut -f1 -d.)
286
287    if [ -f $RPM_PKG ]; then
288        BASE_RPM_PKG=$(basename $RPM_PKG)
289        cp -f $RPM_PKG $BUILD_ROOT${BUILD_DIR}
290    else
291        BASE_RPM_PKG=$RPM_PKG   
292    fi
293}
294
295## recover apt-get data on host/chroot
296apt-get-update(){
297    case $1 in
298        --host)
299            echo -n "apt-get update on host ... "
300            apt-get -qq update > /dev/null 2>&1
301            echo "done."
302            ;;
303        --chroot)
304            echo -n "apt-get update on chroot ... "
305            $__chroot_sh 'apt-get -qq update' > /dev/null 2>&1
306            echo "done."
307            ;;
308        *)
309            echo apt-get-update: unknown option $1
310            exit 1
311            ;;
312    esac
313}
314
315## mount-chroot {|--umount} [file system|name]
316## support file systems: /home /tmp /sys /proc /dev/shm /dev/pts /dev
317## support name: vfs chache_dir
318## NOTE: /tmp needs for applications which use X
319##       vfs is virtual file systems
320##       cache_dir is ${CACHE_DIR} to ${ARCHIVES_DIR}
321mount-chroot(){
322    if [ "$1" = "--umount" ]; then
323        mount-chroot-umount $2 || return 1
324    else
325        mount-chroot-mount $1 || return 1
326    fi
327    return 0
328}
329
330## mount-chroot-umount [file system|name]
331mount-chroot-umount(){
332    local fs=$1
333    case $fs in
334        /home|/tmp|/sys|/proc|/dev/shm|/dev/pts|/dev)
335            [ -d ${BUILD_ROOT}${fs} ] || return 1
336            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] || \
337                umount ${BUILD_ROOT}${fs}
338            return 0
339            ;;
340        vfs)
341            # for dir in /sys /proc /dev/shm /dev/pts /dev; do
342            #   mount-chroot-umount ${dir} || return 1
343            # done
344            [ -d ${BUILD_ROOT}/proc ] || return 1
345            [ -z "$(mount | grep ${BUILD_ROOT}/proc)" ] || \
346                umount ${BUILD_ROOT}/proc
347            return 0
348            ;;
349        cache_dir)
350            [ -d ${ARCHIVES_DIR} ] || return 1
351            [ -z "$(mount | grep ${ARCHIVES_DIR})" ] || \
352                umount ${ARCHIVES_DIR}
353            return 0
354            ;;
355        unionfs_dir)
356            [ -d ${BUILD_ROOT} ] || return 1
357            [ -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ] || \
358                umount ${BUILD_ROOT}
359            if [ ! -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ]; then
360                echo "Retry lazy unmount ... "
361                umount -l ${BUILD_ROOT}
362                echo "done."
363            fi
364            return 0
365            ;;
366        *)
367            echo mount-chroot-umount: unknown file system $fs
368            exit 1
369            ;;
370    esac
371}
372
373## mount-chroot-mount [file system|name]
374mount-chroot-mount(){
375    local fs=$1
376    local mnt_opts=""
377
378    case $fs in
379        /home)
380            mnt_opts="-o rbind"
381            ;;
382        *)
383            mnt_opts="--bind"
384            ;;
385    esac
386
387    case $fs in
388        /home|/tmp|/sys|/proc|/dev/shm|/dev/pts|/dev)
389            [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
390            [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
391                mount ${mnt_opts} ${fs} ${BUILD_ROOT}${fs}
392            return 0
393            ;;
394        vfs)
395            # for dir in /dev /dev/pts /dev/shm /proc /sys; do
396            #   mount-chroot-mount ${dir} || return 1
397            # done
398            mount-chroot-mount /proc || return 1
399            return 0
400            ;;
401        cache_dir)
402            [ -d ${CACHE_DIR} ] || mkdir -p ${CACHE_DIR}
403            [ -d ${ARCHIVES_DIR} ] || mkdir -p ${ARCHIVES_DIR}
404            [ -z "$(mount | grep ${ARCHIVES_DIR})" ] && \
405                mount ${mnt_opts} ${CACHE_DIR} ${ARCHIVES_DIR}
406            [ -d ${ARCHIVES_DIR}/partial ] || mkdir -p ${ARCHIVES_DIR}/partial
407            return 0
408            ;;
409        unionfs_dir)
410            if [ $with_unionfs -eq 1 ]; then
411                [ -d ${UNIONFS_DIR} ] || mkdir -p ${UNIONFS_DIR}
412                [ -z "$(mount | grep ${BUILD_ROOT})" ] && \
413                    mount -t unionfs -o dirs=${UNIONFS_DIR}=rw:${BUILD_ROOT}=ro unionfs ${BUILD_ROOT}
414                unionctl ${BUILD_ROOT} --list
415            fi
416            return 0
417            ;;
418        *)
419            echo mount-chroot-mount: unknown file system $fs
420            exit 1
421            ;;
422    esac
423   
424}
425
426
427##############################################################################
428
429Clean(){
430    setup-vbootstrap
431
432    # mount-chroot --umount /home
433    # mount-chroot --umount /tmp
434    mount-chroot --umount vfs
435    mount-chroot --umount cache_dir
436    mount-chroot --umount unionfs_dir
437    apt-get-update --host
438
439    if [ $with_unionfs -eq 1 ]; then
440        if [ -d ${UNIONFS_DIR} ]; then
441            echo -n "Cleaning build root \"${UNIONFS_DIR}\" via unionfs ... "
442            rm -rf ${UNIONFS_DIR}
443            echo "done."
444        fi
445    else
446        if [ -d ${BUILD_ROOT} ]; then
447            echo -n "Cleaning build root \"${BUILD_ROOT}\" ... "
448            rm -rf ${BUILD_ROOT}
449            echo "done."
450        fi
451    fi
452
453    echo "Cleanup a build farm for ${VERSION} done."
454}
455
456Retry_vbootstrap-post(){
457    local CHROOT_DIST_RELEASE=$(cat ${BUILD_ROOT}/etc/vine-release | cut -f3 -d" " | cut -f1 -d.)
458    local DIST_RELEASE=$(cat /etc/vine-release | cut -f3 -d" " | cut -f1 -d.)
459
460    if [ "${CHROOT_DIST_RELEASE}" != "${DIST_RELEASE}" ]; then
461        . /usr/share/vbootstrap/scripts/${VERSION}
462        $__chroot_sh "rm /var/lib/rpm/*"
463        $__chroot_sh "rpmdb --initdb"
464        $__chroot_sh "apt-get -qq update"
465        $__chroot_sh "apt-get -qq -y install ${BASE_PKGS}"
466    fi
467}
468
469Build(){
470    setup-vbootstrap
471
472    if [ $with_dist_upgrade -eq 1 ]; then
473        ## make bootstrap of ${STABLE_VERSION}
474        /usr/sbin/vbootstrap \
475            $(echo ${VERSION} | sed -e "s/VineSeed/${STABLE_VERSION}/") \
476            ${BUILD_ROOT}
477
478        ## aim apt-line to VineSeed
479        sed -i "s/apt ${STABLE_VERSION}/apt VineSeed/g" \
480            ${BUILD_ROOT}/etc/apt/sources.list.d/main.list
481    else
482        /usr/sbin/vbootstrap ${VERSION} ${BUILD_ROOT}
483    fi
484
485    ## retry vbootstrap post in Build()
486    Retry_vbootstrap-post
487
488    mount-chroot cache_dir
489    mount-chroot vfs
490    # mount-chroot /tmp
491    # mount-chroot /home
492
493    $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
494
495    ##!! 4.2 has no apt-sourceslist-{plus,nonfree} packages
496    if [ "${MAJOR_VERSION}" != "4.2" ]; then
497        $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-plus'
498        $__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-nonfree'
499    fi
500
501    if [ $with_dist_upgrade -eq 1 ]; then
502        $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
503    fi
504    $__chroot_sh 'apt-get -qq -y install build-essential'
505    $__chroot_sh 'apt-get -qq -y install self-build-setup'
506
507    $__chroot_sh 'apt-get -qq -y install etcskel shadow-utils'
508
509    $__chroot_sh 'cd /dev && /sbin/MAKEDEV console'
510    $__chroot_sh 'cd /dev && /sbin/MAKEDEV null'
511    $__chroot_sh 'cd /dev && /sbin/MAKEDEV zero'
512
513    $__chroot_sh '/usr/sbin/pwconv'
514    $__chroot_sh "/usr/sbin/useradd ${BUILD_USER}"
515
516    ##!! for rpm-4.8.0 or higher
517    ##!! (See http://trac.vinelinux.org/wiki/Vine6/AboutUpdateToolchain)
518    if [ "$(echo ${VERSION} | sed -e "s/\(VineSeed\).*/\1/")" = "VineSeed" ]; then
519        $__chroot_sh "sed -i -e 's/^%_topdir/#%_topdir/' /home/${BUILD_USER}/.rpmmacros"
520    fi
521
522    # mount-chroot --umount /home
523    # mount-chroot --umount /tmp
524    mount-chroot --umount vfs
525    mount-chroot --umount cache_dir
526    apt-get-update --host
527
528    echo "Making a build farm for ${VERSION} done."
529}
530
531RPM_Remove(){
532    setup-vbootstrap-rpm
533    mount-chroot unionfs_dir
534    mount-chroot cache_dir
535    mount-chroot vfs
536
537    if [ -f $RPM_PKG ]; then
538        Msg_NotPackageName_$LOCALE
539        exit 1
540    fi
541    $__chroot_sh "apt-get -y remove $BASE_RPM_PKG"
542
543    mount-chroot --umount vfs
544    mount-chroot --umount cache_dir
545    mount-chroot --umount unionfs_dir
546    apt-get-update --host
547}
548
549RPM_Install(){
550    setup-vbootstrap-rpm
551    mount-chroot unionfs_dir
552    mount-chroot cache_dir
553    mount-chroot vfs
554    apt-get-update --chroot
555
556    $__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $BASE_RPM_PKG"
557
558    mount-chroot --umount vfs
559    mount-chroot --umount cache_dir
560    mount-chroot --umount unionfs_dir
561    apt-get-update --host
562}
563
564RPM_Build(){
565    setup-vbootstrap-rpm
566    mount-chroot unionfs_dir
567    mount-chroot cache_dir
568    mount-chroot vfs
569
570    if [ ! -f $RPM_PKG ]; then
571        Msg_NotSourceRPM_$LOCALE
572        exit 1
573    fi
574   
575    RPM_PKG_USER=$(stat -c %U $RPM_PKG)
576    RPM_PKG_GROUP=$(stat -c %G $RPM_PKG)
577    local __install="install -p -v -o ${RPM_PKG_USER} -g ${RPM_PKG_GROUP}"
578    RPM_PKG_ARCH_LIST="RPMS/i386 RPMS/i686 RPMS/x86_64 RPMS/ppc RPMS/noarch SRPMS"
579    [ -z "${TARGET}" ] || \
580        RPM_PKG_ARCH_LIST="RPMS/${TARGET} ${RPM_PKG_ARCH_LIST}"
581
582    ## make src.rpm for $VERSION
583    $__chroot_sh "cd ${BUILD_DIR} && su ${BUILD_USER} -c 'rpm -ivh $BASE_RPM_PKG'"
584    $__chroot_sh "cd ${BUILD_DIR} && su ${BUILD_USER} -c 'rpmbuild -bs --nodeps --clean --rmsource --rmspec ${BUILD_DIR}/SPECS/*.spec'"
585
586
587    ## change ${DIST_RELEASE}
588    BASE_RPM_PKG=$(echo $BASE_RPM_PKG | sed -e "s/vl\([0-9]*\)\./vl${DIST_RELEASE}\./")
589
590    ## rebuild $BASE_RPM_PKG on ${DIST_RELEASE}
591    $__chroot_sh "cd ${BUILD_DIR}/SRPMS && apt-get -y build-dep $BASE_RPM_PKG"
592    $__chroot_sh "cd ${BUILD_DIR}/SRPMS && su ${BUILD_USER} -c 'rpmbuild --rebuild $RPM_OPTS $BASE_RPM_PKG'"
593    $__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')"
594
595    ## copy built rpms to ${HOME}/rpm/ for each archtectures
596    echo "Copying built rpms to ${HOME}/rpm/ for each archtectures ... "
597    for i in $RPM_PKG_ARCH_LIST; do \
598        if [ -d $BUILD_ROOT${BUILD_DIR}/${i} ]; then
599            [ -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i} ] || \
600                $__install -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i}/
601            find $BUILD_ROOT${BUILD_DIR}/${i} -type f -regex '.*\.rpm' \
602                -exec $__install -m0644 {} ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i}/ \;
603        fi
604    done
605
606    mount-chroot --umount vfs
607    mount-chroot --umount cache_dir
608    mount-chroot --umount unionfs_dir
609    apt-get-update --host
610
611    echo "done."
612}
613
614
615##############################################################################
616
617setup-vbuilder
618
619check-parameter $* || exit 1
620
621while [ $# -gt 0 ]; do
622    tmpARG=$1
623    case $tmpARG in
624        --version|--arch|--target|--build-rpm|--install-rpm|--remove-rpm)
625            shift
626            ;;
627        --dist-upgrade|--unionfs|--with-compat32|--build|--clean)
628            ;;
629        *)
630            echo unknown option $1
631            exit 1
632            ;;
633    esac
634
635    case $tmpARG in
636        --version)
637            VERSION=$1
638            ;;
639        --arch)
640            VARCH=$1
641            ;;
642        --dist-upgrade)
643            with_dist_upgrade=1
644            ;;
645        --unionfs)
646            with_unionfs=1
647            ;;
648        --target)
649            TARGET=$1
650            RPM_OPTS="${RPM_OPTS} --target $TARGET"
651            ;;
652        --with-compat32)
653            RPM_OPTS="${RPM_OPTS} --with compat32"
654            ;;
655        --build-rpm)
656            RPM_PKG=$1
657            RPM_Build || exit 1
658            ;;
659        --install-rpm)
660            RPM_PKG=$1
661            RPM_Install || exit 1
662            ;;
663        --remove-rpm)
664            RPM_PKG=$1
665            RPM_Remove || exit 1
666            ;;
667        --build)
668            Build
669            ;;
670        --clean)
671            Clean
672            ;;
673    esac
674    shift
675done
676
677exit
Note: See TracBrowser for help on using the repository browser.