From: Adam Dickmeiss Date: Tue, 18 Jun 2013 11:48:18 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/git-tools X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=5d4889b75c45700d71cc2acf215aac068c77bd04;hp=a7424f016275425f9a4fc82b7aac2e77daf13a1a;p=git-tools-moved-to-github.git Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/git-tools --- diff --git a/aptcheck/aptcheck.pl b/aptcheck/aptcheck.pl index 3d70053..36646bb 100755 --- a/aptcheck/aptcheck.pl +++ b/aptcheck/aptcheck.pl @@ -27,9 +27,6 @@ # and architectures at the same time. Gets only the highest version from # all, and reports anything less than this. Good enough for now. # -# TODO: Get the dates from ls --full-time /var/cache/apt/archives/ -# and display next to the packages, so we can see how long they have -# been lingering. Boldface them if older than some limit #### Init use strict; @@ -129,6 +126,8 @@ my %newdates; # To be written in the new version of the file my $datefilename = "aptcheck.data"; my $dateoldfilename = "aptcheck.old"; my $thisdate = "*"; # indicates really old stuff +my $warndate; # Older than this will be boldfaced + if ( -f $datefilename ) { print "Reading dates from $datefilename\n" if $debug; open F, $datefilename or die "Could not open date file $datefilename: $!"; @@ -142,6 +141,9 @@ if ( -f $datefilename ) { close F; $thisdate = `date +%F`; chomp($thisdate); + $warndate = `date +%F -d "30 days ago"` ; ; + chomp($warndate); + print "Dates: now: '$thisdate' warn: '$warndate'\n" if $debug; } else { print "No datefile $datefilename found, starting from scratch\n"; } @@ -149,7 +151,8 @@ if ( -f $datefilename ) { my $table = "\n"; -for my $hline ( split("\n",$hostlist) ) { +#for my $hline ( split("\n",$hostlist) ) { +for my $hline ( sort( split("\n",$hostlist) ) ) { next unless ( $hline =~ /\/([a-z0-9-]+)\.cfg$/ ); my $H = $1; next if ($H =~ /^commands/ ); @@ -217,7 +220,12 @@ for my $hline ( split("\n",$hostlist) ) { } else { $newdates{$datekey} = $thisdate; } - $det .= ""; + my $dispdate = $newdates{$datekey}; + # if ( $dispdate lt $warndate ) { + if ( 0 ) { # manual packages don't need to be highlighted + $dispdate = "$dispdate !"; + } + $det .= ""; $det .= "\n"; my $key = "$restrname"; if ( !$summary{$key} ) { @@ -270,7 +278,11 @@ for my $hline ( split("\n",$hostlist) ) { } else { $newdates{$datekey} = $thisdate; } - $det .= ""; + my $dispdate = $newdates{$datekey}; + if ( ( $dispdate lt $warndate ) && ( $src =~ /Security/) ) { + $dispdate = "$dispdate !"; + } + $det .= ""; $det .= "\n"; } @@ -303,14 +315,18 @@ for my $hline ( split("\n",$hostlist) ) { $table .= "
" . $newdates{$datekey} . "" . $dispdate . "
" . $newdates{$datekey} . "" . $dispdate . "
\n"; # Save the date file -`mv -f $datefilename $dateoldfilename`; -open F, ">$datefilename" or die "Could not open date file $datefilename for writing"; -for my $k (sort(keys(%newdates)) ) { - print F "$k " . $newdates{$k}. "\n"; - print "date for '$k' '" . $newdates{$k}. "'\n" if $debug; +if ( ! $debug ) { + `mv -f $datefilename $dateoldfilename`; + open F, ">$datefilename" or die "Could not open date file $datefilename for writing"; + for my $k (sort(keys(%newdates)) ) { + print F "$k " . $newdates{$k}. "\n"; + print "date for '$k' '" . $newdates{$k}. "'\n" if $debug; + } + close F + or die "Could not close date file $datefilename: $!"; +} else { + print "Not updating the date file, this is a debug run\n"; } -close F - or die "Could not close date file $datefilename: $!"; # Page header my $outfile = "/tmp/aptcheck.html"; @@ -464,8 +480,6 @@ for my $P ( sort(keys(%summary)) ) { } print F "\n"; -print F "

Packages marked with * are from the time before started to " . - "track package dates \n"; print F "

Produced " . `date`. " on " . `hostname` . " by " . `whoami` . "
\n"; diff --git a/id-release b/id-release index bf56550..fd71ce8 100755 --- a/id-release +++ b/id-release @@ -76,7 +76,7 @@ perl -i.bak -npe "s,^Version: \d+.*,Version: $version," $spec ###################################################################### echo "" echo "# Please commit the version updates now" -echo "git commit -a" +echo "git commit -a -m'new release v$version'" echo "" echo "# Please run now" echo "git push" @@ -98,7 +98,8 @@ echo "sudo rpmbuild -ba $spec" echo "# if successfully, scp the package to ftp.indexdata.dk (kebab)" echo "\$HOME/proj/git-tools/id-rpm-build/upload-rpms.sh $spec" echo "" -echo "# on kebab run: sudo su; cd $HOME/proj/git-tools/update-archive; ./update-yum-archive.sh" +echo "# on kebab run: sudo su" +echo "# cd $HOME/proj/git-tools/update-archive && ./update-yum-archive.sh" ###################################################################### @@ -112,7 +113,8 @@ echo "sudo \$HOME/proj/git-tools/id-deb-build/id-pbuild.sh" echo "# if successfully, scp the package to ftp.indexdata.dk (kebab)" echo "\$HOME/proj/git-tools/id-deb-build/id-pbuild.sh --upload" echo "" -echo "# on kebab run: sudo su; cd $HOME/proj/git-tools/update-archive; ./update-archive.sh" +echo "# on kebab run: sudo su" +echo "# cd $HOME/proj/git-tools/update-archive && ./update-archive.sh" echo "" diff --git a/update-archive/update-archive.sh b/update-archive/update-archive.sh index b642138..1cec276 100755 --- a/update-archive/update-archive.sh +++ b/update-archive/update-archive.sh @@ -15,7 +15,6 @@ confdir=`pwd` architectures="i386 amd64" -architectures="i386 amd64" if [ "$1" == "" ]; then DISTRIBUTIONS="ubuntu/lucid ubuntu/natty ubuntu/oneiric ubuntu/precise ubuntu/quantal debian/wheezy debian/squeeze debian/lenny" else