- source tree reorganized, several file renames
authorJan Kupec <jkupec@suse.cz>
Tue, 24 Jun 2008 19:21:31 +0000 (19:21 +0000)
committerJan Kupec <jkupec@suse.cz>
Tue, 24 Jun 2008 19:21:31 +0000 (19:21 +0000)
commitf969596b7edfeb13efd63c78f437a4a3811f6edf
tree965ea579eb19c0ec620fdb204461e98386ae11b4
parentd0fae3feb3e3ad6eacd8fb5c34b806696c0ce997
- source tree reorganized, several file renames

-----

#!/bin/bash

RENAMES_LIST=../renames-list
rm $RENAMES_LIST
svn mv zypper.h Zypper.h
svn mv zypper.cc Zypper.cc
svn mv zypper-command.h Command.h
svn mv zypper-command.cc Command.cc
svn mv zypper-tabulator.h Table.h
svn mv zypper-tabulator.cc Table.cc
echo "zypper.h;Zypper.h" >> $RENAMES_LIST
echo "zypper.cc;Zypper.cc" >> $RENAMES_LIST
echo "zypper-command.h;Command.h" >> $RENAMES_LIST
echo "zypper-command.cc;Command.cc" >> $RENAMES_LIST
echo "zypper-tabulator.h;Table.h" >> $RENAMES_LIST
echo "zypper-tabulator.cc;Table.cc" >> $RENAMES_LIST

# move callback headers to separate folder and remove the -callbacks prefix
mkdir callbacks
svn add callbacks
for file in $(ls *-callbacks.h); do
  newfile=${file%-callbacks\.h};
  newfile="callbacks/${newfile:7}.h"
  echo "$file;$newfile" >> $RENAMES_LIST
  svn mv $file $newfile;
done

# remove 'zypper-' prefix from the sources
for file in $(ls zypper-*); do
  echo "$file;${file:7}" >> $RENAMES_LIST
  svn mv $file ${file:7};
done

# adapt include paths
sed -i -e 's/zypper\.h/Zypper.h/g' $(grep -Rl 'zypper\.h' *)
sed -i -e 's/zypper\.cc/Zypper.cc/g' $(grep -Rl 'zypper\.cc' *)
sed -i -e 's/zypper-command\.\(h\|cc\)/Command.\1/g' $(grep -Rl 'zypper-command\.\(h\|cc\)' *)
sed -i -e 's/zypper-tabulator\.\(h\|cc\)/Table.\1/g' $(grep -Rl 'zypper-tabulator\.\(h\|cc\)' *)
sed -i -e 's/zypper-\(\w*\)-callbacks\.h/callbacks\/\1.h/g' $(grep -Rl 'zypper-\w*-callbacks\.h' *)
sed -i -e 's/zypper-\(.*\.\(h\|cc\)\)/\1/g' $(grep -Rl 'zypper-.*\.\(h\|cc\)' *)
for file in $(find -name '*.h'); do
  file1=${file:2}
  regex=${file1/\.h/\\\.h}
  regex=${regex/\//\\\/};
  sed -i -e "s/\"$regex\"/\"..\\/$regex\"/g" callbacks/*
done

-----

zypper.h;Zypper.h
zypper.cc;Zypper.cc
zypper-command.h;Command.h
zypper-command.cc;Command.cc
zypper-tabulator.h;Table.h
zypper-tabulator.cc;Table.cc
zypper-keyring-callbacks.h;callbacks/keyring.h
zypper-locks-callbacks.h;callbacks/locks.h
zypper-media-callbacks.h;callbacks/media.h
zypper-repo-callbacks.h;callbacks/repo.h
zypper-rpm-callbacks.h;callbacks/rpm.h
zypper-getopt.cc;getopt.cc
zypper-getopt.h;getopt.h
zypper-info.cc;info.cc
zypper-info.h;info.h
zypper-locks.cc;locks.cc
zypper-locks.h;locks.h
zypper-main.cc;main.cc
zypper-main.h;main.h
zypper-misc.cc;misc.cc
zypper-misc.h;misc.h
zypper-prompt.cc;prompt.cc
zypper-prompt.h;prompt.h
zypper-repos.cc;repos.cc
zypper-repos.h;repos.h
zypper-richtext.cc;richtext.cc
zypper-richtext.h;richtext.h
zypper-search.cc;search.cc
zypper-search.h;search.h
zypper-utils.cc;utils.cc
zypper-utils.h;utils.h
27 files changed:
src/CMakeLists.txt
src/Command.cc [moved from src/zypper-command.cc with 99% similarity]
src/Command.h [moved from src/zypper-command.h with 100% similarity]
src/Table.cc [moved from src/zypper-tabulator.cc with 99% similarity]
src/Table.h [moved from src/zypper-tabulator.h with 100% similarity]
src/Zypper.cc [moved from src/zypper.cc with 99% similarity]
src/Zypper.h [moved from src/zypper.h with 98% similarity]
src/getopt.cc [moved from src/zypper-getopt.cc with 97% similarity]
src/getopt.h [moved from src/zypper-getopt.h with 100% similarity]
src/info.cc [moved from src/zypper-info.cc with 98% similarity]
src/info.h [moved from src/zypper-info.h with 96% similarity]
src/locks.cc [moved from src/zypper-locks.cc with 97% similarity]
src/locks.h [moved from src/zypper-locks.h with 92% similarity]
src/main.cc [moved from src/zypper-main.cc with 88% similarity]
src/main.h [moved from src/zypper-main.h with 100% similarity]
src/misc.cc [moved from src/zypper-misc.cc with 99% similarity]
src/misc.h [moved from src/zypper-misc.h with 97% similarity]
src/prompt.cc [moved from src/zypper-prompt.cc with 99% similarity]
src/prompt.h [moved from src/zypper-prompt.h with 98% similarity]
src/repos.cc [moved from src/zypper-repos.cc with 99% similarity]
src/repos.h [moved from src/zypper-repos.h with 99% similarity]
src/richtext.cc [moved from src/zypper-richtext.cc with 100% similarity]
src/richtext.h [moved from src/zypper-richtext.h with 100% similarity]
src/search.cc [moved from src/zypper-search.cc with 98% similarity]
src/search.h [moved from src/zypper-search.h with 98% similarity]
src/utils.cc [moved from src/zypper-utils.cc with 99% similarity]
src/utils.h [moved from src/zypper-utils.h with 100% similarity]