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

  • dd6974a
  • /
  • ssldir.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:6c30685206989c7e91a19b7c9a99d73dd7c47ca5
directory badge Iframe embedding
swh:1:dir:dd6974a7769e8a86d36d1b8160bc646ace830884
ssldir.pl
#!/usr/local/bin/perl

$#ARGV == 0 || die "usage: ssldir.pl /new/path\n";
@files=('crypto/cryptlib.h',
	'Makefile.ssl',
	'tools/c_rehash',
	'util/mk1mf.pl',
	);

%cryptlib=(
	'\sX509_CERT_AREA\s',"#define X509_CERT_AREA\t\t".'"%s"',
	'\sX509_CERT_DIR\s', "#define X509_CERT_DIR\t\t".'"%s/certs"',
	'\sX509_CERT_FILE\s', "#define X509_CERT_FILE\t\t".'"%s/cert.pem"',
	'\sX509_PRIVATE_DIR\s',"#define X509_PRIVATE_DIR\t".'"%s/private"',
	);

%Makefile_ssl=(
	'^INSTALLTOP=','INSTALLTOP=%s',
	);

%c_rehash=(
	'^DIR=',	'DIR=%s',
	);

%mk1mf=(
	'^$INSTALLTOP=','$INSTALLTOP="%s";',
	);

&dofile("crypto/cryptlib.h",$ARGV[0],%cryptlib);
&dofile("Makefile.ssl",$ARGV[0],%Makefile_ssl);
&dofile("tools/c_rehash",$ARGV[0],%c_rehash);
&dofile("util/mk1mf.pl",$ARGV[0],%mk1mf);

sub dofile
	{
	($f,$p,%m)=@_;

	open(IN,"<$f") || die "unable to open $f:$!\n";
	@a=<IN>;
	close(IN);
	foreach $k (keys %m)
		{
		grep(/$k/ && ($_=sprintf($m{$k}."\n",$p)),@a);
		}
	($ff=$f) =~ s/\..*$//;
	open(OUT,">$ff.new") || die "unable to open $f:$!\n";
	print OUT @a;
	close(OUT);
	rename($f,"$ff.old") || die "unable to rename $f\n";
	rename("$ff.new",$f) || die "unable to rename $ff.new\n";
	}

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

back to top