Compare commits
11 Commits
Author | SHA1 | Date |
---|---|---|
|
71dc3b8396 | |
|
12e9549c00 | |
|
2cac8244cc | |
|
3a40db999b | |
|
5ef3cf48e2 | |
|
22a687440f | |
|
1d5df19948 | |
|
807a91f87a | |
|
0638b38932 | |
|
cf0e883858 | |
|
b6076c2900 |
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Stephen Jungels
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
14
apt-cyg
14
apt-cyg
|
@ -23,6 +23,12 @@
|
|||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
if [ ${BASH_VERSINFO}${BASH_VERSINFO[1]} -lt 42 ]
|
||||
then
|
||||
echo 'Bash version 4.2+ required'
|
||||
exit
|
||||
fi
|
||||
|
||||
usage="\
|
||||
NAME
|
||||
apt-cyg - package manager utility
|
||||
|
@ -116,10 +122,16 @@ function wget {
|
|||
if command wget -h &>/dev/null
|
||||
then
|
||||
command wget "$@"
|
||||
else
|
||||
# see https://github.com/transcode-open/apt-cyg/issues/99
|
||||
elif command lynx -version &>/dev/null
|
||||
then
|
||||
warn wget is not installed, using lynx as fallback
|
||||
set "${*: -1}"
|
||||
lynx -source "$1" > "${1##*/}"
|
||||
else
|
||||
warn wget and lynx are not installed, using curl as fallback
|
||||
set "${*/\-O/" -o"}"
|
||||
command curl -L $1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
145
apt-msys2
145
apt-msys2
|
@ -1,145 +0,0 @@
|
|||
#!/bin/bash
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2014 Steven Penny
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
function usage {
|
||||
local rw=(
|
||||
'apt-msys2 [command] [packages]'
|
||||
''
|
||||
'Commands:'
|
||||
' install <packages> install packages'
|
||||
' listfiles <packages> list files owned by packages'
|
||||
' search <patterns> search for a filename from all available packages'
|
||||
)
|
||||
printf '%s\n' "${rw[@]}"
|
||||
}
|
||||
|
||||
function urlencode {
|
||||
sed '
|
||||
s / %2f g
|
||||
s : %3a g
|
||||
' <<< "$1"
|
||||
}
|
||||
|
||||
function findworkspace {
|
||||
mirror=http://downloads.sourceforge.net/project/msys2
|
||||
repo=REPOS/MINGW/$ARCH
|
||||
local mirrordir=/var/cache/$(urlencode $mirror)/$repo
|
||||
mkdir -p $mirrordir
|
||||
cd $mirrordir
|
||||
}
|
||||
|
||||
function getdb {
|
||||
[ -e mingw64.files.tar.gz ] && return
|
||||
wget $mirror/$repo/mingw64.files.tar.gz
|
||||
tar --no-an -Oxf mingw64.files.tar.gz desc files > mingw64.lst
|
||||
}
|
||||
|
||||
function apt-listfiles {
|
||||
findworkspace
|
||||
getdb
|
||||
local pkg
|
||||
for pkg in ${packages[*]}
|
||||
do
|
||||
awk '
|
||||
$2 == "%NAME%\n" pkg {
|
||||
print $NF
|
||||
}
|
||||
' pkg=$pkg RS=%FILENAME% FS='\n\n' mingw64.lst
|
||||
done |
|
||||
head -c-1
|
||||
}
|
||||
|
||||
function apt-install {
|
||||
findworkspace
|
||||
getdb
|
||||
local pkg file eu oe rw
|
||||
for pkg in ${packages[*]}
|
||||
do
|
||||
file=$(awk '$5 == pkg, $0 = $2' pkg=$pkg RS=%FILENAME% FS='\n' mingw64.lst)
|
||||
wget -nc $mirror/$repo/$file
|
||||
tar --str 1 -x -C / -f $file
|
||||
|
||||
apt-msys2 listfiles $pkg | grep '\.exe$' | while read eu
|
||||
do
|
||||
oe=$(sed 's-^.*/--; s-\.exe$--' <<< $eu)
|
||||
rw=(
|
||||
'tg=$(cygpath -m $1)'
|
||||
'shift'
|
||||
'cygstart ${0#/usr/local} $tg $*'
|
||||
)
|
||||
printf '%s\n' "${rw[@]}" > $oe
|
||||
install $oe /usr/local/bin
|
||||
done
|
||||
|
||||
echo Package $pkg installed
|
||||
done
|
||||
}
|
||||
|
||||
function apt-search {
|
||||
findworkspace
|
||||
getdb
|
||||
for pkg in ${packages[*]}
|
||||
do
|
||||
awk '
|
||||
$0 ~ pkg {
|
||||
print $5
|
||||
}
|
||||
' pkg="$pkg" RS=%FILENAME% FS='\n' mingw64.lst
|
||||
done
|
||||
}
|
||||
|
||||
while (( $# ))
|
||||
do
|
||||
case "$1" in
|
||||
|
||||
install | listfiles | search)
|
||||
if [[ $command ]]
|
||||
then
|
||||
packages+=($1)
|
||||
else
|
||||
command=$1
|
||||
fi
|
||||
shift
|
||||
;;
|
||||
|
||||
*)
|
||||
packages+=($1)
|
||||
shift
|
||||
;;
|
||||
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $HOSTTYPE = x86_64 ]
|
||||
then
|
||||
ARCH=x86_64
|
||||
else
|
||||
ARCH=x86
|
||||
fi
|
||||
|
||||
if type -t apt-$command | grep -q function
|
||||
then
|
||||
apt-$command
|
||||
else
|
||||
usage
|
||||
fi
|
33
go/README.md
33
go/README.md
|
@ -1,33 +0,0 @@
|
|||
# Why Go?
|
||||
|
||||
Consider this Python script
|
||||
|
||||
~~~py
|
||||
print("Hello world")
|
||||
~~~
|
||||
|
||||
You can compile it for Windows like this
|
||||
|
||||
build_exe --bundle-files 0 --compress --optimize hello.py
|
||||
upx -9 hello.exe
|
||||
|
||||
and it comes out to 4.16 MB. Now consider this Go script
|
||||
|
||||
~~~go
|
||||
package main
|
||||
import "fmt"
|
||||
func main() {
|
||||
fmt.Println("Hello world")
|
||||
}
|
||||
~~~
|
||||
|
||||
You can compile it like this
|
||||
|
||||
go build -ldflags -s hello.go
|
||||
upx -9 hello.exe
|
||||
|
||||
and it comes out to 375 KB. Something else to consider is that Python is built
|
||||
with Visual C++ 2010. That means that the program you create will not work on
|
||||
Windows 7 for example unless the user has installed Visual C++ 2010. Go is built
|
||||
with Visual C++ 6, this means that any programs created with Go will work on
|
||||
Windows 7 as is.
|
58
go/go-cyg.go
58
go/go-cyg.go
|
@ -1,58 +0,0 @@
|
|||
package main
|
||||
import (
|
||||
"compress/bzip2"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func wget(url string) {
|
||||
tokens := strings.Split(url, "/")
|
||||
fileName := tokens[len(tokens)-1]
|
||||
fmt.Println("Downloading", url, "to", fileName)
|
||||
output, err := os.Create(fileName)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
response, err := http.Get(url)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
n, err := io.Copy(output, response.Body)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println(n, "bytes downloaded.")
|
||||
}
|
||||
|
||||
func bunzip2(alpha string) {
|
||||
bravo, err := os.Open(alpha)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
charlie := bzip2.NewReader(bravo)
|
||||
delta, err := os.Create("setup.ini")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
io.Copy(delta, charlie)
|
||||
}
|
||||
|
||||
func foxtrot() {
|
||||
// create release folder
|
||||
os.MkdirAll("mirror/x86_64/release", 0)
|
||||
// cd
|
||||
os.Chdir("mirror/x86_64")
|
||||
// download
|
||||
wget("http://cygwin.osuosl.org/x86_64/setup.bz2")
|
||||
// extract
|
||||
bunzip2("setup.bz2")
|
||||
}
|
||||
|
||||
func main() {
|
||||
foxtrot()
|
||||
// parse ini
|
||||
// category: Base
|
||||
}
|
|
@ -6,11 +6,7 @@ Cygwin which cooperates with Cygwin Setup and uses the same repository.
|
|||
|
||||
[github.com/transcode-open/apt-cyg][1]
|
||||
|
||||
[![bountysource][3]][2]
|
||||
|
||||
[1]:https://github.com/transcode-open/apt-cyg
|
||||
[2]:https://www.bountysource.com/teams/svnpenn
|
||||
[3]:https://api.bountysource.com/badge/team?team_id=114003&style=raised
|
||||
|
||||
Operations
|
||||
----------
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# Note from the developer
|
||||
|
||||
I am no longer working on apt-cyg. As far as I know, it works.
|
||||
|
||||
However it was written quite a while ago by reverse engineering the files used by Cygwin's setup.exe program. It doesn't
|
||||
share any code with setup.exe, and if setup.exe is modified in such a way that assumptions made by apt-cyg no longer
|
||||
apply, apt-cyg will break.
|
||||
|
||||
apt-cyg is an infrastructure program and probably belongs in Cygwin rather than here, but as far as I know, RedHat is
|
||||
no longer paying more than one or two engineers to work on Cygwin and they are unlikely to do anything with apt-cyg or
|
||||
other, similar programs that are out there.
|
||||
|
||||
Because I got dragged into a time-consuming and unpleasant law suit involving apt-cyg, I am very unlikely to put
|
||||
more time and effort into it anytime soon, even though I won. I write open source software because I enjoy it, not so
|
||||
I can get involved in meaningless conflicts.
|
||||
|
||||
If you would like to contribute to apt-cyg, the best way to do that is to fork it. You don't need my permission to
|
||||
do that, just follow the license.
|
||||
|
||||
--Steve Jungels
|
Loading…
Reference in New Issue