Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • c7b1687
  • /
  • util
  • /
  • up_ver.pl
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:e4a13bf098c329c1a5a45d79b808d4e0d71ca11c
directory badge Iframe embedding
swh:1:dir:298e2a1cfdeabc6991af8d2adc8631cd26383ee1
up_ver.pl
#!/usr/local/bin/perl
#
# Up the version numbers in the files.
#

@files=(
	"crypto/crypto.h",
	"crypto/des/ecb_enc.c",
	"crypto/idea/i_ecb.c",
	"crypto/lhash/lhash.c",
	"crypto/conf/conf.c",
	"crypto/md2/md2_dgst.c",
	"crypto/md5/md5_dgst.c",
	"crypto/ripemd/rmd_dgst.c",
	"crypto/pem/pem_lib.c",
	"crypto/bn/bn_lib.c",
	"crypto/dh/dh_lib.c",
	"crypto/rc2/rc2_ecb.c",
	"crypto/rc4/rc4_skey.c",
	"crypto/rc5/rc5_ecb.c",
	"crypto/bf/bf_ecb.c",
	"crypto/cast/c_ecb.c",
	"crypto/rsa/rsa_lib.c",
	"crypto/dsa/dsa_lib.c",
	"crypto/sha/sha1dgst.c",
	"crypto/sha/sha_dgst.c",
	"crypto/asn1/asn1_lib.c",
	"crypto/x509/x509_vfy.c",
	"crypto/evp/evp_enc.c",
	"crypto/rand/md_rand.c",
	"crypto/stack/stack.c",
	"crypto/txt_db/txt_db.c",
	"crypto/cversion.c",
	"ssl/ssl_lib.c",
	"ssl/s2_lib.c",
	"ssl/s3_lib.c",
	"ssl/t1_lib.c",
	"README",
	);

@month=('Jan','Feb','Mar','Apr','May','Jun',
	'Jul','Aug','Sep','Oct','Nov','Dec');
@a=localtime(time());
$time=sprintf("%02d-%s-%04d",$a[3],$month[$a[4]],$a[5]+1900);

$ver=$ARGV[0];
($ver ne "") || die "no version number specified\n";
($a,$b,$c,$d)=unpack('axaxac',$ver);
$d=defined($d)?$d-96:0;
$xver=sprintf("%x%x%x%x",$a,$b,$c,$d);

foreach $file (@files)
	{
	open(IN,"<$file") || die "unable to open $file:$!\n";
	open(OUT,">$file.new") || die "unable to open $file.new:$!\n";
	$found=0;

	print STDERR "$file:";

	while (<IN>)
		{
		if ((s/SSLeay \d\.\d.\d[^"]*(\"|\s)/SSLeay $ver $time\1/) ||
			s/^(\#define\s+SSLEAY_VERSION_NUMBER\s+0x)[0-9a-zA-Z]+(.*)$/$1$xver$2/)
			{
			print STDERR " Done";
			$found++;
			print OUT;
			while (<IN>) { print OUT; }
			last;
			}
		print OUT;
		}
	print STDERR "\n";
	close(IN);
	close(OUT);
	(!$found) && die "unable to update the version number in $file\n";
	rename($file,"$file.old") || die "unable to rename $file:$!\n";
	rename("$file.new",$file) || die "unable to rename $file.new:$!\n";
	}

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top