SVN: people/hawk/ftp_admin/pld-titanium-mvpkg.sh

hawk hawk at pld-linux.org
Sun May 11 15:17:13 CEST 2008


Author: hawk
Date: Sun May 11 15:17:13 2008
New Revision: 9747

Added:
   people/hawk/ftp_admin/pld-titanium-mvpkg.sh   (contents, props changed)
Log:
- simple script to run before rsyncing PLD Titanium mirror,
  it will detect package movements on master ftp and move
  local files so rsync will not be transfering them again


Added: people/hawk/ftp_admin/pld-titanium-mvpkg.sh
==============================================================================
--- (empty file)
+++ people/hawk/ftp_admin/pld-titanium-mvpkg.sh	Sun May 11 15:17:13 2008
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+mirror_dir="/home/pld/mirror"
+
+check_trees()
+{
+tree_arch="$1"
+src_tree="$2"
+dst_tree="$3"
+echo -e "\nChecking PLD Titanium $tree_arch, $src_tree -> $dst_tree\n"
+
+rsync_log="/tmp/$(basename $0).rsync.log"
+files_log="/tmp/$(basename $0).files.log"
+
+rsync -vrltn --delete rsync.pld-linux.org::pld/branches/titanium/$dst_tree/$tree_arch/ \
+ $mirror_dir/branches/titanium/$dest_tree/$tree_arch > $rsync_log
+
+grep ".rpm" $rsync_log | grep -v "deleting" |grep -v "packages.dir" \
+  | grep -v "packages.i/" | grep -v "repodata/" | sed -e 's/.*RPMS\///g' > $files_log
+
+for pkg in $(cat $files_log); do
+  src_pkg="$mirror_dir/branches/titanium/$src_tree/$tree_arch/RPMS/$pkg"
+  dst_pkg="$mirror_dir/branches/titanium/$dst_tree/$tree_arch/RPMS/$pkg"
+  if [ -f $src_pkg ]; then
+    if [ ! -f $dst_pkg ]; then
+      echo -e "$src_tree -> $dst_tree\t$pkg"
+      mv $src_pkg $dst_pkg
+    fi
+  fi
+done
+
+rm -f $rsync_log $files_log
+}
+
+check_trees i686 test ready
+check_trees noarch test ready
+check_trees i686 ready PLD
+check_trees noarch ready PLD
+check_trees i686 test PLD
+check_trees noarch test PLD


More information about the pld-cvs-commit mailing list