/usr/src/openswan-2.6.38/packaging/utils/mksnap 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 | #!/usr/bin/perl
# make snapshot of FreeSwan code
# -l local build only, do not transmit
# -p nn pre-nn version (where nn is a release like 1.00)
# -d ddd build as of date ddd (implies -l)
require($ENV{'HOME'}."/bin/disttools.pl");
&defvars;
&suckvars;
umask(022);
$localdir=$ENV{'HOME'}."/archive";
$ENV{'DEV_DIR'}=$localdir."/development";
if(!defined($ENV{'USER'})) {
$ENV{'USER'}="build";
}
$tmpdir=$ENV{'BTMP'}."/".$ENV{'USER'}."/snapshots";
$transmit=1;
$symlink=0;
$snapprefix="";
$tarinfix="";
$relopt="";
$date="now";
$lastrel=$ENV{'LASTREL'};
$lastrel =~ y/\./\_/;
while(@ARGV) {
$_=shift;
if(/^-l/) {
$transmit=0;
} elsif(/^-D/) {
$debug++;
} elsif(/^-S/) {
$symlink=1;
} elsif(/^-p/) {
$arg=shift;
$snapprefix="$arg-";
} elsif(/^-r/) {
$arg=shift;
($lastrel=$arg) =~ y/\./\_/;
$relopt="-r PRE${lastrel}"
# } elsif(/^-d/) {
# $arg=shift;
# $transmit=0;
# $date=$arg;
} else {
print STDERR "mksnap:\n";
print STDERR "\t-l do not transmit\n";
print STDERR "\t-p stuff set snapshot prefix\n";
print STDERR "\t-r rel set release branch\n";
print STDERR "\t-d date set snapshot date\n";
exit;
}
}
$snapname=&snapname($snapprefix);
#if($date ne "now") {
# $snapname="`echo $date | tr -d ' :'`" ;;
#}
$dirname="freeswan-snap".$snapname;
$pkgname="snapshot-".$snapname;
$tarname=$pkgname.".tar";
&nicesystem("mkdir -p $tmpdir");
print "BUILDING snapshot $dirname\n";
if($transmit) {
print "WILL TRANSMIT TO $ENV{'DISTHOST'}\n"
} else {
print "WILL NOT TRANSMIT\n";
}
&setuppgp($lastrel);
&makedisttarfile($tmpdir, $pkgname, "$lastrel_$snapname", $dirname, $date, $relopt, 0);
unlink("snapshot.tar.gz");
&nicesystem("ln -s $tarname.gz snapshot.tar.gz") || die "failed to symlink to snapshot.tar.gz: $?\n";
&nicesystem("md5sum snapshot.tar.gz >snapshot.tar.gz.md5") || die "failed to md5sum of snapshot.tar.gz: $?\n";
&dopgpsig($pkgname);
if($transmit) {
system("date");
&upload($pkgname, "snapshot");
print "Cleaning up old snapshots\n";
local($file, $localroot);
$localroot=$ENV{'DEV_DIR'};
&nicesystem("cd $localroot && find . -name \"snapshot-*\" -print | grep -v $pkgname | xargs -r rm --");
&upsync;
system("date");
}
|