Plan 9 from Bell Labs’s /usr/web/sources/contrib/john/decontrib

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc
# A tool to convert a contrib package (thanks fgb!) into a tarball.
# Syntax: ungooify [sources-user] [contrib-packagename]
# Thus, if I wanted to convert the existing package fgb/z into a tarball, I'd run:
# convert-contrib fgb z
# which will create under the current directory a new directory
# named "z", which will contain a README file and all the files of the contrib package,
# which then gets compressed into z.tgz.

# Connect to sources
9fs sources

# Make the initial directory
mkdir $2

@{
cd $2

# Grab the db file from your source
cp /n/sources/contrib/$1/replica/$2/db .

# Grab the information file and name it README
cp /n/sources/contrib/$1/replica/$2/inf README

# make directories
echo creating directories
for (i in `{cat db | grep 20000000 | awk '{print $1}'}) {
	echo mkdir -p $i
	mkdir -p $i
}

# grab files from contrib
echo fetching files from contrib, this is going to take a long time
for (i in `{grep -v 20000000 db | awk '{print $1}'}) {
	echo fcp /n/sources/contrib/$1/root/$i $i
	fcp /n/sources/contrib/$1/root/$i $i
}

rm db

# make a tarball because it's faster this way
#echo Creating root.tgz
#tar czvf root.tgz root
}

echo Creating $2.tgz
tar czvf $2.tgz $2

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].