Skip to content

Instantly share code, notes, and snippets.

@cip123
Created August 20, 2017 18:14
Show Gist options
  • Select an option

  • Save cip123/dfef1cd90ed95e15361d87bcbb254a4a to your computer and use it in GitHub Desktop.

Select an option

Save cip123/dfef1cd90ed95e15361d87bcbb254a4a to your computer and use it in GitHub Desktop.
#!/bin/bash -x
# script to download the package source and calls Slackbuild automatically.
#
# Requirements
#
# you should have a cloned repository of slackbuilds
# git clone git://git.slackbuilds.org/slackbuilds.git
#
# uses
# [wget] to download
#
# Syntax: ie
# slackbuild.sh slackbuilds/graphics/dia
name=$1
if [ ! $1 ]; then
echo "** type something."
exit
fi
# change directory
cd $1
if [ $? -ne 0 ]; then
echo "** $1 not found"
exit
fi
# for verbose purposes.
pwd
ls
ls *.info
# source in *info files to get DOWNLOAD variable.
if [ ! -e *.info ]; then
echo "** there is no *.info"
exit
fi
source *.info
# if no DOWNLOAD variable quit
if [ ! $DOWNLOAD ]; then
echo "** cannot find $DOWNLOAD variable"
exit
fi
# use wget to get source.
wget --progress=bar $DOWNLOAD
# quit if download failure
if [ $? -ne 0 ]; then
echo "** download failed."
fi
# begin building.
sh *SlackBuild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment