/usr/src/openswan-2.6.38/packaging/utils/mkcand is in openswan-modules-dkms 1:2.6.38-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | #!/usr/bin/perl
# mkcand m.nn
# package candidate, leaving it in tmp directory
require($ENV{'HOME'}."/bin/disttools.pl");
&defvars;
&suckvars;
umask(022);
$localdir=$ENV{'HOME'}."/archive";
$ENV{'DEV_DIR'}=$localdir."/development";
$tmpdir=$ENV{'BTMP'}."/".$ENV{'USER'}."/snapshots";
$transmit=1;
$snapprefix="";
$tarinfix="";
$date="now";
$lastrel=$ENV{'LASTREL'};
sub usage {
print STDERR "mkcand:\n";
print STDERR "\t-l do not transmit\n";
print STDERR "\t-p name set candidate name\n";
print STDERR "\t-r rel set release branch\n";
}
while(@ARGV) {
$_=shift;
if(/^-l/) {
$transmit=0;
} elsif(/^-S/) {
$symlink=1;
} elsif(/^-p/) {
$rel=shift;
$snapprefix="pre$rel-";
} elsif(/^-r/) {
$arg=shift;
($lastrel=$arg) =~ y/\./\_/;
$relopt="-r PRE${lastrel}"
# } elsif(/^-d/) {
# $arg=shift;
# $transmit=0;
# $date=$arg;
} else {
&usage;
exit;
}
}
if(!defined($relopt) ||
!defined($rel)) {
&usage;
exit;
}
if($rel < 2.00) {
undef(@supportedkernels);
}
$candname=&snapname($snapprefix);
$dirname="freeswan-cand".$candname;
# $pkgname="candidate-".$candname;
$pkgname=$dirname;
$tarname=$pkgname.".tar";
$vername="cand-".$candname;
&nicesystem("mkdir -p $tmpdir");
print "BUILDING candidate $candname in $dirname\n";
if($transmit) {
print "WILL TRANSMIT TO $ENV{'DISTHOST'}\n"
} else {
print "WILL NOT TRANSMIT\n";
}
&setuppgp($lastrel);
&makedisttarfile($tmpdir, $pkgname, $vername, $dirname, $date, $relopt, 1);
unlink("CANDIDATE.tar.gz");
&nicesystem("ln $tarname.gz CANDIDATE.tar.gz") || die "failed to symlink to CANDIDATE.tar.gz: $?\n";
&nicesystem("md5sum CANDIDATE.tar.gz >CANDIDATE.tar.gz.md5") || die "failed to md5sum of CANDIDATE.tar.gz: $?\n";
&dopgpsig($pkgname);
&nicesystem("pgp -kxa $ENV{'PGPNAME'} $pkgname.tar.gz.pgpkey && chmod +r $pkgname.tar.gz.pgpkey.asc");
if($transmit) {
system("date");
local($snapprefix);
&upload($pkgname);
if($symlink) {
&sendfiles("CANDIDATE.tar.gz.md5");
&remotecmd("cd ".$ENV{'DISTDIR'}." && ln -f -s $pkgname.tar.gz CANDIDATE.tar.gz && ln -f -s $tarname.gz.sig CANDIDATE.tar.gz.sig");
foreach $ver (@supportedkernels) {
&remotecmd("cd ".$ENV{'DISTDIR'}." && ln -f -s $pkgname$ver.patch.gz CAND.KERN$ver.gz && ln -f -s $tarname.gz.sig CAND.KERN$ver.gz.sig");
}
}
print "Cleaning up old candidates\n";
local($file, $localroot);
$localroot=$ENV{'DEV_DIR'};
&nicesystem("cd $localroot && find . -mtime +3 | grep 'freeswan-cand$snapprefix' | xargs rm");
&upsync;
system("date");
}
|