-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcyginstall2.sh
More file actions
20 lines (17 loc) · 987 Bytes
/
cyginstall2.sh
File metadata and controls
20 lines (17 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
UNIQ_PACKAGES_FILE=~/tmp/cygwin_uniq_packages.tmp
INSTALLED_PACKAGES_FILE=~/tmp/cygwin_installed_packages.tmp
INSTALLED_PACKAGES_REGEX_FILE=~/tmp/cygwin_installed_packages_regex.tmp
PACKAGES_TO_INSTALL_FILE=~/tmp/cygwin_install_packages.tmp
#fmt: ungültige Zeilenbreite: „4096“: Numerical result out of range
WIDTH=1024
WIDTH=8192
WIDTH=4096
WIDTH=2048
CMD=`cat $PACKAGES_TO_INSTALL_FILE | fmt -w $WIDTH | head -n1 | sed -Ee 's/ +/,/g' -e 's/, /,/g' -e 's/,$//g' -e 's/^, ?//g' -e 's#^#/c/cygwin64/setup-x86_64 -q -n -N -d -P #g'`
echo $CMD
$CMD
cat $PACKAGES_TO_INSTALL_FILE | fmt -w $WIDTH | head -n1 | tr '[:space:]' '\n' >> $INSTALLED_PACKAGES_FILE
cat $INSTALLED_PACKAGES_FILE | tr '[:space:]' '|' | sed -Ee 's/\|$//g' -e 's/^/\\b(/g' -e 's/$/)\\b/g' > $INSTALLED_PACKAGES_REGEX_FILE
PACKAGES_TO_INSTALL=`cat $UNIQ_PACKAGES_FILE | tr '[:space:]' '\n' | grep -vf $INSTALLED_PACKAGES_FILE`
echo $PACKAGES_TO_INSTALL | tr '[:space:]' '\n' > $PACKAGES_TO_INSTALL_FILE