Comments (3)
Format
json
{
"groups": {
"group": {
"id": "0",
"name": "NAME OF GROUP",
"enabled": true,
"installer": "yaourt",
"packages": ["pkg1", "pkg2", "pkgN"]
}
}
}
Yaml
groups:
group:
id: 0
name: NAME OF GROUP
enabled: true
installer: yaourt
packages:
- pkg1
- pkg2
- pkgN
from distro-config.
Code
Ultimately, whatever I do will follow the following pseudocode:
file.load("path")
foreach group in file
if (group.enabled)
print "Installing: " + group.name
command(group.installer+" -S --needed "+group.packages)
recordInstalledGroup(group.id)
else
print "Skipping: " + group.name
Python
json
import json
json.load(open('/tmp/config.json'))
# TODO
Yaml
http://pyyaml.org/wiki/PyYAMLDocumentation
import yaml
config = yaml.load(file("path/to/config.yml"))
# TODO
go
json
# TODO
Yaml
# TODO
from distro-config.
Ok, the above might be a little over-engineered. So how about this:
Format
- Each file is a group. The filename is the group's name
- Each line is in the file is a set of packages to install
- Files which start with a dash (-) are skipped
Code
#!/bin/bash
if [ $# -le 0 ]; then
echo "USAGE: `basename $0` directory ..."
exit 1
fi
here=$(cd `dirname $0`; pwd)
directories="$@"
rootMnt=TODO
for dir in ${directories}; do
pushd ${dir} >/dev/null 2>&1
# Install AUR packages
echo "====> Installing AUR packages"
for aur-file in `ls -1 *.aur`; do
for pkg in `cat ${aur-file} | egrep -v '^#'`; do
echo ":: Installing ${pkg}"
${here}/installAUR.sh ${pkg} ${rootMnt}
done
done
# Install all other packages
echo "====> Installing all packages"
for file in `ls -1 | grep -v .aur`; do
if [ "${file:0:1}" == "-" ]; then
echo ":: Skipping: ${file:1}"
else
echo ":: Installing ${file}"
${installer} -S --needed `cat ${file} | egrep -v '^#' | xargs` -r ${rootMnt}
fi
end
popd >/dev/null 2>&1
end
from distro-config.
Related Issues (20)
- UEFI Support HOT 1
- Bluetooth support HOT 1
- Printer support HOT 1
- Add hostname
- Finish refactor of wifi config HOT 8
- Add line that disables touchpad when typing
- Determine CPU scaling config
- Create udev rules to automount some things?
- Reorganize the scripts to be more logical HOT 14
- Move AUR installation code to 3-packaging.sh
- Place tmp expansion in a different script
- Move root configuration to the same script
- Copy the internet profile generated initially to the root partition
- Create a script that sorts the pacman mirrorlist HOT 1
- Add 3% battery watching udev rule
- fstab is being generated with wrong swapfile path
- Disable laptop keyboard when pok3r is plugged in HOT 1
- Incorporate the pkgbuild repo
- DepShield encountered errors while building your project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from distro-config.