summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-01-06 21:53:02 +0100
committerHolger Levsen <holger@layer-acht.org>2015-01-06 21:53:02 +0100
commit768640ee4d2f9a0127c8299bb2004e2253924737 (patch)
treeab567af840bc2726ba01c724220ca38e32fe6a59 /bin
parentc86ef6103b30313110c542f30e54b07cbcf91f90 (diff)
downloadjenkins.debian.net-768640ee4d2f9a0127c8299bb2004e2253924737.tar.xz
reproducible: only update meta pkg sets if they are older than a day
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_create_meta_pkg_sets.sh93
1 files changed, 55 insertions, 38 deletions
diff --git a/bin/reproducible_create_meta_pkg_sets.sh b/bin/reproducible_create_meta_pkg_sets.sh
index 52118448..febe9c09 100755
--- a/bin/reproducible_create_meta_pkg_sets.sh
+++ b/bin/reproducible_create_meta_pkg_sets.sh
@@ -59,60 +59,77 @@ update_if_similar() {
#
# the essential package set
-grep-dctrl -sPackage -n -X -FEssential yes $PACKAGES > $TMPFILE
-convert_into_source_packages_only
-update_if_similar ${META_PKGSET[1]}.pkgset
+if [ -z $(find $TPATH -maxdepth 1 -mtime +0 -name ${META_PKGSET[1]}.pkgset) ] ; then
+ grep-dctrl -sPackage -n -X -FEssential yes $PACKAGES > $TMPFILE
+ convert_into_source_packages_only
+ update_if_similar ${META_PKGSET[1]}.pkgset
+fi
# the required package set
-grep-dctrl -sPackage -n -X -FPriority required $PACKAGES > $TMPFILE
-convert_into_source_packages_only
-update_if_similar ${META_PKGSET[2]}.pkgset
+if [ -z $(find $TPATH -maxdepth 1 -mtime +0 -name ${META_PKGSET[2]}.pkgset) ] ; then
+ grep-dctrl -sPackage -n -X -FPriority required $PACKAGES > $TMPFILE
+ convert_into_source_packages_only
+ update_if_similar ${META_PKGSET[2]}.pkgset
+fi
# build-essential
-grep-dctrl -FBuild-Essential -sPackage -n yes $PACKAGES > $TMPFILE
-schroot --directory /tmp -c source:jenkins-clean-sid -- apt-get -s install build-essential | grep "^Inst "|cut -d " " -f2 >> $TMPFILE
-convert_into_source_packages_only
-update_if_similar ${META_PKGSET[3]}.pkgset
+if [ -z $(find $TPATH -maxdepth 1 -mtime +0 -name ${META_PKGSET[3]}.pkgset) ] ; then
+ grep-dctrl -FBuild-Essential -sPackage -n yes $PACKAGES > $TMPFILE
+ schroot --directory /tmp -c source:jenkins-clean-sid -- apt-get -s install build-essential | grep "^Inst "|cut -d " " -f2 >> $TMPFILE
+ convert_into_source_packages_only
+ update_if_similar ${META_PKGSET[3]}.pkgset
+fi
# gnome and everything it depends on
-schroot --directory /tmp -c source:jenkins-clean-sid -- apt-get -s install gnome | grep "^Inst "|cut -d " " -f2 > $TMPFILE
-convert_into_source_packages_only
-update_if_similar ${META_PKGSET[4]}.pkgset
+if [ -z $(find $TPATH -maxdepth 1 -mtime +0 -name ${META_PKGSET[4]}.pkgset) ] ; then
+ schroot --directory /tmp -c source:jenkins-clean-sid -- apt-get -s install gnome | grep "^Inst "|cut -d " " -f2 > $TMPFILE
+ convert_into_source_packages_only
+ update_if_similar ${META_PKGSET[4]}.pkgset
+fi
# all build depends of gnome
-for PKG in $(cat $TPATH/${META_PKGSET[4]}.pkgset) ; do
- grep-dctrl -sBuild-Depends -n -X -FPackage $PKG /schroots/sid/var/lib/apt/lists/*Sources | sed "s#([^)]*)##g; s#,##g" >> $TMPFILE
-done
-convert_into_source_packages_only
-update_if_similar ${META_PKGSET[5]}.pkgset
+if [ -z $(find $TPATH -maxdepth 1 -mtime +0 -name ${META_PKGSET[5]}.pkgset) ] ; then
+ for PKG in $(cat $TPATH/${META_PKGSET[4]}.pkgset) ; do
+ grep-dctrl -sBuild-Depends -n -X -FPackage $PKG /schroots/sid/var/lib/apt/lists/*Sources | sed "s#([^)]*)##g; s#,##g" >> $TMPFILE
+ done
+ convert_into_source_packages_only
+ update_if_similar ${META_PKGSET[5]}.pkgset
+fi
# tails
-curl http://nightly.tails.boum.org/build_Tails_ISO_feature-jessie/latest.iso.binpkgs > $TMPFILE
-curl http://nightly.tails.boum.org/build_Tails_ISO_feature-jessie/latest.iso.srcpkgs >> $TMPFILE
-convert_into_source_packages_only
-update_if_similar ${META_PKGSET[6]}.pkgset
+if [ -z $(find $TPATH -maxdepth 1 -mtime +0 -name ${META_PKGSET[6]}.pkgset) ] ; then
+ curl http://nightly.tails.boum.org/build_Tails_ISO_feature-jessie/latest.iso.binpkgs > $TMPFILE
+ curl http://nightly.tails.boum.org/build_Tails_ISO_feature-jessie/latest.iso.srcpkgs >> $TMPFILE
+ convert_into_source_packages_only
+ update_if_similar ${META_PKGSET[6]}.pkgset
+fi
# all build depends of tails
-for PKG in $(cat $TPATH/${META_PKGSET[6]}.pkgset) ; do
- grep-dctrl -sBuild-Depends -n -X -FPackage $PKG /schroots/sid/var/lib/apt/lists/*Sources | sed "s#([^)]*)##g; s#,##g" >> $TMPFILE
-done
-convert_into_source_packages_only
-update_if_similar ${META_PKGSET[7]}.pkgset
+if [ -z $(find $TPATH -maxdepth 1 -mtime +0 -name ${META_PKGSET[7]}.pkgset) ] ; then
+ for PKG in $(cat $TPATH/${META_PKGSET[6]}.pkgset) ; do
+ grep-dctrl -sBuild-Depends -n -X -FPackage $PKG /schroots/sid/var/lib/apt/lists/*Sources | sed "s#([^)]*)##g; s#,##g" >> $TMPFILE
+ done
+ convert_into_source_packages_only
+ update_if_similar ${META_PKGSET[7]}.pkgset
+fi
# pkg-perl-maintainers
-grep-dctrl -sPackage -n -FMaintainer pkg-perl-maintainers@lists.alioth.debian.org $SOURCES > $TMPFILE
-convert_into_source_packages_only
-update_if_similar ${META_PKGSET[8]}.pkgset
+if [ -z $(find $TPATH -maxdepth 1 -mtime +0 -name ${META_PKGSET[8]}.pkgset) ] ; then
+ grep-dctrl -sPackage -n -FMaintainer pkg-perl-maintainers@lists.alioth.debian.org $SOURCES > $TMPFILE
+ convert_into_source_packages_only
+ update_if_similar ${META_PKGSET[8]}.pkgset
+fi
# popcon top 1337 installed sources
-SQL_QUERY="SELECT popcon_src.source FROM popcon_src ORDER BY popcon_src.insts DESC LIMIT 1337;"
-PGPASSWORD=public-udd-mirror \
- psql -U public-udd-mirror \
- -h public-udd-mirror.xvm.mit.edu -p 5432 \
- -t \
- udd -c"${SQL_QUERY}" > $TMPFILE
-update_if_similar ${META_PKGSET[9]}.pkgset
-
+if [ -z $(find $TPATH -maxdepth 1 -mtime +0 -name ${META_PKGSET[9]}.pkgset) ] ; then
+ SQL_QUERY="SELECT popcon_src.source FROM popcon_src ORDER BY popcon_src.insts DESC LIMIT 1337;"
+ PGPASSWORD=public-udd-mirror \
+ psql -U public-udd-mirror \
+ -h public-udd-mirror.xvm.mit.edu -p 5432 \
+ -t \
+ udd -c"${SQL_QUERY}" > $TMPFILE
+ update_if_similar ${META_PKGSET[9]}.pkgset
+fi
# finally
echo "All meta package sets created successfully."