[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-extra-gear
Subject:    [Kde-extra-gear] [PATCH] cvsExtract.sh
From:       Jeroen Wijnhout <Jeroen.Wijnhout () kdemail ! net>
Date:       2004-02-09 18:52:10
Message-ID: 200402091952.11086.Jeroen.Wijnhout () kdemail ! net
[Download RAW message or body]

Hi all,

Here is a modified patch for cvsExtract.sh. It adds the possibility of 
splitting the package into an app and an i18n part ( --split, 
--noi18nbasetag ), creating the tarball ( --package ).

It also prevents cvs from checking out empty directories.

Ok to commit?

best,
Jeroen

-- 
Kile - an Integrated LaTeX Environment for KDE
http://kile.sourceforge.net

["cvsExtract.sh.diff" (text/x-diff)]

Index: cvsExtract.sh
===================================================================
RCS file: /home/kde/kdeextragear-1/scripts/cvsExtract.sh,v
retrieving revision 1.21
diff -u -p -r1.21 cvsExtract.sh
--- cvsExtract.sh	21 Jan 2004 15:55:35 -0000	1.21
+++ cvsExtract.sh	9 Feb 2004 18:37:45 -0000
@@ -37,14 +37,17 @@ LANGUAGES=""
 KDECOMMON=kde-common
 GETDOC="yes"
 GETI18N="yes"
+SPLIT="no"
 PLAINCONFIGURE="no"
+PACKAGE="no"
 
 # CVS settings
 RETRIEVAL_METHOD=LOCAL
 [ -z "$CVSROOT" ] && export CVSROOT=":pserver:anonymous@anoncvs.kde.org:/home/kde"
 CVSBASEDIR="`pwd`"
 USETAGFORADMIN="yes"
-CVS_CHECKOUT_OPTIONS=""
+USETAGFORI18NBASE="yes"
+CVS_CHECKOUT_OPTIONS="-P"
 
 #export CVSROOT=":pserver:kalass@cvs.kde.org:2401/home/kde"
 
@@ -101,6 +104,7 @@ Following Options are optional
                                environment variable. Implies \"-r CVS\".
     --nodoc                    Do not try to get any documentation.
     --noi18n                   Do not search for any translations.
+    --split                     Make separate packages for the application and \
                translations. 
     --listtags                 List tags and branches that are available for 
                                this app. Only for '-r CVS'.
     --usetag <TAG/BRANCH>      Use the specified tag or branch. 
@@ -108,8 +112,11 @@ Following Options are optional
     --noadmintag               This makes only sense in combination with --usetag.
                                The tag will only be used for the application files
                                and not for the admin and the module data.
+    --noi18nbasetag            This makes only sense in combination with --usetag. \
The tag be used for +                               the .po files in the i18n \
                directories only.
    --plainconfigure            Use the configure.in.in from the application without 
                                any changes like merging in the modules \
configure.in.in. +    --package                  Create tarballs (.tar.gz and \
                .tar.bz2)
     -h|--help                  This Help"
 }
 
@@ -173,9 +180,15 @@ do
     --noi18n)
         GETI18N="no"
       ;;
+    --split)
+        SPLIT="yes"
+       ;;
     --noadmintag)
-        USETAGFORADMIN=="no"
-      ;;
+        USETAGFORADMIN="no"
+       ;;
+    --noi18nbasetag)
+        USETAGFORI18NBASE="no"
+       ;;
     --plainconfigure)
         PLAINCONFIGURE="yes"
       ;;
@@ -187,9 +200,12 @@ do
       ;;
     --usetag)
 	testparm $1 $2
-        CVS_CHECKOUT_OPTIONS=" -r $2 "
+        CVS_CHECKOUT_OPTIONS=" -P -r $2 "
 	shift
       ;;
+    --package)
+	PACKAGE="yes"
+      ;;
     -h|--help)
 	showHelp
 	exit 0
@@ -245,6 +261,8 @@ fi
 APPDIR="${APPNAME}-${APPVERSION}"
 [ -z "$TARGETDIR" ] && TARGETDIR="${APPDIR}-BUILD"
 
+I18NDIR="${APPNAME}-i18n-${APPVERSION}"
+
 
 #----------------------------------------------------------#
 #                      FUNCTIONS                           #
@@ -308,6 +326,11 @@ function getAdminDir {
 	    cp -a  ${CVSBASEDIR}/${KDECOMMON}/admin "$2"
 	;;
     esac
+    
+    if [ ${SPLIT} == "yes" ]
+    then
+    	cp -R "$2" ../$I18NDIR
+    fi
 }
 
 #
@@ -319,23 +342,25 @@ function getAdminDir {
 function getDocumentation {
     echo -e "Putting docs to $2."
 
+    pushd $PWD
     [ -d "$2" ] || mkdir $2
     (
 	cd "$2"
 
 	# get english doc
 	case $1 in
-	    CVS)
-		cvs co ${CVS_CHECKOUT_OPTIONS} -d ${APPNAME} ${MODULENAME}/doc/${APPNAME} \
                2>/dev/null && gotDocs="yes"
-	    ;;
-	    LOCAL)
-		cp -a ${CVSBASEDIR}/${MODULENAME}/doc/${APPNAME} ${APPNAME} 2>/dev/null && \
                gotDocs="yes"
-	    ;;
+		CVS)
+			cvs co ${CVS_CHECKOUT_OPTIONS} -d ${APPNAME} ${MODULENAME}/doc/${APPNAME} \
2>/dev/null && gotDocs="yes" +		;;
+		LOCAL)
+			cp -a ${CVSBASEDIR}/${MODULENAME}/doc/${APPNAME} ${APPNAME} 2>/dev/null && \
gotDocs="yes" +		;;
 	esac
 
 	# get international docs
 	if [ "$gotDocs" == "yes" ]  ; then
-	    for lang in $LANGUAGES ; do 
+		if [ ${SPLIT} == "yes" ]; then cd "../../$I18NDIR/$2";fi
+		for lang in $LANGUAGES ; do 
 		(
 		    mkdir ${lang}
 		    cd ${lang}
@@ -355,9 +380,11 @@ function getDocumentation {
 		)
 	    done
 	else
-	     echo -e "No Documentation for Application $APPNAME"
+		echo -e "No Documentation for Application $APPNAME"
 	fi
-    )
+	)
+    
+	popd
 }
 
 #
@@ -378,9 +405,13 @@ function getTranslation {
     # get all names of pot files that are used in this app
     translationFiles=`find -name Makefile.am -exec cat \{\} \; | grep "\.po"|sed \
"s/.*\/\([^\/]*\.po\)t.*/\1/g"`  # get the translations
-    [ -d "$2" ] || mkdir "$2"
+    destination="$2"
+    if [ ${SPLIT} == "yes" ]; then destination="../$I18NDIR/$2"; fi
+    
+    [ -d "$destination" ] || mkdir "$destination"
     ( 
-	cd "$2"
+	cd "$destination"
+
 	echo -e "Retrieving Translations: "
         echo -e "files: $translationFiles"
 	for lang in $LANGUAGES ; do 
@@ -462,7 +493,7 @@ function getAvailableLanguages {
     echo "Retrieving complete list of available languages..." >&2
     case $1 in
 	CVS)
-	    cvs -z4 -q -d "$CVSROOT" co ${CVS_CHECKOUT_OPTIONS} -d all_languages \
kde-i18n/subdirs > /dev/null 2>&1 +	    cvs -z4 -q -d "$CVSROOT" co \
${CVS_CHECKOUT_OPTIONS_I18N_BASE} -d all_languages kde-i18n/subdirs > /dev/null 2>&1  \
;;  LOCAL)
             mkdir all_languages
@@ -499,11 +530,29 @@ test -d "$TARGETDIR"  && (echo "WARNING:
 test -d "$TARGETDIR"  || mkdirhier "$TARGETDIR"
 cd "$TARGETDIR"
 
+if [ ${SPLIT} == "yes" ]; then
+	mkdir $I18NDIR
+	if [ ${GETI18N} == "yes" ]; then 
+		mkdir $I18NDIR/po; 
+		echo created $I18NDIR/po
+	fi
+	if [ ${GETDOC} == "yes" ]; then mkdir $I18NDIR/doc; fi
+fi
+
 if [ "$LISTTAGS" = "yes" ] ; then 
     listtags 
     exit
 fi
 
+if [ "$USETAGFORADMIN" = "yes" ]; then
+    CVS_CHECKOUT_OPTIONS_ADMIN="${CVS_CHECKOUT_OPTIONS}"
+fi
+
+if [ "$USETAGFORI18NBASE" = "yes" ]; then
+	CVS_CHECKOUT_OPTIONS_I18N_BASE="${CVS_CHECKOUT_OPTIONS}"
+	echo $CVS_CHECKOUT_OPTIONS_I18N_BASE
+fi
+
 # get the full path
 BUILDDIR="`pwd`"
 
@@ -517,10 +566,6 @@ if [ -d "${APPDIR}/src" ] || [ -d "${APP
     flatDirStructure="no"
 fi
 
-if [ $USETAGFORADMIN = "yes" ]; then
-    CVS_CHECKOUT_OPTIONS_ADMIN="${CVS_CHECKOUT_OPTIONS}"
-fi
-
 getToplevelFiles "${RETRIEVAL_METHOD}" "${MODULENAME}"
 
 # if the directory structure is flat, move the appdir to a subdir
@@ -536,13 +581,24 @@ if [ "$flatDirStructure" == "yes" ] ;the
     for i in AUTHORS COPYING ChangeLog INSTALL TODO README; do
 	rm -f "${APPDIR}/$i"
 	if [ -f "${APPDIR}/${APPNAME}/$i" ] ; then
-	    mv "${APPDIR}/${APPNAME}/$i" "${APPDIR}"
+		mv "${APPDIR}/${APPNAME}/$i" "${APPDIR}"
 	fi
     done
 else
     mergeToplevelFiles "${MODULENAME}" "${APPDIR}"
 fi
 
+if [ ${SPLIT} == "yes" ]
+then
+	for i in AUTHORS COPYING ChangeLog INSTALL TODO README NEWS; do
+		if [ -f "${APPDIR}/$i" ]; then
+			cp ${APPDIR}/$i $I18NDIR
+		else
+			touch $I18NDIR/$i
+		fi
+	done
+fi
+
 # warn if some files are missing
 for i in AUTHORS COPYING ChangeLog INSTALL TODO README; do
     if [ ! -f "${APPDIR}/$i" ] ; then
@@ -577,24 +633,35 @@ cd ${APPDIR}
 
 # create Makefile.am for doc and all Languages
 if [ $GETDOC = "yes" ]; then
+    pushd $PWD
     cd doc 
     DOC_SUBDIRS=`listsubdirs`
     if [ -n "`echo $DOC_SUBDIRS|sed 's/ //g'`" ]; then
-	echo "SUBDIRS = $DOC_SUBDIRS" >> Makefile.am 
+	echo "SUBDIRS = $DOC_SUBDIRS" >> Makefile.am
+	if [ ${SPLIT} == "yes" ]; then
+		pushd $PWD
+		cd ../../$I18NDIR/doc
+		DOC_SUBDIRS=`listsubdirs`
+		echo "SUBDIRS = $DOC_SUBDIRS" >> Makefile.am
+	fi
 	for lang in $LANGUAGES ; do 
 	    ( test -d $lang && cd $lang && echo "SUBDIRS = `listsubdirs`" > Makefile.am )
 	done
-	cd ..
+	if [ ${SPLIT} == "yes" ]; then popd; fi
+	popd
     else 
-	cd ..
+	popd
 	rmdir doc 2> /dev/null
     fi
 fi
-    
+
 # create Makefile.am for po
 if [ $GETI18N = "yes" ]; then
-    cd po 
+    pushd $PWD
+    if [ ${SPLIT} == "yes" ]; then cd ../$I18NDIR/po; else cd po; fi
+
     PO_SUBDIRS=`listsubdirs`
+    echo "PO_SUBDIRS: $PO_SUBDIRS"
     if [ -n "`echo $PO_SUBDIRS|tr -d '\n'`" ] ;then
 	echo "SUBDIRS = $PO_SUBDIRS" > Makefile.am 
 	for lang in $LANGUAGES ; do 
@@ -608,15 +675,55 @@ POFILES = AUTO" > Makefile.am 
 	done
 	cd ..
     else
+    	echo "REMOVING PO DIR"
 	cd ..
 	rm -rf po
     fi
+    popd
+fi
+
+#also get the toplevel files (Makefile.cvs and configure.in.in) for the translations
+if [ ${SPLIT} == "yes" ];
+then
+ 	if [ ${GETI18N} == "yes" ]; then subdirs=po; fi
+ 	if [ ${GETDOC} == "yes" ]; then subdirs="doc $subdirs"; fi
+ 	echo "SUBDIRS=$subdirs" > ../$I18NDIR/Makefile.am
+	cp Makefile.cvs configure.in.in ../$I18NDIR
 fi
 
 # 
 echo -e "Building configure script\n"
 make -f Makefile.cvs
-
+#./configure
+#make distclean
 
 # remove autoconfig temp dir, there is no need to package it
 rm -rf autom4te.cache 2>/dev/null
+
+if [ ${PACKAGE} == "yes" ]
+then
+	echo "Packaging..."
+	pushd .
+	cd ..
+	tar zcf $APPDIR.tar.gz $APPDIR
+	tar jcf $APPDIR.tar.bz2 $APPDIR
+	popd
+fi
+
+if [ ${SPLIT} == "yes" ]
+then
+	echo -e "Building i18n configure script\n"
+	cd ../$I18NDIR
+	make -f Makefile.cvs
+	#./configure
+	#make distclean
+	rm -rf autom4te.cache 2>/dev/null
+
+	if [ ${PACKAGE} == "yes" ]
+	then
+		echo "Packaging i18n..."
+		cd ..
+		tar zcf $I18NDIR.tar.gz $I18NDIR
+		tar jcf $I18NDIR.tar.bz2 $I18NDIR
+	fi
+fi



_______________________________________________
Kde-extra-gear mailing list
Kde-extra-gear@kde.org
https://mail.kde.org/mailman/listinfo/kde-extra-gear


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic