diff --git a/tools/update-checkouts b/tools/update-checkouts index b8cc814..835500b 100755 --- a/tools/update-checkouts +++ b/tools/update-checkouts @@ -1,182 +1,182 @@ #!/bin/bash # Script to build up the source directories needed by api.kde.org to be built # Requires getcomponentrepolist.py # Initial setup TOP=/srv/sources BINTOP=/home/api/bin #where getcomponentrepolist.py can be found # Functions #checkout_component: use kde-checkout-list to checkout the specified component and optional branch checkout_component() { cmd="$BINTOP/kde-checkout-list.pl --clone --prune --component=$1" if [ -z "$2" ]; then $cmd else $cmd --branch="$2" fi } # usage: checkout_repo [] checkout_repo() { repopath=$1 if [ -z "$2" ]; then - localpath = $repopath + localpath=$repopath else - localpath = $2 + localpath=$2 fi # get & update repos echo "Updating $repopath" - if [ ! -d $repopath ]; then + if [ ! -d $localpath ]; then git clone https://invent.kde.org/$repopath.git $localpath elif [ -d $localpath/.git ]; then pushd $localpath > /dev/null git reset --hard > /dev/null git clean -f -d -x > /dev/null git pull popd > /dev/null else echo "*** $localpath exists and is not a Git clone!" fi } # usage: checkout_repo checkout_component_repos() { component=$1 REPOPATHS=`$BINTOP/getcomponentrepolist.py $component` success=$? if [ $success -ne 0 ]; then echo "*** Getting list of repos for $component failed, skipping update!" return fi # get & update repos for repopath in $REPOPATHS; do checkout_repo $repopath done # prune no longer existing ones OLDREPOS=$component/*/.git for oldrepo in $OLDREPOS; do oldrepo=${oldrepo%"/.git"} if [[ ! $REPOPATHS =~ (^|[[:space:]])$oldrepo($|[[:space:]]) ]]; then echo "*** Pruning outdated repository $oldrepo" rm -rf $oldrepo fi done } if [ ! -x $BINTOP/kde-checkout-list.pl ]; then echo "Cannot locate the kde-checkout-list.pl program in $BINTOP. Exiting..." exit 1 fi # Lets go! # Switch to the top... mkdir -p $TOP # Update KApiDox-covered sources mkdir -p $TOP/kapidox-system cd $TOP/kapidox-system echo "* Updating KApiDox-covered sources" # going for all repos of components with lots of libraries instead of manual listing checkout_component_repos "frameworks" checkout_component_repos "libraries" checkout_component_repos "pim" checkout_repo "education/marble" checkout_repo "games/libkdegames" checkout_repo "graphics/libkdcraw" checkout_repo "graphics/libksane" checkout_repo "graphics/okular" checkout_repo "multimedia/libkcddb" checkout_repo "multimedia/libkcompactdisc" checkout_repo "plasma/kdecoration" checkout_repo "plasma/kwayland-server" # ANCHOR-AddToKApiDoxSystem # HERE add further repos or full components to cover # checkout_component_repos "component" # checkout_repo "component/repo" # Nothing else to do, the sources added here are auto-detected and inserted to page index # Update legacy-ApiDox-script-covered sources mkdir -p $TOP/kfour-appscomplete cd $TOP/kfour-appscomplete echo "* Updating legacy ApiDox script-covered sources" checkout_repo "office/calligra" "calligra" checkout_repo "kdevelop/kdevelop" "kdevelop" checkout_repo "graphics/krita" "krita" # ANCHOR-AddToLegacySystem # HERE add further repos to cover # checkout_repo "component/repo" "directory" # with directory a direct subdir # ATTENTION: any of these repos needs to have at least one Mainpage.dox file NOT in the toplevel source dir # but in a subdir, otherwise the legacy script fails to do its job as intended here # Next, edit website/api.kde.org/other.php, using the "directory" name there as well, see instructions there # Put in place the quality checkout symlink # We already have a clone of this in $HOME (per update-scripts) so just reuse that one.... ( cd $TOP; rm -f quality; ln -sf $HOME/quality-kde-org quality ) # Update the website rsync -av --del $TOP/websites/quality-kde-org/website/api.kde.org/ /srv/www/api.kde.org/ \ --exclude doc \ --exclude 11-api \ --exclude 11-api \ --exclude 2.0-api \ --exclude 2.1-api \ --exclude 2.2-api \ --exclude 3.0-api \ --exclude 3.1-api \ --exclude 3.5-api \ --exclude 4.0-api \ --exclude 4.10-api \ --exclude 4.11-api \ --exclude 4.12-api \ --exclude 4.13-api \ --exclude 4.14-api \ --exclude 4.1-api \ --exclude 4.2-api \ --exclude 4.3-api \ --exclude 4.4-api \ --exclude 4.5-api \ --exclude 4.6-api \ --exclude 4.7-api \ --exclude 4.8-api \ --exclude 4.9-api \ --exclude 4.x-api \ --exclude apidocs \ --exclude appscomplete-api \ --exclude bundled-apps-api \ --exclude cmake \ --exclude common \ --exclude data \ --exclude dependency-information.tar \ --exclude ecm \ --exclude extragear-api \ --exclude frameworks-api \ --exclude kdereview-api \ --exclude kdesupport-api \ --exclude man \ --exclude playground-api \ --exclude pykde-4.1-api \ --exclude pykde-4.2-api \ --exclude pykde-4.3-api \ --exclude pykde-4.4-api \ --exclude pykde-4.5-api \ --exclude pykde-4.7-api \ --exclude qch \ --exclude qyoto-4.0.5-api \ --exclude qyoto-4.0.6-api \ --exclude qyoto-api \ --exclude robots.txt \ --exclude search \ --exclude searchmaps \ --exclude stable \ --exclude unstable