summaryrefslogtreecommitdiff
path: root/buildscripts/consolidate-repos.sh
diff options
context:
space:
mode:
authorErnie Hershey <ernie.hershey@10gen.com>2013-12-20 16:29:41 -0500
committerErnie Hershey <ernie.hershey@10gen.com>2013-12-20 16:29:41 -0500
commita272fcfb0382f2bc2050a194a653b26c30c1dee6 (patch)
tree844a94f5421ee5aaa5e51ea7f739760c1826173b /buildscripts/consolidate-repos.sh
parent5d29b14ecf01637f2a0a2e27e02abb7f645d6881 (diff)
downloadmongo-a272fcfb0382f2bc2050a194a653b26c30c1dee6.tar.gz
SERVER-9246 Clean up community repo generation script to match enterprise version
Diffstat (limited to 'buildscripts/consolidate-repos.sh')
-rwxr-xr-xbuildscripts/consolidate-repos.sh46
1 files changed, 19 insertions, 27 deletions
diff --git a/buildscripts/consolidate-repos.sh b/buildscripts/consolidate-repos.sh
index 77a75ccdb10..71aa1d4e9f9 100755
--- a/buildscripts/consolidate-repos.sh
+++ b/buildscripts/consolidate-repos.sh
@@ -15,36 +15,32 @@ gpg_recip='<richard@10gen.com>'
echo "Using directory: $repodir"
-tempfile=`mktemp /tmp/consolidate-repos.XXXXXX`
-
mkdir -p "$repodir"
-find "$source_dir/" -name \*.rpm -o -name \*.deb -o -name Release | grep -v "$repodir" | grep -v enterprise > "$tempfile"
-
echo "Scanning and copying package files from $source_dir"
echo ". = skipping existing file, @ = copying file"
-while read package
+for package in $(find "$source_dir/" -not \( -path "$repodir" -prune \) -not -path \*enterprise\* -and \( -name \*.rpm -o -name \*.deb -o -name Release \))
do
- new_package_location="$repodir`echo \"$package\" | sed 's/\/var\/www\/[^\/]*//;'`"
+ new_package_location="$repodir$(echo "$package" | sed 's/\/var\/www\/[^\/]*//;')"
# skip if the directory structure looks weird
#
- if [ "`echo \"$new_package_location\" | grep /repo/`" ]
+ if echo "$new_package_location" | grep -q /repo/
then
continue
fi
# skip if it's already there
#
- if [ -e "$new_package_location" -a "`basename \"$package\"`" != "Release" ]
+ if [ -e "$new_package_location" -a "$(basename "$package")" != "Release" ]
then
echo -n .
else
- mkdir -p "`dirname \"$new_package_location\"`"
+ mkdir -p "$(dirname "$new_package_location")"
echo -n @
cp "$package" "$new_package_location"
fi
-done < "$tempfile"
+done
echo
# packages are in place, now create metadata
@@ -59,21 +55,19 @@ do
gzip -9c "$arch_dir"/Packages > "$arch_dir"/Packages.gz
done
- for release_dir in "$debian_dir"/dists/dist
- do
- echo "Generating Release file under $release_dir"
- cd $release_dir
- tempfile=`mktemp /tmp/ReleaseXXXXXX`
- tempfile2=`mktemp /tmp/ReleaseXXXXXX`
- mv Release $tempfile
- head -9 $tempfile > $tempfile2
- apt-ftparchive release . >> $tempfile2
- cp $tempfile2 Release
- chmod 644 Release
- rm Release.gpg
- echo "Signing Release file"
- gpg -r "$gpg_recip" --no-secmem-warning -abs --output Release.gpg Release
- done
+ release_dir="$debian_dir"/dists/dist
+ echo "Generating Release file under $release_dir"
+ cd $release_dir
+ tempfile=$(mktemp /tmp/ReleaseXXXXXX)
+ tempfile2=$(mktemp /tmp/ReleaseXXXXXX)
+ mv Release $tempfile
+ head -9 $tempfile > $tempfile2
+ apt-ftparchive release . >> $tempfile2
+ cp $tempfile2 Release
+ chmod 644 Release
+ rm Release.gpg
+ echo "Signing Release file"
+ gpg -r "$gpg_recip" --no-secmem-warning -abs --output Release.gpg Release
done
for redhat_dir in "$repodir"/redhat/os/*
@@ -82,5 +76,3 @@ do
cd "$redhat_dir"
createrepo .
done
-
-