Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1 from saukko/master
ssu-repos.sh
  • Loading branch information
bwachter committed Nov 27, 2012
2 parents 6e95fa5 + 125078e commit 897e92d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ssu.pro
Expand Up @@ -10,7 +10,7 @@ ssuconfhack {
SUBDIRS += ssuconfperm
}

SUBDIRS += tests
SUBDIRS += tests tools

rndssucli.depends = libssu
rndregisterui.depends = libssu
Expand Down
24 changes: 24 additions & 0 deletions tools/ssu-repos.sh
@@ -0,0 +1,24 @@
#!/bin/sh

function repo_clean {
REPO_DIR=/etc/zypp/repos.d/
TMP_DIR=${REPO_DIR}/old/

mkdir -p ${TMP_DIR}

for REPO_FILE in `ls -1 ${REPO_DIR}/*.repo`; do
rpm -qf ${REPO_FILE} &> /dev/null
if [ $? -eq 1 ]; then
echo "Moving ${REPO_FILE} to ${TMP_DIR}."
mv ${REPO_FILE} ${TMP_DIR}
fi
done
}

if [ $# -ne 1 -o "$1" != "clean" ]; then
echo "Usage: $0 clean"
exit 1
fi

repo_clean

7 changes: 7 additions & 0 deletions tools/tools.pro
@@ -0,0 +1,7 @@
TEMPLATE = subdirs

tools.files = ssu-repos.sh
tools.path = /usr/sbin/

INSTALLS += tools

0 comments on commit 897e92d

Please sign in to comment.